Perl
Perl
Perl
NAME
perl - The Perl 5 language interpreter
SYNOPSIS
perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]
[ -Idir ] [ -m[-]module ] [ -M[-]’module...’ ] [ -f ] [ -C [number/list] ] [ -S ]
[ -x[dir] ] [ -i[extension] ]
[ [-e|-E] ’command’ ] [ -- ] [ programfile ] [ argument ]...
For more information on these options, you can run perldoc perlrun.
GETTING HELP
The perldoc program gives you access to all the documentation that comes with Perl. You can get more
documentation, tutorials and community support online at <http://www.perl.org/>.
If you’re new to Perl, you should start by running perldoc perlintro, which is a general intro for
beginners and provides some background to help you navigate the rest of Perl’s extensive documentation.
Run perldoc perldoc to learn more things you can do with perldoc.
For ease of access, the Perl manual has been split up into several sections.
Overview
perl Perl overview (this section)
perlintro Perl introduction for beginners
perlrun Perl execution and options
perltoc Perl documentation table of contents
Tutorials
perlreftut Perl references short introduction
perldsc Perl data structures intro
perllol Perl data structures: arrays of arrays
Reference Manual
perlsyn Perl syntax
perldata Perl data structures
perlop Perl operators and precedence
perlsub Perl subroutines
perlfunc Perl built-in functions
perlopentut Perl open() tutorial
perlpacktut Perl pack() and unpack() tutorial
perlpod Perl plain old documentation
perlpodspec Perl plain old documentation format specification
perlpodstyle Perl POD style guide
perldiag Perl diagnostic messages
perldeprecation Perl deprecations
perllexwarn Perl warnings and their control
perldebug Perl debugging
perlvar Perl predefined variables
perlre Perl regular expressions, the rest of the story
perlrebackslash Perl regular expression backslash sequences
perlrecharclass Perl regular expression character classes
perlreref Perl regular expressions quick reference
perlref Perl references, the rest of the story
perlform Perl formats
perlobj Perl objects
perltie Perl objects hidden behind simple variables
perldbmfilter Perl DBM filters
AVAILABILITY
Perl is available for most operating systems, including virtually all Unix-like platforms. See ‘‘Supported
Platforms’’ in perlport for a listing.
ENVIRONMENT
See perlrun.
AUTHOR
Larry Wall <[email protected]>, with the help of oodles of other folks.
If your Perl success stories and testimonials may be of help to others who wish to advocate the use of Perl
in their applications, or if you wish to simply express your gratitude to Larry and the Perl developers,
please write to [email protected] .
FILES
"@INC" locations of perl libraries
‘‘@INC’’ above is a reference to the built-in variable of the same name; see perlvar for more information.
SEE ALSO
http://www.perl.org/ the Perl homepage
http://www.perl.com/ Perl articles (O'Reilly)
http://www.cpan.org/ the Comprehensive Perl Archive
http://www.pm.org/ the Perl Mongers
DIAGNOSTICS
Using the use strict pragma ensures that all variables are properly declared and prevents other
misuses of legacy Perl features.
The use warnings pragma produces some lovely diagnostics. One can also use the -w flag, but its use
is normally discouraged, because it gets applied to all executed Perl code, including that not under your
control.
See perldiag for explanations of all Perl’s diagnostics. The use diagnostics pragma automatically
turns Perl’s normally terse warnings and errors into these longer forms.
Compilation errors will tell you the line number of the error, with an indication of the next token or token
type that was to be examined. (In a script passed to Perl via -e switches, each -e is counted as one line.)
Setuid scripts have additional constraints that can produce error messages such as ‘‘Insecure dependency’’.
See perlsec.
Did we mention that you should definitely consider using the use warnings pragma?
BUGS
The behavior implied by the use warnings pragma is not mandatory.
Perl is at the mercy of your machine’s definitions of various operations such as type casting, atof(), and
floating-point output with sprintf().
If your stdio requires a seek or eof between reads and writes on a particular stream, so does Perl. (This
doesn’t apply to sysread() and syswrite().)
While none of the built-in data types have any arbitrary size limits (apart from memory size), there are still
a few arbitrary limits: a given variable name may not be longer than 251 characters. Line numbers
displayed by diagnostics are internally stored as short integers, so they are limited to a maximum of 65535
(higher numbers usually being affected by wraparound).
You may mail your bug reports (be sure to include full configuration information as output by the myconfig
program in the perl source tree, or by perl -V) to [email protected] . If you’ve succeeded in compiling
perl, the perlbug script in the utils/ subdirectory can be used to help mail in a bug report.
Perl actually stands for Pathologically Eclectic Rubbish Lister, but don’t tell anyone I said that.
NOTES
The Perl motto is ‘‘There’s more than one way to do it.’’ Divining how many more is left as an exercise to
the reader.
The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for
why.