X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperltoc.pod;h=95047146114ec373db9c912a2004658bc2708227;hb=dbef3c66e2761d118774f973c961faa9b1e467d9;hp=16a168edaf8aea8af765b6c3566a9985c00a46b9;hpb=c73e4e00054ab1c5608329164183e7587eb0d712;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perltoc.pod b/pod/perltoc.pod index 16a168e..9504714 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -71,6 +71,8 @@ through to locate the proper section you're looking for. =item Running Perl programs +=item Safety net + =item Basic syntax overview =item Perl variable types @@ -157,18 +159,25 @@ arrays of arrays, hashes of arrays, arrays of hashes, hashes of hashes, more elaborate constructs =item REFERENCES +X X X X =item COMMON MISTAKES =item CAVEAT ON PRECEDENCE +X X =item WHY YOU SHOULD ALWAYS C =item DEBUGGING +X X +X X X X +X X +X X =item CODE EXAMPLES =item ARRAYS OF ARRAYS +X X =over 4 @@ -181,6 +190,7 @@ more elaborate constructs =back =item HASHES OF ARRAYS +X X =over 4 @@ -193,6 +203,7 @@ more elaborate constructs =back =item ARRAYS OF HASHES +X X =over 4 @@ -205,6 +216,7 @@ more elaborate constructs =back =item HASHES OF HASHES +X X =over 4 @@ -217,6 +229,7 @@ more elaborate constructs =back =item MORE ELABORATE RECORDS +X X X =over 4 @@ -324,8 +337,22 @@ more elaborate constructs =item Extracting matches +=item Backreferences + +=item Relative backreferences + +=item Named backreferences + +=item Alternative capture group numbering + +=item Position information + +=item Non-capturing groupings + =item Matching repetitions +=item Possessive quantifiers + =item Building a regexp =item Using regular expressions in Perl @@ -340,9 +367,9 @@ more elaborate constructs =item Compiling and saving regular expressions -=item Embedding comments and modifiers in a regular expression +=item Composing regular expressions at runtime -=item Non-capturing groupings +=item Embedding comments and modifiers in a regular expression =item Looking ahead and looking behind @@ -350,8 +377,14 @@ more elaborate constructs =item Conditional expressions +=item Defining named patterns + +=item Recursive patterns + =item A bit of magic: executing Perl code in a regular expression +=item Backtracking control verbs + =item Pragmas and debugging =back @@ -478,6 +511,8 @@ more elaborate constructs =item UNIVERSAL: The Root of All Objects +=item Deeper UNIVERSAL details + =back =item Alternate Object Representations @@ -673,54 +708,84 @@ Subroutine, Signal, Sorting Traps, OS Traps, DBM Traps, Unclassified Traps =item Discontinuance, Deprecation, and BugFix traps -Discontinuance, Deprecation, BugFix, Discontinuance, Discontinuance, -Discontinuance, BugFix, Discontinuance, Discontinuance, BugFix, -Discontinuance, Deprecation, Discontinuance, Discontinuance +Symbols starting with "_" no longer forced into main, Double-colon valid +package separator in variable name, 2nd and 3rd args to C are now +in scalar context, Can't do C into a block that is optimized away, +Can't use whitespace as variable name or quote delimiter, C gone, C<**> binds tighter than unary minus, C changed when +iterating over a list, C with no args behavior changed, B<-e> +behavior fixed, C returns number of elements in resulting list, Some +error messages differ, C honors subroutine args, Bugs removed =item Parsing Traps -Parsing, Parsing, Parsing, Parsing, Parsing +Space between . and = triggers syntax error, Better parsing in perl 5, +Function parsing, String interpolation of C<$#array> differs, Perl guesses +on C, C followed by C<{> if it starts BLOCK or hash ref =item Numerical Traps -Numerical, Numerical, Numerical, Bitwise string ops +Formatted output and significant digits, Auto-increment operator over +signed int limit deleted, Assignment of return values from numeric equality +tests doesn't work, Bitwise string ops =item General data type traps -(Arrays), (Arrays), (Hashes), (Globs), (Globs), (Scalar String), -(Constants), (Scalars), (Variable Suicide) +Negative array subscripts now count from the end of array, Setting +C<$#array> lower now discards array elements, Hashes get defined before +use, Glob assignment from localized variable to variable, Assigning +C to glob, Changes in unary negation (of strings), Modifying of +constants prohibited, C behavior changed, Variable Suicide =item Context Traps - scalar, list contexts -(list context), (scalar context), (scalar context), (list, builtin) +Elements of argument lists for formats evaluated in list context, +C returns false value in scalar context if no caller present, +Comma operator in scalar context gives scalar context to args, C +prototyped as C<($;@)> =item Precedence Traps -Precedence, Precedence, Precedence, Precedence, Precedence, Precedence, -Precedence +LHS vs. RHS of any assignment operator, Semantic errors introduced due to +precedence, Precedence of assignment operators same as the precedence of +assignment, C requires parentheses around filehandle, C<$:> +precedence over C<$::> gone, Precedence of file test operators documented, +C, C, C are regular named unary operators =item General Regular Expression Traps using s///, etc. -Regular Expression, Regular Expression, Regular Expression, Regular -Expression, Regular Expression, Regular Expression, Regular Expression, -Regular Expression, Regular Expression +C interpolates on either side, C attaches its state to +the searched string, C used within an anonymous sub, C<$+> isn't set +to whole match, Substitution now returns null string if it fails, +C is now a normal substitution, Stricter parsing of variables +in regular expressions, C matches only once, Failed matches don't +reset the match variables =item Subroutine, Signal, Sorting Traps -(Signals), (Sort Subroutine), warn() won't let you specify a filehandle +Barewords that used to look like strings look like subroutine calls, +Reverse is no longer allowed as the name of a sort subroutine, C +won't let you specify a filehandle =item OS Traps -(SysV), (SysV) +SysV resets signal handler correctly, SysV C appends correctly =item Interpolation Traps -Interpolation, Interpolation, Interpolation, Interpolation, Interpolation, -Interpolation, Interpolation, Interpolation, Interpolation +C<@> always interpolates an array in double-quotish strings, Double-quoted +strings may no longer end with an unescaped $, Arbitrary expressions are +evaluated inside braces within double quotes, C<$$x> now tries to +dereference $x, Creation of hashes on the fly with C requires +protection, Bugs in earlier perl versions, Array and hash brackets during +interpolation, Interpolation of C<\$$foo{bar}>, C string passed to +C will not find string terminator =item DBM Traps -DBM, DBM +Perl5 must have been linked with same dbm/ndbm as the default for +C, DBM exceeding limit on the key/value size will cause perl5 to +exit immediately =item Unclassified Traps @@ -765,8 +830,7 @@ LIMIT specified =back -=head2 perlfaq - frequently asked questions about Perl ($Date: 2003/01/31 -17:37:17 $) +=head2 perlfaq - frequently asked questions about Perl =over 4 @@ -779,21 +843,13 @@ LIMIT specified =item How to contribute to the perlfaq =item What will happen if you mail your Perl programming problems to the -authors +authors? =back -=item Credits - -=item Author and Copyright Information - -=over 4 - -=item Bundled Distributions - -=item Disclaimer +=item CREDITS -=back +=item AUTHOR AND COPYRIGHT =item Table of Contents @@ -829,8 +885,7 @@ Interaction, perlfaq9 - Networking =back -=head2 perlfaq1 - General Questions About Perl ($Revision: 1.12 $, $Date: -2003/07/09 15:47:28 $) +=head2 perlfaq1 - General Questions About Perl ($Revision: 9681 $) =over 4 @@ -844,11 +899,11 @@ Interaction, perlfaq9 - Networking =item Which version of Perl should I use? -=item What are perl4 and perl5? +=item What are Perl 4, Perl 5, or Perl 6? -=item What is Ponie? +=item What was Ponie? -=item What is perl6? +=item What is Perl 6? =item How stable is Perl? @@ -869,17 +924,20 @@ Scheme, or Tcl? =item Where can I get a list of Larry Wall witticisms? -=item How can I convince my sysadmin/supervisor/employees to use version -5/5.6.1/Perl instead of some other language? +=item How can I convince others to use Perl? + +http://perltraining.com.au/whyperl.html, +http://www.perl.org/advocacy/whyperl.html =back +=item REVISION + =item AUTHOR AND COPYRIGHT =back -=head2 perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.20 $, -$Date: 2003/01/26 17:50:56 $) +=head2 perlfaq2 - Obtaining and Learning about Perl ($Revision: 9462 $) =over 4 @@ -887,13 +945,13 @@ $Date: 2003/01/26 17:50:56 $) =over 4 -=item What machines support Perl? Where do I get it? +=item What machines support perl? Where do I get it? -=item How can I get a binary version of Perl? +=item How can I get a binary version of perl? -=item I don't have a C compiler on my system. How can I compile perl? +=item I don't have a C compiler. How can I build my own Perl interpreter? -=item I copied the Perl binary from one machine to another, but scripts +=item I copied the perl binary from one machine to another, but scripts don't work. =item I grabbed the sources and tried to compile but gdbm/dynamic @@ -914,15 +972,13 @@ What does CPAN/src/... mean? References, Tutorials, Task-Oriented, Special Topics -=item Perl in Magazines - -=item Perl on the Net: FTP and WWW Access +=item Which magazines have Perl content? =item What mailing lists are there for Perl? -=item Archives of comp.lang.perl.misc +=item Where are the archives for comp.lang.perl.misc? -=item Where can I buy a commercial version of Perl? +=item Where can I buy a commercial version of perl? =item Where do I send bug reports? @@ -930,12 +986,13 @@ References, Tutorials, Task-Oriented, Special Topics =back +=item REVISION + =item AUTHOR AND COPYRIGHT =back -=head2 perlfaq3 - Programming Tools ($Revision: 1.33 $, $Date: 2003/01/31 -17:34:56 $) +=head2 perlfaq3 - Programming Tools ($Revision: 8539 $) =over 4 @@ -963,9 +1020,10 @@ References, Tutorials, Task-Oriented, Special Topics =item Is there an IDE or Windows Perl Editor? -Komodo, The Object System, Open Perl IDE, PerlBuilder, visiPerl+, OptiPerl, -GNU Emacs, MicroEMACS, XEmacs, Jed, Elvis, Vile, Vim, Codewright, -MultiEdit, SlickEdit, Bash, Ksh, Tcsh, Zsh, BBEdit and BBEdit Lite, Alpha +Eclipse, Enginsite, Komodo, Open Perl IDE, OptiPerl, PerlBuilder, +visiPerl+, Visual Perl, Zeus, GNU Emacs, MicroEMACS, XEmacs, Jed, Elvis, +Vile, Vim, Codewright, MultiEdit, SlickEdit, Bash, Ksh, Tcsh, Zsh, Affrus, +Alpha, BBEdit and BBEdit Lite =item Where can I get Perl macros for vi? @@ -975,8 +1033,6 @@ MultiEdit, SlickEdit, Bash, Ksh, Tcsh, Zsh, BBEdit and BBEdit Lite, Alpha =item How can I use X or Tk with Perl? -=item How can I generate simple menus without using CGI or Tk? - =item How can I make my Perl program run faster? =item How can I make my Perl program take less memory? @@ -994,8 +1050,6 @@ stringification, Pass by reference, Tie large variables to disk =item How can I compile my Perl program into byte code or C? -=item How can I compile Perl into Java? - =item How can I get C<#!perl> to work on [MS-DOS,NT,...]? =item Can I write useful Perl programs on the command line? @@ -1006,10 +1060,10 @@ stringification, Pass by reference, Tie large variables to disk =item Where can I learn about object-oriented Perl programming? -=item Where can I learn about linking C with Perl? [h2xs, xsubpp] +=item Where can I learn about linking C with Perl? -=item I've read perlembed, perlguts, etc., but I can't embed perl in -my C program; what am I doing wrong? +=item I've read perlembed, perlguts, etc., but I can't embed perl in my C +program; what am I doing wrong? =item When I tried to run my script, I got this message. What does it mean? @@ -1017,12 +1071,13 @@ my C program; what am I doing wrong? =back +=item REVISION + =item AUTHOR AND COPYRIGHT =back -=head2 perlfaq4 - Data Manipulation ($Revision: 1.44 $, $Date: 2003/07/28 -17:35:21 $) +=head2 perlfaq4 - Data Manipulation ($Revision: 9681 $) =over 4 @@ -1035,12 +1090,14 @@ my C program; what am I doing wrong? =item Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)? +=item Why is int() broken? + =item Why isn't my octal data interpreted correctly? =item Does Perl have a round() function? What about ceil() and floor()? Trig functions? -=item How do I convert between numeric representations? +=item How do I convert between numeric representations/bases/radixes? How do I convert hexadecimal into decimal, How do I convert from decimal to hexadecimal, How do I convert from octal to decimal, How do I convert from @@ -1077,7 +1134,7 @@ from decimal to binary =item How do I find yesterday's date? -=item Does Perl have a Year 2000 problem? Is Perl Y2K compliant? +=item Does Perl have a Year 2000 problem? Is Perl Y2K compliant? =back @@ -1143,8 +1200,6 @@ the tag =item How can I remove duplicate elements from a list or array? -a), b), c), d), e) - =item How can I tell whether a certain element is contained in a list or array? @@ -1191,6 +1246,7 @@ it? =item How do I sort a hash (optionally by value instead of key)? =item How can I always keep my hash sorted? +X =item What's the difference between "delete" and "undef" with hashes? @@ -1234,12 +1290,13 @@ array of hashes or arrays? =back +=item REVISION + =item AUTHOR AND COPYRIGHT =back -=head2 perlfaq5 - Files and Formats ($Revision: 1.28 $, $Date: 2003/01/26 -17:45:46 $) +=head2 perlfaq5 - Files and Formats ($Revision: 9576 $) =over 4 @@ -1248,94 +1305,132 @@ array of hashes or arrays? =over 4 =item How do I flush/unbuffer an output filehandle? Why must I do this? +X X X X -=item How do I change one line in a file/delete a line in a file/insert a -line in the middle of a file/append to the beginning of a file? +=item How do I change, delete, or insert a line in a file, or append to the +beginning of a file? +X =item How do I count the number of lines in a file? +X X X =item How can I use Perl's C<-i> option from within a program? +X<-i> X + +=item How can I copy a file? +X X =item How do I make a temporary file name? +X =item How can I manipulate fixed-record-length files? +X X =item How can I make a filehandle local to a subroutine? How do I pass filehandles between subroutines? How do I make an array of filehandles? +X X X =item How can I use a filehandle indirectly? +X =item How can I set up a footer format to be used with write()? +X