perl (manpage)

NAME
- Practical Extraction and Report Language

SYNOPSIS
...

DESCRIPTION
Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).

Perl combines (in the author's opinion, anyway) some of the best features of C, sed, awk, and sh, so people familiar with those languages should have little difficulty with it. (Language historians will also note some vestiges of csh, Pascal, and even BASIC-PLUS.) Expression syntax corresponds closely to C expression syntax. Unlike most Unix utilities, Perl does not arbitrarily limit the size of your data--if you've got the memory, Perl can slurp in your whole file as a single string. Recursion is of unlimited depth. And the tables used by hashes (sometimes called "associative arrays") grow as necessary to prevent degraded performance. Perl can use sophisticated pattern matching techniques to scan large amounts of data quickly. Although optimized for scanning text, Perl can also deal with binary data, and can make dbm files look like hashes. Setuid Perl scripts are safer than C programs through a dataflow tracing mechanism that prevents many stupid security holes.

If you have a problem that would ordinarily use sed or awk or sh, but it exceeds their capabilities or must run a little faster, and you don't want to write the silly thing in C, then Perl may be for you. There are also translators to turn your sed and awk scripts into Perl scripts.

If you're new to Perl, you should start with, which is a general intro for beginners and provides some background to help you navigate the rest of Perl's extensive documentation.

For ease of access, the Perl manual has been split up into several sections.

Tutorials

 * }

Reference Manual

 * || Perl plain old documentation
 * || Perl plain old documentation format specification
 * || Perl execution and options
 * ||Perl diagnostic messages
 * || Perl warnings and their control
 * || Perl debugging
 * || Perl predefined variables
 * || Perl regular expressions, the rest of the story
 * || Perl regular expressions quick reference
 * || Perl references, the rest of the story
 * || Perl formats
 * || Perl objects
 * || Perl objects hidden behind simple variables
 * colspan=2 |
 * || Perl regular expressions, the rest of the story
 * || Perl regular expressions quick reference
 * || Perl references, the rest of the story
 * || Perl formats
 * || Perl objects
 * || Perl objects hidden behind simple variables
 * colspan=2 |
 * || Perl formats
 * || Perl objects
 * || Perl objects hidden behind simple variables
 * colspan=2 |
 * || Perl objects hidden behind simple variables
 * colspan=2 |
 * colspan=2 |


 * || Perl DBM filters
 * }
 * || Perl interprocess communication
 * || Perl fork information
 * || Perl number semantics
 * || Perl threads tutorial
 * colspan=2 |
 * || Perl number semantics
 * || Perl threads tutorial
 * colspan=2 |
 * || Perl threads tutorial
 * colspan=2 |
 * colspan=2 |

- - - - -
 * || Old Perl threads tutorial
 * }
 * || Perl portability guide
 * || Perl locale support
 * || Perl Unicode introduction
 * || Perl Unicode support
 * || Considerations for running Perl on EBCDIC platforms
 * colspan=2 |
 * || Perl Unicode introduction
 * || Perl Unicode support
 * || Considerations for running Perl on EBCDIC platforms
 * colspan=2 |
 * || Considerations for running Perl on EBCDIC platforms
 * colspan=2 |
 * colspan=2 |
 * || Perl security
 * colspan=2 |
 * colspan=2 |
 * colspan=2 |
 * || Perl modules: how they work
 * || Perl modules: how to write and use
 * || Perl modules: how to write modules with style
 * || Perl modules: how to install from CPAN
 * || Perl modules: preparing a new module for distribution
 * colspan=2 |
 * || Perl modules: how to install from CPAN
 * || Perl modules: preparing a new module for distribution
 * colspan=2 |
 * || Perl modules: preparing a new module for distribution
 * colspan=2 |
 * colspan=2 |
 * || utilities packaged with the Perl distribution
 * colspan=2 |
 * colspan=2 |
 * colspan=2 |
 * || Perl compiler suite intro
 * colspan=2 |
 * colspan=2 |
 * colspan=2 |
 * || Perl source filters
 * }
 * }

Platform-Specific
On Debian systems, you need to install the perl-doc package which contains the majority of the standard Perl documentation and the perldoc program.

Extensive additional documentation for Perl modules is available, both those distributed with Perl and third-party modules which are packaged or locally installed.

You should be able to view Perl's documentation with your (1) program or (1).

If something strange has gone wrong with your program and you're not sure where you should look for help, try the -w switch first. It will often point out exactly where the trouble is.

But wait, there's more...

Begun in 1993 (see ), Perl version 5 is nearly a complete rewrite that provides the following additional benefits:


 * modularity and reusability using innumerable modules
 * Described in, , and.
 * embeddable and extensible
 * Described in, , , , , and.
 * roll-your-own magic variables (including multiple simultaneous DBM implementations)
 * Described in and AnyDBM_File.
 * subroutines can now be overridden, autoloaded, and prototyped
 * Described in.
 * arbitrarily nested data structures and anonymous functions
 * Described in, , , and.
 * object-oriented programming
 * Described in, , , , and.
 * support for light-weight processes (threads)
 * Described in and.
 * support for Unicode, internationalization, and localization
 * Described in, and Locale::Maketext.
 * lexical scoping
 * Described in.
 * regular expression enhancements
 * Described in, with additional examples in.
 * enhanced debugger and interactive Perl environment, with integrated editor support
 * Described in, and.
 * POSIX 1003.1 compliant library
 * Described in POSIX.

Okay, that's definitely enough hype.

AVAILABILITY
Perl is available for most operating systems, including virtually all Unix-like platforms. See "Supported Platforms" in for a listing.

ENVIRONMENT
See.

AUTHOR
Larry Wall larry@wall, 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 perl-thanks@perl.

FILES

 * "@INC":locations of perl libraries

DIAGNOSTICS
The "use warnings" pragma (and the -w switch) produces some lovely diagnostics.

See 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.

Did we mention that you should definitely consider using the -w switch?

BUGS
The -w switch is not mandatory.

Perl is at the mercy of your machine's definitions of various operations such as type casting,, and floating-point output with.

If your stdio requires a seek or eof between reads and writes on a particular stream, so does Perl. (This doesn't apply to and .)

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 perlbug@perl. 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.