Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man1 / perl.1
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "PERL 1"
132.TH PERL 1 "2002-06-08" "perl v5.8.0" "Perl Programmers Reference Guide"
133.SH "NAME"
134perl \- Practical Extraction and Report Language
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137\&\fBperl\fR [\ \fB\-sTuU\fR\ ] [\ \fB\-hv\fR\ ]\ [\ \fB\-V\fR[:\fIconfigvar\fR]\ ]
138 [\ \fB\-cw\fR\ ]\ [\ \fB\-d\fR[:\fIdebugger\fR]\ ]\ [\ \fB\-D\fR[\fInumber/list\fR]\ ]
139 [\ \fB\-pna\fR\ ]\ [\ \fB\-F\fR\fIpattern\fR\ ]\ [\ \fB\-l\fR[\fIoctal\fR]\ ]\ [\ \fB\-0\fR[\fIoctal\fR]\ ]
140 [\ \fB\-I\fR\fIdir\fR\ ]\ [\ \fB\-m\fR[\fB\-\fR]\fImodule\fR\ ]\ [\ \fB\-M\fR[\fB\-\fR]\fI'module...'\fR\ ]
141 [\ \fB\-P\fR\ ] [\ \fB\-S\fR\ ] [\ \fB\-x\fR[\fIdir\fR]\ ]
142 [\ \fB\-i\fR[\fIextension\fR]\ ] [\ \fB\-e\fR\ \fI'command'\fR\ ]\ [\ \fB\-\-\fR\ ]\ [\ \fIprogramfile\fR\ ]\ [\ \fIargument\fR\ ]...
143.PP
144If you're new to Perl, you should start with perlintro, which is a
145general intro for beginners and provides some background to help you
146navigate the rest of Perl's extensive documentation.
147.PP
148For ease of access, the Perl manual has been split up into several sections.
149.Sh "Overview"
150.IX Subsection "Overview"
151.Vb 3
152\& perl Perl overview (this section)
153\& perlintro Perl introduction for beginners
154\& perltoc Perl documentation table of contents
155.Ve
156.Sh "Tutorials"
157.IX Subsection "Tutorials"
158.Vb 3
159\& perlreftut Perl references short introduction
160\& perldsc Perl data structures intro
161\& perllol Perl data structures: arrays of arrays
162.Ve
163.PP
164.Vb 2
165\& perlrequick Perl regular expressions quick start
166\& perlretut Perl regular expressions tutorial
167.Ve
168.PP
169.Vb 4
170\& perlboot Perl OO tutorial for beginners
171\& perltoot Perl OO tutorial, part 1
172\& perltooc Perl OO tutorial, part 2
173\& perlbot Perl OO tricks and examples
174.Ve
175.PP
176.Vb 1
177\& perlstyle Perl style guide
178.Ve
179.PP
180.Vb 2
181\& perltrap Perl traps for the unwary
182\& perldebtut Perl debugging tutorial
183.Ve
184.PP
185.Vb 10
186\& perlfaq Perl frequently asked questions
187\& perlfaq1 General Questions About Perl
188\& perlfaq2 Obtaining and Learning about Perl
189\& perlfaq3 Programming Tools
190\& perlfaq4 Data Manipulation
191\& perlfaq5 Files and Formats
192\& perlfaq6 Regexes
193\& perlfaq7 Perl Language Issues
194\& perlfaq8 System Interaction
195\& perlfaq9 Networking
196.Ve
197.Sh "Reference Manual"
198.IX Subsection "Reference Manual"
199.Vb 20
200\& perlsyn Perl syntax
201\& perldata Perl data structures
202\& perlop Perl operators and precedence
203\& perlsub Perl subroutines
204\& perlfunc Perl built-in functions
205\& perlopentut Perl open() tutorial
206\& perlpacktut Perl pack() and unpack() tutorial
207\& perlpod Perl plain old documentation
208\& perlpodspec Perl plain old documentation format specification
209\& perlrun Perl execution and options
210\& perldiag Perl diagnostic messages
211\& perllexwarn Perl warnings and their control
212\& perldebug Perl debugging
213\& perlvar Perl predefined variables
214\& perlre Perl regular expressions, the rest of the story
215\& perlref Perl references, the rest of the story
216\& perlform Perl formats
217\& perlobj Perl objects
218\& perltie Perl objects hidden behind simple variables
219\& perldbmfilter Perl DBM filters
220.Ve
221.PP
222.Vb 3
223\& perlipc Perl interprocess communication
224\& perlfork Perl fork() information
225\& perlnumber Perl number semantics
226.Ve
227.PP
228.Vb 2
229\& perlthrtut Perl threads tutorial
230\& perlothrtut Old Perl threads tutorial
231.Ve
232.PP
233.Vb 5
234\& perlport Perl portability guide
235\& perllocale Perl locale support
236\& perluniintro Perl Unicode introduction
237\& perlunicode Perl Unicode support
238\& perlebcdic Considerations for running Perl on EBCDIC platforms
239.Ve
240.PP
241.Vb 1
242\& perlsec Perl security
243.Ve
244.PP
245.Vb 5
246\& perlmod Perl modules: how they work
247\& perlmodlib Perl modules: how to write and use
248\& perlmodstyle Perl modules: how to write modules with style
249\& perlmodinstall Perl modules: how to install from CPAN
250\& perlnewmod Perl modules: preparing a new module for distribution
251.Ve
252.PP
253.Vb 1
254\& perlutil utilities packaged with the Perl distribution
255.Ve
256.PP
257.Vb 1
258\& perlcompile Perl compiler suite intro
259.Ve
260.PP
261.Vb 1
262\& perlfilter Perl source filters
263.Ve
264.Sh "Internals and C Language Interface"
265.IX Subsection "Internals and C Language Interface"
266.Vb 7
267\& perlembed Perl ways to embed perl in your C or C++ application
268\& perldebguts Perl debugging guts and tips
269\& perlxstut Perl XS tutorial
270\& perlxs Perl XS application programming interface
271\& perlclib Internal replacements for standard C library functions
272\& perlguts Perl internal functions for those doing extensions
273\& perlcall Perl calling conventions from C
274.Ve
275.PP
276.Vb 4
277\& perlapi Perl API listing (autogenerated)
278\& perlintern Perl internal functions (autogenerated)
279\& perliol C API for Perl's implementation of IO in Layers
280\& perlapio Perl internal IO abstraction interface
281.Ve
282.PP
283.Vb 1
284\& perlhack Perl hackers guide
285.Ve
286.Sh "Miscellaneous"
287.IX Subsection "Miscellaneous"
288.Vb 2
289\& perlbook Perl book information
290\& perltodo Perl things to do
291.Ve
292.PP
293.Vb 9
294\& perlhist Perl history records
295\& perldelta Perl changes since previous version
296\& perl572delta Perl changes in version 5.7.2
297\& perl571delta Perl changes in version 5.7.1
298\& perl570delta Perl changes in version 5.7.0
299\& perl561delta Perl changes in version 5.6.1
300\& perl56delta Perl changes in version 5.6
301\& perl5005delta Perl changes in version 5.005
302\& perl5004delta Perl changes in version 5.004
303.Ve
304.Sh "Language-Specific"
305.IX Subsection "Language-Specific"
306.Vb 4
307\& perlcn Perl for Simplified Chinese (in EUC-CN)
308\& perljp Perl for Japanese (in EUC-JP)
309\& perlko Perl for Korean (in EUC-KR)
310\& perltw Perl for Traditional Chinese (in Big5)
311.Ve
312.Sh "Platform-Specific"
313.IX Subsection "Platform-Specific"
314.Vb 30
315\& perlaix Perl notes for AIX
316\& perlamiga Perl notes for AmigaOS
317\& perlapollo Perl notes for Apollo DomainOS
318\& perlbeos Perl notes for BeOS
319\& perlbs2000 Perl notes for POSIX-BC BS2000
320\& perlce Perl notes for WinCE
321\& perlcygwin Perl notes for Cygwin
322\& perldgux Perl notes for DG/UX
323\& perldos Perl notes for DOS
324\& perlepoc Perl notes for EPOC
325\& perlfreebsd Perl notes for FreeBSD
326\& perlhpux Perl notes for HP-UX
327\& perlhurd Perl notes for Hurd
328\& perlirix Perl notes for Irix
329\& perlmachten Perl notes for Power MachTen
330\& perlmacos Perl notes for Mac OS (Classic)
331\& perlmint Perl notes for MiNT
332\& perlmpeix Perl notes for MPE/iX
333\& perlnetware Perl notes for NetWare
334\& perlos2 Perl notes for OS/2
335\& perlos390 Perl notes for OS/390
336\& perlplan9 Perl notes for Plan 9
337\& perlqnx Perl notes for QNX
338\& perlsolaris Perl notes for Solaris
339\& perltru64 Perl notes for Tru64
340\& perluts Perl notes for UTS
341\& perlvmesa Perl notes for VM/ESA
342\& perlvms Perl notes for VMS
343\& perlvos Perl notes for Stratus VOS
344\& perlwin32 Perl notes for Windows
345.Ve
346.PP
347By default, the manpages listed above are installed in the
348\&\fI/usr/local/man/\fR directory.
349.PP
350Extensive additional documentation for Perl modules is available. The
351default configuration for perl will place this additional documentation
352in the \fI/usr/local/lib/perl5/man\fR directory (or else in the \fIman\fR
353subdirectory of the Perl library directory). Some of this additional
354documentation is distributed standard with Perl, but you'll also find
355documentation for third-party modules there.
356.PP
357You should be able to view Perl's documentation with your \fIman\fR\|(1)
358program by including the proper directories in the appropriate start-up
359files, or in the \s-1MANPATH\s0 environment variable. To find out where the
360configuration has installed the manpages, type:
361.PP
362.Vb 1
363\& perl -V:man.dir
364.Ve
365.PP
366If the directories have a common stem, such as \fI/usr/local/man/man1\fR
367and \fI/usr/local/man/man3\fR, you need only to add that stem
368(\fI/usr/local/man\fR) to your \fIman\fR\|(1) configuration files or your \s-1MANPATH\s0
369environment variable. If they do not share a stem, you'll have to add
370both stems.
371.PP
372If that doesn't work for some reason, you can still use the
373supplied \fIperldoc\fR script to view module information. You might
374also look into getting a replacement man program.
375.PP
376If something strange has gone wrong with your program and you're not
377sure where you should look for help, try the \fB\-w\fR switch first. It
378will often point out exactly where the trouble is.
379.SH "DESCRIPTION"
380.IX Header "DESCRIPTION"
381Perl is a language optimized for scanning arbitrary
382text files, extracting information from those text files, and printing
383reports based on that information. It's also a good language for many
384system management tasks. The language is intended to be practical
385(easy to use, efficient, complete) rather than beautiful (tiny,
386elegant, minimal).
387.PP
388Perl combines (in the author's opinion, anyway) some of the best
389features of C, \fBsed\fR, \fBawk\fR, and \fBsh\fR, so people familiar with
390those languages should have little difficulty with it. (Language
391historians will also note some vestiges of \fBcsh\fR, Pascal, and even
392\&\s-1BASIC\-PLUS\s0.) Expression syntax corresponds closely to C
393expression syntax. Unlike most Unix utilities, Perl does not
394arbitrarily limit the size of your data\*(--if you've got the memory,
395Perl can slurp in your whole file as a single string. Recursion is of
396unlimited depth. And the tables used by hashes (sometimes called
397\&\*(L"associative arrays\*(R") grow as necessary to prevent degraded
398performance. Perl can use sophisticated pattern matching techniques to
399scan large amounts of data quickly. Although optimized for
400scanning text, Perl can also deal with binary data, and can make dbm
401files look like hashes. Setuid Perl scripts are safer than C programs
402through a dataflow tracing mechanism that prevents many stupid
403security holes.
404.PP
405If you have a problem that would ordinarily use \fBsed\fR or \fBawk\fR or
406\&\fBsh\fR, but it exceeds their capabilities or must run a little faster,
407and you don't want to write the silly thing in C, then Perl may be for
408you. There are also translators to turn your \fBsed\fR and \fBawk\fR
409scripts into Perl scripts.
410.PP
411But wait, there's more...
412.PP
413Begun in 1993 (see perlhist), Perl version 5 is nearly a complete
414rewrite that provides the following additional benefits:
415.IP "\(bu" 4
416modularity and reusability using innumerable modules
417.Sp
418Described in perlmod, perlmodlib, and perlmodinstall.
419.IP "\(bu" 4
420embeddable and extensible
421.Sp
422Described in perlembed, perlxstut, perlxs, perlcall,
423perlguts, and xsubpp.
424.IP "\(bu" 4
425roll-your-own magic variables (including multiple simultaneous \s-1DBM\s0 implementations)
426.Sp
427Described in perltie and AnyDBM_File.
428.IP "\(bu" 4
429subroutines can now be overridden, autoloaded, and prototyped
430.Sp
431Described in perlsub.
432.IP "\(bu" 4
433arbitrarily nested data structures and anonymous functions
434.Sp
435Described in perlreftut, perlref, perldsc, and perllol.
436.IP "\(bu" 4
437object-oriented programming
438.Sp
439Described in perlobj, perlboot, perltoot, perltooc,
440and perlbot.
441.IP "\(bu" 4
442compilability into C code or Perl bytecode
443.Sp
444Described in B and B::Bytecode.
445.IP "\(bu" 4
446support for light-weight processes (threads)
447.Sp
448Described in perlthrtut and Thread.
449.IP "\(bu" 4
450support for internationalization, localization, and Unicode
451.Sp
452Described in perllocale and utf8.
453.IP "\(bu" 4
454lexical scoping
455.Sp
456Described in perlsub.
457.IP "\(bu" 4
458regular expression enhancements
459.Sp
460Described in perlre, with additional examples in perlop.
461.IP "\(bu" 4
462enhanced debugger and interactive Perl environment,
463with integrated editor support
464.Sp
465Described in perldebtut, perldebug and perldebguts.
466.IP "\(bu" 4
467\&\s-1POSIX\s0 1003.1 compliant library
468.Sp
469Described in \s-1POSIX\s0.
470.PP
471Okay, that's \fIdefinitely\fR enough hype.
472.SH "AVAILABILITY"
473.IX Header "AVAILABILITY"
474Perl is available for most operating systems, including virtually
475all Unix-like platforms. See \*(L"Supported Platforms\*(R" in perlport
476for a listing.
477.SH "ENVIRONMENT"
478.IX Header "ENVIRONMENT"
479See perlrun.
480.SH "AUTHOR"
481.IX Header "AUTHOR"
482Larry Wall <larry@wall.org>, with the help of oodles of other folks.
483.PP
484If your Perl success stories and testimonials may be of help to others
485who wish to advocate the use of Perl in their applications,
486or if you wish to simply express your gratitude to Larry and the
487Perl developers, please write to perl\-thanks@perl.org .
488.SH "FILES"
489.IX Header "FILES"
490.Vb 1
491\& "@INC" locations of perl libraries
492.Ve
493.SH "SEE ALSO"
494.IX Header "SEE ALSO"
495.Vb 2
496\& a2p awk to perl translator
497\& s2p sed to perl translator
498.Ve
499.PP
500.Vb 3
501\& http://www.perl.com/ the Perl Home Page
502\& http://www.cpan.org/ the Comprehensive Perl Archive
503\& http://www.perl.org/ Perl Mongers (Perl user groups)
504.Ve
505.SH "DIAGNOSTICS"
506.IX Header "DIAGNOSTICS"
507The \f(CW\*(C`use warnings\*(C'\fR pragma (and the \fB\-w\fR switch) produces some
508lovely diagnostics.
509.PP
510See perldiag for explanations of all Perl's diagnostics. The \f(CW\*(C`use
511diagnostics\*(C'\fR pragma automatically turns Perl's normally terse warnings
512and errors into these longer forms.
513.PP
514Compilation errors will tell you the line number of the error, with an
515indication of the next token or token type that was to be examined.
516(In a script passed to Perl via \fB\-e\fR switches, each
517\&\fB\-e\fR is counted as one line.)
518.PP
519Setuid scripts have additional constraints that can produce error
520messages such as \*(L"Insecure dependency\*(R". See perlsec.
521.PP
522Did we mention that you should definitely consider using the \fB\-w\fR
523switch?
524.SH "BUGS"
525.IX Header "BUGS"
526The \fB\-w\fR switch is not mandatory.
527.PP
528Perl is at the mercy of your machine's definitions of various
529operations such as type casting, \fIatof()\fR, and floating-point
530output with \fIsprintf()\fR.
531.PP
532If your stdio requires a seek or eof between reads and writes on a
533particular stream, so does Perl. (This doesn't apply to \fIsysread()\fR
534and \fIsyswrite()\fR.)
535.PP
536While none of the built-in data types have any arbitrary size limits
537(apart from memory size), there are still a few arbitrary limits: a
538given variable name may not be longer than 251 characters. Line numbers
539displayed by diagnostics are internally stored as short integers,
540so they are limited to a maximum of 65535 (higher numbers usually being
541affected by wraparound).
542.PP
543You may mail your bug reports (be sure to include full configuration
544information as output by the myconfig program in the perl source
545tree, or by \f(CW\*(C`perl \-V\*(C'\fR) to perlbug@perl.org . If you've succeeded
546in compiling perl, the \fBperlbug\fR script in the \fIutils/\fR subdirectory
547can be used to help mail in a bug report.
548.PP
549Perl actually stands for Pathologically Eclectic Rubbish Lister, but
550don't tell anyone I said that.
551.SH "NOTES"
552.IX Header "NOTES"
553The Perl motto is \*(L"There's more than one way to do it.\*(R" Divining
554how many more is left as an exercise to the reader.
555.PP
556The three principal virtues of a programmer are Laziness,
557Impatience, and Hubris. See the Camel Book for why.