perl - Practical Extraction and Report Language


NAME

perl - Practical Extraction and Report Language

__top


SYNOPSIS

perl-sTuU ] [ -hv ] [ -V[:configvar] ] [ -cw ] [ -d[:debugger] ] [ -D[number/list] ] [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal] ] [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -P ] [ -S ] [ -x[dir] ] [ -i[extension] ] [ -e 'command' ]      [ -- ] [ programfile ] [ argument ]...

If you're new to Perl, you should start with the perlintro manpage, 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.

Overview

    perl                Perl overview (this section)
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlintro.html:">perlintro           Perl introduction for beginners
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perltoc.pod:">perltoc             Perl documentation table of contents

Tutorials

    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlreftut.pod:">perlreftut          Perl references short introduction
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldsc.pod:">perldsc             Perl data structures intro
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perllol.pod:">perllol             Perl data structures: arrays of arrays
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlrequick.pod:">perlrequick         Perl regular expressions quick start
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlretut.pod:">perlretut           Perl regular expressions tutorial
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlboot.pod:">perlboot            Perl OO tutorial for beginners
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perltoot.pod:">perltoot            Perl OO tutorial, part 1
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perltooc.pod:">perltooc            Perl OO tutorial, part 2
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlbot.pod:">perlbot             Perl OO tricks and examples
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlstyle.pod:">perlstyle           Perl style guide
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perltrap.pod:">perltrap            Perl traps for the unwary
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldebtut.pod:">perldebtut          Perl debugging tutorial
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq.pod:">perlfaq             Perl frequently asked questions
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq1.pod:">perlfaq1          General Questions About Perl
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq2.pod:">perlfaq2          Obtaining and Learning about Perl
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq3.pod:">perlfaq3          Programming Tools
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq4.pod:">perlfaq4          Data Manipulation
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq5.pod:">perlfaq5          Files and Formats
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq6.pod:">perlfaq6          Regexes
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq7.pod:">perlfaq7          Perl Language Issues
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq8.pod:">perlfaq8          System Interaction
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfaq9.pod:">perlfaq9          Networking

Reference Manual

    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlsyn.pod:">perlsyn             Perl syntax
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldata.pod:">perldata            Perl data structures
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlop.pod:">perlop              Perl operators and precedence
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlsub.pod:">perlsub             Perl subroutines
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfunc.pod:">perlfunc            Perl built-in functions
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlopentut.pod:">perlopentut       Perl open() tutorial
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlpacktut.pod:">perlpacktut       Perl pack() and unpack() tutorial
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlpod.pod:site/lib/perlpod.pod:">perlpod             Perl plain old documentation
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlpodspec.pod:site/lib/perlpodspec.pod:">perlpodspec         Perl plain old documentation format specification
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlrun.pod:">perlrun             Perl execution and options
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldiag.pod:">perldiag            Perl diagnostic messages
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perllexwarn.pod:">perllexwarn         Perl warnings and their control
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldebug.pod:">perldebug           Perl debugging
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlvar.pod:">perlvar             Perl predefined variables
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlre.pod:">perlre              Perl regular expressions, the rest of the story
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlref.pod:">perlref             Perl references, the rest of the story
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlform.pod:">perlform            Perl formats
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlobj.pod:">perlobj             Perl objects
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perltie.pod:">perltie             Perl objects hidden behind simple variables
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perldbmfilter.pod:">perldbmfilter     Perl DBM filters
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlipc.pod:">perlipc             Perl interprocess communication
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfork.pod:">perlfork            Perl fork() information
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlnumber.pod:">perlnumber          Perl number semantics
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlthrtut.pod:">perlthrtut          Perl threads tutorial
      /dar/arlib32/out/html/man/perl/html/lib/Pod/perlothrtut.pod:">perlothrtut         Old Perl threads tutorial
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlport.pod:">perlport            Perl portability guide
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perllocale.pod:">perllocale          Perl locale support
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perluniintro.pod:">perluniintro        Perl Unicode introduction
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlunicode.pod:">perlunicode         Perl Unicode support
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlebcdic.pod:">perlebcdic          Considerations for running Perl on EBCDIC platforms
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlsec.pod:">perlsec             Perl security
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlmod.pod:">perlmod             Perl modules: how they work
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlmodlib.pod:">perlmodlib          Perl modules: how to write and use
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlmodstyle.pod:">perlmodstyle        Perl modules: how to write modules with style
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlmodinstall.pod:">perlmodinstall      Perl modules: how to install from CPAN
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlnewmod.pod:">perlnewmod          Perl modules: preparing a new module for distribution
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlutil.pod:">perlutil            utilities packaged with the Perl distribution
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlcompile.pod:">perlcompile         Perl compiler suite intro
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfilter.pod:">perlfilter          Perl source filters

Internals and C Language Interface

    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlembed.pod:">perlembed           Perl ways to embed perl in your C or C++ application
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldebguts.pod:">perldebguts         Perl debugging guts and tips
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlxstut.pod:">perlxstut           Perl XS tutorial
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlxs.pod:">perlxs              Perl XS application programming interface
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlclib.pod:">perlclib            Internal replacements for standard C library functions
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlguts.pod:">perlguts            Perl internal functions for those doing extensions
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlcall.pod:">perlcall            Perl calling conventions from C
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlapi.pod:">perlapi             Perl API listing (autogenerated)
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlintern.pod:">perlintern          Perl internal functions (autogenerated)
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perliol.pod:">perliol             C API for Perl's implementation of IO in Layers
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlapio.pod:">perlapio            Perl internal IO abstraction interface
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlhack.pod:">perlhack            Perl hackers guide

Miscellaneous

    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlbook.pod:">perlbook            Perl book information
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perltodo.pod:">perltodo            Perl things to do
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlhist.pod:">perlhist            Perl history records
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldelta.pod:">perldelta           Perl changes since previous version
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perl572delta.pod:">perl572delta        Perl changes in version 5.7.2
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perl571delta.pod:">perl571delta        Perl changes in version 5.7.1
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perl570delta.pod:">perl570delta        Perl changes in version 5.7.0
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perl561delta.pod:">perl561delta        Perl changes in version 5.6.1
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perl56delta.pod:">perl56delta         Perl changes in version 5.6
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perl5005delta.pod:">perl5005delta       Perl changes in version 5.005
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perl5004delta.pod:">perl5004delta       Perl changes in version 5.004

Language-Specific

    perlcn              Perl for Simplified Chinese (in EUC-CN)
    perljp              Perl for Japanese (in EUC-JP)
    perlko              Perl for Korean (in EUC-KR)
    perltw              Perl for Traditional Chinese (in Big5)

Platform-Specific

    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlaix.pod:">perlaix             Perl notes for AIX
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlamiga.pod:">perlamiga           Perl notes for AmigaOS
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlapollo.pod:">perlapollo          Perl notes for Apollo DomainOS
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlbeos.pod:">perlbeos            Perl notes for BeOS
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlbs2000.pod:">perlbs2000          Perl notes for POSIX-BC BS2000
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlce.pod:">perlce              Perl notes for WinCE
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlcygwin.pod:">perlcygwin          Perl notes for Cygwin
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldgux.pod:">perldgux            Perl notes for DG/UX
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perldos.pod:">perldos             Perl notes for DOS
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlepoc.pod:">perlepoc            Perl notes for EPOC
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlfreebsd.pod:">perlfreebsd         Perl notes for FreeBSD
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlhpux.pod:">perlhpux            Perl notes for HP-UX
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlhurd.pod:">perlhurd            Perl notes for Hurd
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlirix.pod:">perlirix            Perl notes for Irix
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlmachten.pod:">perlmachten         Perl notes for Power MachTen
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlmacos.pod:">perlmacos           Perl notes for Mac OS (Classic)
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlmint.pod:">perlmint            Perl notes for MiNT
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlmpeix.pod:">perlmpeix           Perl notes for MPE/iX
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlnetware.pod:">perlnetware         Perl notes for NetWare
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlos2.pod:">perlos2             Perl notes for OS/2
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlos390.pod:">perlos390           Perl notes for OS/390
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlplan9.pod:">perlplan9           Perl notes for Plan 9
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlqnx.pod:">perlqnx             Perl notes for QNX
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlsolaris.pod:">perlsolaris         Perl notes for Solaris
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perltru64.pod:">perltru64           Perl notes for Tru64
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perluts.pod:">perluts             Perl notes for UTS
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlvmesa.pod:">perlvmesa           Perl notes for VM/ESA
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlvms.pod:">perlvms             Perl notes for VMS
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlvos.pod:">perlvos             Perl notes for Stratus VOS
    /dar/arlib32/out/html/man/perl/html/lib/Pod/perlwin32.pod:">perlwin32           Perl notes for Windows

By default, the manpages listed above are installed in the /usr/local/man/ directory.

Extensive additional documentation for Perl modules is available. The default configuration for perl will place this additional documentation in the /usr/local/lib/perl5/man directory (or else in the man subdirectory of the Perl library directory). Some of this additional documentation is distributed standard with Perl, but you'll also find documentation for third-party modules there.

You should be able to view Perl's documentation with your man(1) program by including the proper directories in the appropriate start-up files, or in the MANPATH environment variable. To find out where the configuration has installed the manpages, type:

    perl -V:man.dir

If the directories have a common stem, such as /usr/local/man/man1 and /usr/local/man/man3, you need only to add that stem (/usr/local/man) to your man(1) configuration files or your MANPATH environment variable. If they do not share a stem, you'll have to add both stems.

If that doesn't work for some reason, you can still use the supplied perldoc script to view module information. You might also look into getting a replacement man program.

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.

__top


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.

But wait, there's more...

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

Okay, that's definitely enough hype.

__top


AVAILABILITY

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

__top


ENVIRONMENT

See the perlrun manpage.

__top


AUTHOR

Larry Wall <larry@wall.org>, 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.org .

__top


FILES

 "@INC"                 locations of perl libraries

__top


SEE ALSO

 a2p    awk to perl translator
 s2p    sed to perl translator
 http://www.perl.com/       the Perl Home Page
 http://www.cpan.org/       the Comprehensive Perl Archive
 http://www.perl.org/       Perl Mongers (Perl user groups)

__top


DIAGNOSTICS

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

See the perldiag manpage 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 the perlsec manpage.

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

__top


BUGS

The -w switch 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 perlbug@perl.org . 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.

__top


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.

__top

 perl - Practical Extraction and Report Language