Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

368 lines
12 KiB

  1. =head1 NAME
  2. perl - Practical Extraction and Report Language
  3. =head1 SYNOPSIS
  4. B<perl> S<[ B<-sTuU> ]> S<[ B<-hv> ] [ B<-V>[:I<configvar>] ]>
  5. S<[ B<-cw> ] [ B<-d>[:I<debugger>] ] [ B<-D>[I<number/list>] ]>
  6. S<[ B<-pna> ] [ B<-F>I<pattern> ] [ B<-l>[I<octal>] ] [ B<-0>[I<octal>] ]>
  7. S<[ B<-I>I<dir> ] [ B<-m>[B<->]I<module> ] [ B<-M>[B<->]I<'module...'> ]>
  8. S<[ B<-P> ]> S<[ B<-S> ]> S<[ B<-x>[I<dir>] ]>
  9. S<[ B<-i>[I<extension>] ]> S<[ B<-e> I<'command'> ]
  10. [ B<--> ] [ I<programfile> ] [ I<argument> ]...>
  11. For ease of access, the Perl manual has been split up into several sections:
  12. perl Perl overview (this section)
  13. perlfaq Perl frequently asked questions
  14. perltoc Perl documentation table of contents
  15. perlbook Perl book information
  16. perlsyn Perl syntax
  17. perldata Perl data structures
  18. perlop Perl operators and precedence
  19. perlsub Perl subroutines
  20. perlfunc Perl builtin functions
  21. perlreftut Perl references short introduction
  22. perldsc Perl data structures intro
  23. perlrequick Perl regular expressions quick start
  24. perlpod Perl plain old documentation
  25. perlstyle Perl style guide
  26. perltrap Perl traps for the unwary
  27. perlrun Perl execution and options
  28. perldiag Perl diagnostic messages
  29. perllexwarn Perl warnings and their control
  30. perldebtut Perl debugging tutorial
  31. perldebug Perl debugging
  32. perlvar Perl predefined variables
  33. perllol Perl data structures: arrays of arrays
  34. perlopentut Perl open() tutorial
  35. perlretut Perl regular expressions tutorial
  36. perlre Perl regular expressions, the rest of the story
  37. perlref Perl references, the rest of the story
  38. perlform Perl formats
  39. perlboot Perl OO tutorial for beginners
  40. perltoot Perl OO tutorial, part 1
  41. perltootc Perl OO tutorial, part 2
  42. perlobj Perl objects
  43. perlbot Perl OO tricks and examples
  44. perltie Perl objects hidden behind simple variables
  45. perlipc Perl interprocess communication
  46. perlfork Perl fork() information
  47. perlnumber Perl number semantics
  48. perlthrtut Perl threads tutorial
  49. perlport Perl portability guide
  50. perllocale Perl locale support
  51. perlunicode Perl unicode support
  52. perlebcdic Considerations for running Perl on EBCDIC platforms
  53. perlsec Perl security
  54. perlmod Perl modules: how they work
  55. perlmodlib Perl modules: how to write and use
  56. perlmodinstall Perl modules: how to install from CPAN
  57. perlnewmod Perl modules: preparing a new module for distribution
  58. perlfaq1 General Questions About Perl
  59. perlfaq2 Obtaining and Learning about Perl
  60. perlfaq3 Programming Tools
  61. perlfaq4 Data Manipulation
  62. perlfaq5 Files and Formats
  63. perlfaq6 Regexes
  64. perlfaq7 Perl Language Issues
  65. perlfaq8 System Interaction
  66. perlfaq9 Networking
  67. perlcompile Perl compiler suite intro
  68. perlembed Perl ways to embed perl in your C or C++ application
  69. perldebguts Perl debugging guts and tips
  70. perlxstut Perl XS tutorial
  71. perlxs Perl XS application programming interface
  72. perlclib Internal replacements for standard C library functions
  73. perlguts Perl internal functions for those doing extensions
  74. perlcall Perl calling conventions from C
  75. perlutil utilities packaged with the Perl distribution
  76. perlfilter Perl source filters
  77. perldbmfilter Perl DBM filters
  78. perlapi Perl API listing (autogenerated)
  79. perlintern Perl internal functions (autogenerated)
  80. perlapio Perl internal IO abstraction interface
  81. perltodo Perl things to do
  82. perlhack Perl hackers guide
  83. perlhist Perl history records
  84. perldelta Perl changes since previous version
  85. perl5005delta Perl changes in version 5.005
  86. perl5004delta Perl changes in version 5.004
  87. perlaix Perl notes for AIX
  88. perlamiga Perl notes for Amiga
  89. perlbs2000 Perl notes for POSIX-BC BS2000
  90. perlcygwin Perl notes for Cygwin
  91. perldos Perl notes for DOS
  92. perlepoc Perl notes for EPOC
  93. perlhpux Perl notes for HP-UX
  94. perlmachten Perl notes for Power MachTen
  95. perlmacos Perl notes for Mac OS (Classic)
  96. perlmpeix Perl notes for MPE/iX
  97. perlos2 Perl notes for OS/2
  98. perlos390 Perl notes for OS/390
  99. perlsolaris Perl notes for Solaris
  100. perlvmesa Perl notes for VM/ESA
  101. perlvms Perl notes for VMS
  102. perlvos Perl notes for Stratus VOS
  103. perlwin32 Perl notes for Windows
  104. (If you're intending to read these straight through for the first time,
  105. the suggested order will tend to reduce the number of forward references.)
  106. By default, the manpages listed above are installed in the
  107. F</usr/local/man/> directory.
  108. Extensive additional documentation for Perl modules is available. The
  109. default configuration for perl will place this additional documentation
  110. in the F</usr/local/lib/perl5/man> directory (or else in the F<man>
  111. subdirectory of the Perl library directory). Some of this additional
  112. documentation is distributed standard with Perl, but you'll also find
  113. documentation for third-party modules there.
  114. You should be able to view Perl's documentation with your man(1)
  115. program by including the proper directories in the appropriate start-up
  116. files, or in the MANPATH environment variable. To find out where the
  117. configuration has installed the manpages, type:
  118. perl -V:man.dir
  119. If the directories have a common stem, such as F</usr/local/man/man1>
  120. and F</usr/local/man/man3>, you need only to add that stem
  121. (F</usr/local/man>) to your man(1) configuration files or your MANPATH
  122. environment variable. If they do not share a stem, you'll have to add
  123. both stems.
  124. If that doesn't work for some reason, you can still use the
  125. supplied F<perldoc> script to view module information. You might
  126. also look into getting a replacement man program.
  127. If something strange has gone wrong with your program and you're not
  128. sure where you should look for help, try the B<-w> switch first. It
  129. will often point out exactly where the trouble is.
  130. =head1 DESCRIPTION
  131. Perl is a language optimized for scanning arbitrary
  132. text files, extracting information from those text files, and printing
  133. reports based on that information. It's also a good language for many
  134. system management tasks. The language is intended to be practical
  135. (easy to use, efficient, complete) rather than beautiful (tiny,
  136. elegant, minimal).
  137. Perl combines (in the author's opinion, anyway) some of the best
  138. features of C, B<sed>, B<awk>, and B<sh>, so people familiar with
  139. those languages should have little difficulty with it. (Language
  140. historians will also note some vestiges of B<csh>, Pascal, and even
  141. BASIC-PLUS.) Expression syntax corresponds closely to C
  142. expression syntax. Unlike most Unix utilities, Perl does not
  143. arbitrarily limit the size of your data--if you've got the memory,
  144. Perl can slurp in your whole file as a single string. Recursion is of
  145. unlimited depth. And the tables used by hashes (sometimes called
  146. "associative arrays") grow as necessary to prevent degraded
  147. performance. Perl can use sophisticated pattern matching techniques to
  148. scan large amounts of data quickly. Although optimized for
  149. scanning text, Perl can also deal with binary data, and can make dbm
  150. files look like hashes. Setuid Perl scripts are safer than C programs
  151. through a dataflow tracing mechanism that prevents many stupid
  152. security holes.
  153. If you have a problem that would ordinarily use B<sed> or B<awk> or
  154. B<sh>, but it exceeds their capabilities or must run a little faster,
  155. and you don't want to write the silly thing in C, then Perl may be for
  156. you. There are also translators to turn your B<sed> and B<awk>
  157. scripts into Perl scripts.
  158. But wait, there's more...
  159. Begun in 1993 (see L<perlhist>), Perl version 5 is nearly a complete
  160. rewrite that provides the following additional benefits:
  161. =over 4
  162. =item *
  163. modularity and reusability using innumerable modules
  164. Described in L<perlmod>, L<perlmodlib>, and L<perlmodinstall>.
  165. =item *
  166. embeddable and extensible
  167. Described in L<perlembed>, L<perlxstut>, L<perlxs>, L<perlcall>,
  168. L<perlguts>, and L<xsubpp>.
  169. =item *
  170. roll-your-own magic variables (including multiple simultaneous DBM implementations)
  171. Described in L<perltie> and L<AnyDBM_File>.
  172. =item *
  173. subroutines can now be overridden, autoloaded, and prototyped
  174. Described in L<perlsub>.
  175. =item *
  176. arbitrarily nested data structures and anonymous functions
  177. Described in L<perlreftut>, L<perlref>, L<perldsc>, and L<perllol>.
  178. =item *
  179. object-oriented programming
  180. Described in L<perlobj>, L<perltoot>, and L<perlbot>.
  181. =item *
  182. compilability into C code or Perl bytecode
  183. Described in L<B> and L<B::Bytecode>.
  184. =item *
  185. support for light-weight processes (threads)
  186. Described in L<perlthrtut> and L<Thread>.
  187. =item *
  188. support for internationalization, localization, and Unicode
  189. Described in L<perllocale> and L<utf8>.
  190. =item *
  191. lexical scoping
  192. Described in L<perlsub>.
  193. =item *
  194. regular expression enhancements
  195. Described in L<perlre>, with additional examples in L<perlop>.
  196. =item *
  197. enhanced debugger and interactive Perl environment,
  198. with integrated editor support
  199. Described in L<perldebug>.
  200. =item *
  201. POSIX 1003.1 compliant library
  202. Described in L<POSIX>.
  203. =back
  204. Okay, that's I<definitely> enough hype.
  205. =head1 AVAILABILITY
  206. Perl is available for most operating systems, including virtually
  207. all Unix-like platforms. See L<perlport/"Supported Platforms">
  208. for a listing.
  209. =head1 ENVIRONMENT
  210. See L<perlrun>.
  211. =head1 AUTHOR
  212. Larry Wall <[email protected]>, with the help of oodles of other folks.
  213. If your Perl success stories and testimonials may be of help to others
  214. who wish to advocate the use of Perl in their applications,
  215. or if you wish to simply express your gratitude to Larry and the
  216. Perl developers, please write to [email protected] .
  217. =head1 FILES
  218. "@INC" locations of perl libraries
  219. =head1 SEE ALSO
  220. a2p awk to perl translator
  221. s2p sed to perl translator
  222. http://www.perl.com/ the Perl Home Page
  223. http://www.perl.com/CPAN the Comprehensive Perl Archive
  224. =head1 DIAGNOSTICS
  225. The C<use warnings> pragma (and the B<-w> switch) produces some
  226. lovely diagnostics.
  227. See L<perldiag> for explanations of all Perl's diagnostics. The C<use
  228. diagnostics> pragma automatically turns Perl's normally terse warnings
  229. and errors into these longer forms.
  230. Compilation errors will tell you the line number of the error, with an
  231. indication of the next token or token type that was to be examined.
  232. (In a script passed to Perl via B<-e> switches, each
  233. B<-e> is counted as one line.)
  234. Setuid scripts have additional constraints that can produce error
  235. messages such as "Insecure dependency". See L<perlsec>.
  236. Did we mention that you should definitely consider using the B<-w>
  237. switch?
  238. =head1 BUGS
  239. The B<-w> switch is not mandatory.
  240. Perl is at the mercy of your machine's definitions of various
  241. operations such as type casting, atof(), and floating-point
  242. output with sprintf().
  243. If your stdio requires a seek or eof between reads and writes on a
  244. particular stream, so does Perl. (This doesn't apply to sysread()
  245. and syswrite().)
  246. While none of the built-in data types have any arbitrary size limits
  247. (apart from memory size), there are still a few arbitrary limits: a
  248. given variable name may not be longer than 251 characters. Line numbers
  249. displayed by diagnostics are internally stored as short integers,
  250. so they are limited to a maximum of 65535 (higher numbers usually being
  251. affected by wraparound).
  252. You may mail your bug reports (be sure to include full configuration
  253. information as output by the myconfig program in the perl source
  254. tree, or by C<perl -V>) to [email protected] . If you've succeeded
  255. in compiling perl, the B<perlbug> script in the F<utils/> subdirectory
  256. can be used to help mail in a bug report.
  257. Perl actually stands for Pathologically Eclectic Rubbish Lister, but
  258. don't tell anyone I said that.
  259. =head1 NOTES
  260. The Perl motto is "There's more than one way to do it." Divining
  261. how many more is left as an exercise to the reader.
  262. The three principal virtues of a programmer are Laziness,
  263. Impatience, and Hubris. See the Camel Book for why.