3 perl - Practical Extraction and Report Language
7 B<perl> S<[ B<-sTuU> ]> S<[ B<-hv> ] [ B<-V>[:I<configvar>] ]>
8 S<[ B<-cw> ] [ B<-d>[:I<debugger>] ] [ B<-D>[I<number/list>] ]>
9 S<[ B<-pna> ] [ B<-F>I<pattern> ] [ B<-l>[I<octal>] ] [ B<-0>[I<octal>] ]>
10 S<[ B<-I>I<dir> ] [ B<-m>[B<->]I<module> ] [ B<-M>[B<->]I<'module...'> ]>
11 S<[ B<-P> ]> S<[ B<-S> ]> S<[ B<-x>[I<dir>] ]>
12 S<[ B<-i>[I<extension>] ]> S<[ B<-e> I<'command'> ]
13 [ B<--> ] [ I<programfile> ] [ I<argument> ]...>
15 If you're new to Perl, you should start with L<perlintro>, which is a
16 general intro for beginners and provides some background to help you
17 navigate the rest of Perl's extensive documentation.
19 For ease of access, the Perl manual has been split up into several sections.
23 perl Perl overview (this section)
24 perlintro Perl introduction for beginners
25 perltoc Perl documentation table of contents
29 perlreftut Perl references short introduction
30 perldsc Perl data structures intro
31 perllol Perl data structures: arrays of arrays
33 perlrequick Perl regular expressions quick start
34 perlretut Perl regular expressions tutorial
36 perlboot Perl OO tutorial for beginners
37 perltoot Perl OO tutorial, part 1
38 perltooc Perl OO tutorial, part 2
39 perlbot Perl OO tricks and examples
41 perlstyle Perl style guide
43 perltrap Perl traps for the unwary
44 perldebtut Perl debugging tutorial
46 perlfaq Perl frequently asked questions
47 perlfaq1 General Questions About Perl
48 perlfaq2 Obtaining and Learning about Perl
49 perlfaq3 Programming Tools
50 perlfaq4 Data Manipulation
51 perlfaq5 Files and Formats
53 perlfaq7 Perl Language Issues
54 perlfaq8 System Interaction
57 =head2 Reference Manual
60 perldata Perl data structures
61 perlop Perl operators and precedence
62 perlsub Perl subroutines
63 perlfunc Perl built-in functions
64 perlopentut Perl open() tutorial
65 perlpacktut Perl pack() and unpack() tutorial
66 perlpod Perl plain old documentation
67 perlpodspec Perl plain old documentation format specification
68 perlrun Perl execution and options
69 perldiag Perl diagnostic messages
70 perllexwarn Perl warnings and their control
71 perldebug Perl debugging
72 perlvar Perl predefined variables
73 perlre Perl regular expressions, the rest of the story
74 perlreref Perl regular expressions quick reference
75 perlref Perl references, the rest of the story
78 perltie Perl objects hidden behind simple variables
79 perldbmfilter Perl DBM filters
81 perlipc Perl interprocess communication
82 perlfork Perl fork() information
83 perlnumber Perl number semantics
85 perlthrtut Perl threads tutorial
86 perlothrtut Old Perl threads tutorial
88 perlport Perl portability guide
89 perllocale Perl locale support
90 perluniintro Perl Unicode introduction
91 perlunicode Perl Unicode support
92 perlebcdic Considerations for running Perl on EBCDIC platforms
96 perlmod Perl modules: how they work
97 perlmodlib Perl modules: how to write and use
98 perlmodstyle Perl modules: how to write modules with style
99 perlmodinstall Perl modules: how to install from CPAN
100 perlnewmod Perl modules: preparing a new module for distribution
102 perlutil utilities packaged with the Perl distribution
104 perlcompile Perl compiler suite intro
106 perlfilter Perl source filters
108 =head2 Internals and C Language Interface
110 perlembed Perl ways to embed perl in your C or C++ application
111 perldebguts Perl debugging guts and tips
112 perlxstut Perl XS tutorial
113 perlxs Perl XS application programming interface
114 perlclib Internal replacements for standard C library functions
115 perlguts Perl internal functions for those doing extensions
116 perlcall Perl calling conventions from C
118 perlapi Perl API listing (autogenerated)
119 perlintern Perl internal functions (autogenerated)
120 perliol C API for Perl's implementation of IO in Layers
121 perlapio Perl internal IO abstraction interface
123 perlhack Perl hackers guide
127 perlbook Perl book information
128 perltodo Perl things to do
130 perldoc Look up Perl documentation in Pod format
132 perlhist Perl history records
133 perldelta Perl changes since previous version
134 perl58delta Perl changes in version 5.8.0
135 perl573delta Perl changes in version 5.7.3
136 perl572delta Perl changes in version 5.7.2
137 perl571delta Perl changes in version 5.7.1
138 perl570delta Perl changes in version 5.7.0
139 perl561delta Perl changes in version 5.6.1
140 perl56delta Perl changes in version 5.6
141 perl5005delta Perl changes in version 5.005
142 perl5004delta Perl changes in version 5.004
144 perlartistic Perl Artistic License
145 perlgpl GNU General Public License
147 =head2 Language-Specific
149 perlcn Perl for Simplified Chinese (in EUC-CN)
150 perljp Perl for Japanese (in EUC-JP)
151 perlko Perl for Korean (in EUC-KR)
152 perltw Perl for Traditional Chinese (in Big5)
154 =head2 Platform-Specific
156 perlaix Perl notes for AIX
157 perlamiga Perl notes for AmigaOS
158 perlapollo Perl notes for Apollo DomainOS
159 perlbeos Perl notes for BeOS
160 perlbs2000 Perl notes for POSIX-BC BS2000
161 perlce Perl notes for WinCE
162 perlcygwin Perl notes for Cygwin
163 perldgux Perl notes for DG/UX
164 perldos Perl notes for DOS
165 perlepoc Perl notes for EPOC
166 perlfreebsd Perl notes for FreeBSD
167 perlhpux Perl notes for HP-UX
168 perlhurd Perl notes for Hurd
169 perlirix Perl notes for Irix
170 perlmachten Perl notes for Power MachTen
171 perlmacos Perl notes for Mac OS (Classic)
172 perlmacosx Perl notes for Mac OS X
173 perlmint Perl notes for MiNT
174 perlmpeix Perl notes for MPE/iX
175 perlnetware Perl notes for NetWare
176 perlos2 Perl notes for OS/2
177 perlos390 Perl notes for OS/390
178 perlos400 Perl notes for OS/400
179 perlplan9 Perl notes for Plan 9
180 perlqnx Perl notes for QNX
181 perlsolaris Perl notes for Solaris
182 perltru64 Perl notes for Tru64
183 perluts Perl notes for UTS
184 perlvmesa Perl notes for VM/ESA
185 perlvms Perl notes for VMS
186 perlvos Perl notes for Stratus VOS
187 perlwin32 Perl notes for Windows
190 By default, the manpages listed above are installed in the
191 F</usr/local/man/> directory.
193 Extensive additional documentation for Perl modules is available. The
194 default configuration for perl will place this additional documentation
195 in the F</usr/local/lib/perl5/man> directory (or else in the F<man>
196 subdirectory of the Perl library directory). Some of this additional
197 documentation is distributed standard with Perl, but you'll also find
198 documentation for third-party modules there.
200 You should be able to view Perl's documentation with your man(1)
201 program by including the proper directories in the appropriate start-up
202 files, or in the MANPATH environment variable. To find out where the
203 configuration has installed the manpages, type:
207 If the directories have a common stem, such as F</usr/local/man/man1>
208 and F</usr/local/man/man3>, you need only to add that stem
209 (F</usr/local/man>) to your man(1) configuration files or your MANPATH
210 environment variable. If they do not share a stem, you'll have to add
213 If that doesn't work for some reason, you can still use the
214 supplied F<perldoc> script to view module information. You might
215 also look into getting a replacement man program.
217 If something strange has gone wrong with your program and you're not
218 sure where you should look for help, try the B<-w> switch first. It
219 will often point out exactly where the trouble is.
223 Perl is a language optimized for scanning arbitrary
224 text files, extracting information from those text files, and printing
225 reports based on that information. It's also a good language for many
226 system management tasks. The language is intended to be practical
227 (easy to use, efficient, complete) rather than beautiful (tiny,
230 Perl combines (in the author's opinion, anyway) some of the best
231 features of C, B<sed>, B<awk>, and B<sh>, so people familiar with
232 those languages should have little difficulty with it. (Language
233 historians will also note some vestiges of B<csh>, Pascal, and even
234 BASIC-PLUS.) Expression syntax corresponds closely to C
235 expression syntax. Unlike most Unix utilities, Perl does not
236 arbitrarily limit the size of your data--if you've got the memory,
237 Perl can slurp in your whole file as a single string. Recursion is of
238 unlimited depth. And the tables used by hashes (sometimes called
239 "associative arrays") grow as necessary to prevent degraded
240 performance. Perl can use sophisticated pattern matching techniques to
241 scan large amounts of data quickly. Although optimized for
242 scanning text, Perl can also deal with binary data, and can make dbm
243 files look like hashes. Setuid Perl scripts are safer than C programs
244 through a dataflow tracing mechanism that prevents many stupid
247 If you have a problem that would ordinarily use B<sed> or B<awk> or
248 B<sh>, but it exceeds their capabilities or must run a little faster,
249 and you don't want to write the silly thing in C, then Perl may be for
250 you. There are also translators to turn your B<sed> and B<awk>
251 scripts into Perl scripts.
253 But wait, there's more...
255 Begun in 1993 (see L<perlhist>), Perl version 5 is nearly a complete
256 rewrite that provides the following additional benefits:
262 modularity and reusability using innumerable modules
264 Described in L<perlmod>, L<perlmodlib>, and L<perlmodinstall>.
268 embeddable and extensible
270 Described in L<perlembed>, L<perlxstut>, L<perlxs>, L<perlcall>,
271 L<perlguts>, and L<xsubpp>.
275 roll-your-own magic variables (including multiple simultaneous DBM
278 Described in L<perltie> and L<AnyDBM_File>.
282 subroutines can now be overridden, autoloaded, and prototyped
284 Described in L<perlsub>.
288 arbitrarily nested data structures and anonymous functions
290 Described in L<perlreftut>, L<perlref>, L<perldsc>, and L<perllol>.
294 object-oriented programming
296 Described in L<perlobj>, L<perlboot>, L<perltoot>, L<perltooc>,
301 support for light-weight processes (threads)
303 Described in L<perlthrtut> and L<threads>.
307 support for Unicode, internationalization, and localization
309 Described in L<perluniintro>, L<perllocale> and L<Locale::Maketext>.
315 Described in L<perlsub>.
319 regular expression enhancements
321 Described in L<perlre>, with additional examples in L<perlop>.
325 enhanced debugger and interactive Perl environment,
326 with integrated editor support
328 Described in L<perldebtut>, L<perldebug> and L<perldebguts>.
332 POSIX 1003.1 compliant library
334 Described in L<POSIX>.
338 Okay, that's I<definitely> enough hype.
342 Perl is available for most operating systems, including virtually
343 all Unix-like platforms. See L<perlport/"Supported Platforms">
352 Larry Wall <larry@wall.org>, with the help of oodles of other folks.
354 If your Perl success stories and testimonials may be of help to others
355 who wish to advocate the use of Perl in their applications,
356 or if you wish to simply express your gratitude to Larry and the
357 Perl developers, please write to perl-thanks@perl.org .
361 "@INC" locations of perl libraries
365 a2p awk to perl translator
366 s2p sed to perl translator
368 http://www.perl.com/ the Perl Home Page
369 http://www.cpan.org/ the Comprehensive Perl Archive
370 http://www.perl.org/ Perl Mongers (Perl user groups)
374 The C<use warnings> pragma (and the B<-w> switch) produces some
377 See L<perldiag> for explanations of all Perl's diagnostics. The C<use
378 diagnostics> pragma automatically turns Perl's normally terse warnings
379 and errors into these longer forms.
381 Compilation errors will tell you the line number of the error, with an
382 indication of the next token or token type that was to be examined.
383 (In a script passed to Perl via B<-e> switches, each
384 B<-e> is counted as one line.)
386 Setuid scripts have additional constraints that can produce error
387 messages such as "Insecure dependency". See L<perlsec>.
389 Did we mention that you should definitely consider using the B<-w>
394 The B<-w> switch is not mandatory.
396 Perl is at the mercy of your machine's definitions of various
397 operations such as type casting, atof(), and floating-point
398 output with sprintf().
400 If your stdio requires a seek or eof between reads and writes on a
401 particular stream, so does Perl. (This doesn't apply to sysread()
404 While none of the built-in data types have any arbitrary size limits
405 (apart from memory size), there are still a few arbitrary limits: a
406 given variable name may not be longer than 251 characters. Line numbers
407 displayed by diagnostics are internally stored as short integers,
408 so they are limited to a maximum of 65535 (higher numbers usually being
409 affected by wraparound).
411 You may mail your bug reports (be sure to include full configuration
412 information as output by the myconfig program in the perl source
413 tree, or by C<perl -V>) to perlbug@perl.org . If you've succeeded
414 in compiling perl, the B<perlbug> script in the F<utils/> subdirectory
415 can be used to help mail in a bug report.
417 Perl actually stands for Pathologically Eclectic Rubbish Lister, but
418 don't tell anyone I said that.
422 The Perl motto is "There's more than one way to do it." Divining
423 how many more is left as an exercise to the reader.
425 The three principal virtues of a programmer are Laziness,
426 Impatience, and Hubris. See the Camel Book for why.