1PERL(1)                Perl Programmers Reference Guide                PERL(1)
2
3
4

NAME

6       perl - The Perl 5 language interpreter
7

SYNOPSIS

9       perl [ -sTtuUWX ]      [ -hv ] [ -V[:configvar] ]
10            [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
11            [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]
12            [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ]
13            [ -C [number/list] ]      [ -S ]      [ -x[dir] ]
14            [ -i[extension] ]
15            [ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]...
16

GETTING HELP

18       The perldoc program gives you access to all the documentation that
19       comes with Perl.  You can get more documentation, tutorials and
20       community support online at <http://www.perl.org/>.
21
22       If you're new to Perl, you should start by running "perldoc perlintro",
23       which is a general intro for beginners and provides some background to
24       help you navigate the rest of Perl's extensive documentation.  Run
25       "perldoc perldoc" to learn more things you can do with perldoc.
26
27       For ease of access, the Perl manual has been split up into several
28       sections.
29
30   Overview
31           perl                Perl overview (this section)
32           perlintro           Perl introduction for beginners
33           perltoc             Perl documentation table of contents
34
35   Tutorials
36           perlreftut          Perl references short introduction
37           perldsc             Perl data structures intro
38           perllol             Perl data structures: arrays of arrays
39
40           perlrequick         Perl regular expressions quick start
41           perlretut           Perl regular expressions tutorial
42
43           perlootut           Perl OO tutorial for beginners
44
45           perlperf            Perl Performance and Optimization Techniques
46
47           perlstyle           Perl style guide
48
49           perlcheat           Perl cheat sheet
50           perltrap            Perl traps for the unwary
51           perldebtut          Perl debugging tutorial
52
53           perlfaq             Perl frequently asked questions
54             perlfaq1          General Questions About Perl
55             perlfaq2          Obtaining and Learning about Perl
56             perlfaq3          Programming Tools
57             perlfaq4          Data Manipulation
58             perlfaq5          Files and Formats
59             perlfaq6          Regexes
60             perlfaq7          Perl Language Issues
61             perlfaq8          System Interaction
62             perlfaq9          Networking
63
64   Reference Manual
65           perlsyn             Perl syntax
66           perldata            Perl data structures
67           perlop              Perl operators and precedence
68           perlsub             Perl subroutines
69           perlfunc            Perl built-in functions
70             perlopentut       Perl open() tutorial
71             perlpacktut       Perl pack() and unpack() tutorial
72           perlpod             Perl plain old documentation
73           perlpodspec         Perl plain old documentation format specification
74           perlpodstyle        Perl POD style guide
75           perlrun             Perl execution and options
76           perldiag            Perl diagnostic messages
77           perllexwarn         Perl warnings and their control
78           perldebug           Perl debugging
79           perlvar             Perl predefined variables
80           perlre              Perl regular expressions, the rest of the story
81           perlrebackslash     Perl regular expression backslash sequences
82           perlrecharclass     Perl regular expression character classes
83           perlreref           Perl regular expressions quick reference
84           perlref             Perl references, the rest of the story
85           perlform            Perl formats
86           perlobj             Perl objects
87           perltie             Perl objects hidden behind simple variables
88             perldbmfilter     Perl DBM filters
89
90           perlipc             Perl interprocess communication
91           perlfork            Perl fork() information
92           perlnumber          Perl number semantics
93
94           perlthrtut          Perl threads tutorial
95
96           perlport            Perl portability guide
97           perllocale          Perl locale support
98           perluniintro        Perl Unicode introduction
99           perlunicode         Perl Unicode support
100           perlunifaq          Perl Unicode FAQ
101           perluniprops        Index of Unicode Version 6.0.0 properties in Perl
102           perlunitut          Perl Unicode tutorial
103           perlebcdic          Considerations for running Perl on EBCDIC platforms
104
105           perlsec             Perl security
106
107           perlmod             Perl modules: how they work
108           perlmodlib          Perl modules: how to write and use
109           perlmodstyle        Perl modules: how to write modules with style
110           perlmodinstall      Perl modules: how to install from CPAN
111           perlnewmod          Perl modules: preparing a new module for distribution
112           perlpragma          Perl modules: writing a user pragma
113
114           perlutil            utilities packaged with the Perl distribution
115
116           perlfilter          Perl source filters
117
118           perldtrace          Perl's support for DTrace
119
120           perlglossary        Perl Glossary
121
122   Internals and C Language Interface
123           perlembed           Perl ways to embed perl in your C or C++ application
124           perldebguts         Perl debugging guts and tips
125           perlxstut           Perl XS tutorial
126           perlxs              Perl XS application programming interface
127           perlxstypemap       Perl XS C/Perl type conversion tools
128           perlclib            Internal replacements for standard C library functions
129           perlguts            Perl internal functions for those doing extensions
130           perlcall            Perl calling conventions from C
131           perlmroapi          Perl method resolution plugin interface
132           perlreapi           Perl regular expression plugin interface
133           perlreguts          Perl regular expression engine internals
134
135           perlapi             Perl API listing (autogenerated)
136           perlintern          Perl internal functions (autogenerated)
137           perliol             C API for Perl's implementation of IO in Layers
138           perlapio            Perl internal IO abstraction interface
139
140           perlhack            Perl hackers guide
141           perlsource          Guide to the Perl source tree
142           perlinterp          Overview of the Perl interpreter source and how it works
143           perlhacktut         Walk through the creation of a simple C code patch
144           perlhacktips        Tips for Perl core C code hacking
145           perlpolicy          Perl development policies
146           perlgit             Using git with the Perl repository
147
148   Miscellaneous
149           perlbook            Perl book information
150           perlcommunity       Perl community information
151
152           perldoc             Look up Perl documentation in Pod format
153
154           perlhist            Perl history records
155           perldelta           Perl changes since previous version
156           perl5162delta       Perl changes in version 5.16.2
157           perl5161delta       Perl changes in version 5.16.1
158           perl5160delta       Perl changes in version 5.16.0
159           perl5160delta       Perl changes in version 5.16.0
160           perl5143delta       Perl changes in version 5.14.3
161           perl5142delta       Perl changes in version 5.14.2
162           perl5141delta       Perl changes in version 5.14.1
163           perl5140delta       Perl changes in version 5.14.0
164           perl5124delta       Perl changes in version 5.12.4
165           perl5123delta       Perl changes in version 5.12.3
166           perl5122delta       Perl changes in version 5.12.2
167           perl5121delta       Perl changes in version 5.12.1
168           perl5120delta       Perl changes in version 5.12.0
169           perl5101delta       Perl changes in version 5.10.1
170           perl5100delta       Perl changes in version 5.10.0
171           perl589delta        Perl changes in version 5.8.9
172           perl588delta        Perl changes in version 5.8.8
173           perl587delta        Perl changes in version 5.8.7
174           perl586delta        Perl changes in version 5.8.6
175           perl585delta        Perl changes in version 5.8.5
176           perl584delta        Perl changes in version 5.8.4
177           perl583delta        Perl changes in version 5.8.3
178           perl582delta        Perl changes in version 5.8.2
179           perl581delta        Perl changes in version 5.8.1
180           perl58delta         Perl changes in version 5.8.0
181           perl561delta        Perl changes in version 5.6.1
182           perl56delta         Perl changes in version 5.6
183           perl5005delta       Perl changes in version 5.005
184           perl5004delta       Perl changes in version 5.004
185
186           perlexperiment      A listing of experimental features in Perl
187
188           perlartistic        Perl Artistic License
189           perlgpl             GNU General Public License
190
191   Language-Specific
192           perlcn              Perl for Simplified Chinese (in EUC-CN)
193           perljp              Perl for Japanese (in EUC-JP)
194           perlko              Perl for Korean (in EUC-KR)
195           perltw              Perl for Traditional Chinese (in Big5)
196
197   Platform-Specific
198           perlaix             Perl notes for AIX
199           perlamiga           Perl notes for AmigaOS
200           perlbeos            Perl notes for BeOS
201           perlbs2000          Perl notes for POSIX-BC BS2000
202           perlce              Perl notes for WinCE
203           perlcygwin          Perl notes for Cygwin
204           perldgux            Perl notes for DG/UX
205           perldos             Perl notes for DOS
206           perlepoc            Perl notes for EPOC
207           perlfreebsd         Perl notes for FreeBSD
208           perlhaiku           Perl notes for Haiku
209           perlhpux            Perl notes for HP-UX
210           perlhurd            Perl notes for Hurd
211           perlirix            Perl notes for Irix
212           perllinux           Perl notes for Linux
213           perlmacos           Perl notes for Mac OS (Classic)
214           perlmacosx          Perl notes for Mac OS X
215           perlmpeix           Perl notes for MPE/iX
216           perlnetware         Perl notes for NetWare
217           perlopenbsd         Perl notes for OpenBSD
218           perlos2             Perl notes for OS/2
219           perlos390           Perl notes for OS/390
220           perlos400           Perl notes for OS/400
221           perlplan9           Perl notes for Plan 9
222           perlqnx             Perl notes for QNX
223           perlriscos          Perl notes for RISC OS
224           perlsolaris         Perl notes for Solaris
225           perlsymbian         Perl notes for Symbian
226           perltru64           Perl notes for Tru64
227           perluts             Perl notes for UTS
228           perlvmesa           Perl notes for VM/ESA
229           perlvms             Perl notes for VMS
230           perlvos             Perl notes for Stratus VOS
231           perlwin32           Perl notes for Windows
232
233   Stubs for Deleted Documents
234           perlboot
235           perlbot
236           perltodo
237           perltooc
238           perltoot
239
240       On a Unix-like system, these documentation files will usually also be
241       available as manpages for use with the man program.
242
243       In general, if something strange has gone wrong with your program and
244       you're not sure where you should look for help, try the -w switch
245       first.  It will often point out exactly where the trouble is.
246

DESCRIPTION

248       Perl officially stands for Practical Extraction and Report Language,
249       except when it doesn't.
250
251       Perl was originally a language optimized for scanning arbitrary text
252       files, extracting information from those text files, and printing
253       reports based on that information.  It quickly became a good language
254       for many system management tasks. Over the years, Perl has grown into a
255       general-purpose programming language. It's widely used for everything
256       from quick "one-liners" to full-scale application development.
257
258       The language is intended to be practical (easy to use, efficient,
259       complete) rather than beautiful (tiny, elegant, minimal).
260
261       Perl combines (in the author's opinion, anyway) some of the best
262       features of C, sed, awk, and sh, so people familiar with those
263       languages should have little difficulty with it.  (Language historians
264       will also note some vestiges of csh, Pascal, and even BASIC-PLUS.)
265       Expression syntax corresponds closely to C expression syntax.  Unlike
266       most Unix utilities, Perl does not arbitrarily limit the size of your
267       data--if you've got the memory, Perl can slurp in your whole file as a
268       single string.  Recursion is of unlimited depth.  And the tables used
269       by hashes (sometimes called "associative arrays") grow as necessary to
270       prevent degraded performance.  Perl can use sophisticated pattern
271       matching techniques to scan large amounts of data quickly.  Although
272       optimized for scanning text, Perl also has many excellent tools for
273       slicing and dicing binary data.
274
275       But wait, there's more...
276
277       Begun in 1993 (see perlhist), Perl version 5 is nearly a complete
278       rewrite that provides the following additional benefits:
279
280       ·   modularity and reusability using innumerable modules
281
282           Described in perlmod, perlmodlib, and perlmodinstall.
283
284       ·   embeddable and extensible
285
286           Described in perlembed, perlxstut, perlxs, perlxstypemap, perlcall,
287           perlguts, and xsubpp.
288
289       ·   roll-your-own magic variables (including multiple simultaneous DBM
290           implementations)
291
292           Described in perltie and AnyDBM_File.
293
294       ·   subroutines can now be overridden, autoloaded, and prototyped
295
296           Described in perlsub.
297
298       ·   arbitrarily nested data structures and anonymous functions
299
300           Described in perlreftut, perlref, perldsc, and perllol.
301
302       ·   object-oriented programming
303
304           Described in perlobj and perlootut.
305
306       ·   support for light-weight processes (threads)
307
308           Described in perlthrtut and threads.
309
310       ·   support for Unicode, internationalization, and localization
311
312           Described in perluniintro, perllocale and Locale::Maketext.
313
314       ·   lexical scoping
315
316           Described in perlsub.
317
318       ·   regular expression enhancements
319
320           Described in perlre, with additional examples in perlop.
321
322       ·   enhanced debugger and interactive Perl environment, with integrated
323           editor support
324
325           Described in perldebtut, perldebug and perldebguts.
326
327       ·   POSIX 1003.1 compliant library
328
329           Described in POSIX.
330
331       Okay, that's definitely enough hype.
332

AVAILABILITY

334       Perl is available for most operating systems, including virtually all
335       Unix-like platforms.  See "Supported Platforms" in perlport for a
336       listing.
337

ENVIRONMENT

339       See perlrun.
340

AUTHOR

342       Larry Wall <larry@wall.org>, with the help of oodles of other folks.
343
344       If your Perl success stories and testimonials may be of help to others
345       who wish to advocate the use of Perl in their applications, or if you
346       wish to simply express your gratitude to Larry and the Perl developers,
347       please write to perl-thanks@perl.org .
348

FILES

350        "@INC"                 locations of perl libraries
351

SEE ALSO

353        http://www.perl.org/       the Perl homepage
354        http://www.perl.com/       Perl articles (O'Reilly)
355        http://www.cpan.org/       the Comprehensive Perl Archive
356        http://www.pm.org/         the Perl Mongers
357

DIAGNOSTICS

359       The "use warnings" pragma (and the -w switch) produces some lovely
360       diagnostics.
361
362       See perldiag for explanations of all Perl's diagnostics.  The "use
363       diagnostics" pragma automatically turns Perl's normally terse warnings
364       and errors into these longer forms.
365
366       Compilation errors will tell you the line number of the error, with an
367       indication of the next token or token type that was to be examined.
368       (In a script passed to Perl via -e switches, each -e is counted as one
369       line.)
370
371       Setuid scripts have additional constraints that can produce error
372       messages such as "Insecure dependency".  See perlsec.
373
374       Did we mention that you should definitely consider using the -w switch?
375

BUGS

377       The -w switch is not mandatory.
378
379       Perl is at the mercy of your machine's definitions of various
380       operations such as type casting, atof(), and floating-point output with
381       sprintf().
382
383       If your stdio requires a seek or eof between reads and writes on a
384       particular stream, so does Perl.  (This doesn't apply to sysread() and
385       syswrite().)
386
387       While none of the built-in data types have any arbitrary size limits
388       (apart from memory size), there are still a few arbitrary limits:  a
389       given variable name may not be longer than 251 characters.  Line
390       numbers displayed by diagnostics are internally stored as short
391       integers, so they are limited to a maximum of 65535 (higher numbers
392       usually being affected by wraparound).
393
394       You may mail your bug reports (be sure to include full configuration
395       information as output by the myconfig program in the perl source tree,
396       or by "perl -V") to perlbug@perl.org .  If you've succeeded in
397       compiling perl, the perlbug script in the utils/ subdirectory can be
398       used to help mail in a bug report.
399
400       Perl actually stands for Pathologically Eclectic Rubbish Lister, but
401       don't tell anyone I said that.
402

NOTES

404       The Perl motto is "There's more than one way to do it."  Divining how
405       many more is left as an exercise to the reader.
406
407       The three principal virtues of a programmer are Laziness, Impatience,
408       and Hubris.  See the Camel Book for why.
409
410
411
412perl v5.16.3                      2013-03-04                           PERL(1)
Impressum