OpenOCD
Perl Style Guide

This page provides some style guidelines for using Perl, a scripting language used by several small tools in the tree:

  1. Ensure all Perl scripts use the proper suffix (.pl for scripts, and .pm for modules)
  2. Pass files as script parameters or piped as input:
    • Do NOT code paths to files in the tree, as this breaks out-of-tree builds.
    • If you must, then you must also use an automake rule to create the script.
  3. use '#!/usr/bin/perl' as the first line of Perl scripts.
  4. always use strict and use warnings
  5. invoke scripts indirectly in Makefiles or other scripts:
    perl script.pl

Maintainers must also be sure to follow additional guidelines:

  1. Ensure that Perl scripts are committed as executables: Use "<code>chmod +x script.pl</code>" before using "<code>git add script.pl</code>"