This page provides some style guidelines for using Perl, a scripting language used by several small tools in the tree:
- Ensure all Perl scripts use the proper suffix (
.pl for scripts, and
.pm for modules)
- 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.
- use
'#!/usr/bin/perl'
as the first line of Perl scripts.
- always
use strict
and use warnings
- invoke scripts indirectly in Makefiles or other scripts:
Maintainers must also be sure to follow additional guidelines:
- Ensure that Perl scripts are committed as executables: Use "<code>chmod +x script.pl</code>" before using "<code>git add script.pl</code>"