X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperltoc.pod;h=1836d4ac6a2a75dc0d9d78775b31cb5b40356073;hb=98af1e142028dcf116f32636ea54f4c3e9494651;hp=da0af56e3139bbac768eae93ba578deb9be5fc6a;hpb=407700fe5a95941e31c1a8803af3ec87346865ed;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perltoc.pod b/pod/perltoc.pod index da0af56..1836d4a 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: 2005/03/27 -07:21:21 $) +=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.17 $, $Date: -2005/01/31 15:52:15 $) +=head2 perlfaq1 - General Questions About Perl =over 4 @@ -844,11 +899,11 @@ Interaction, perlfaq9 - Networking =item Which version of Perl should I use? -=item What are perl4, perl5, or perl6? +=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.31 $, -$Date: 2005/01/31 15:54:44 $) +=head2 perlfaq2 - Obtaining and Learning about Perl =over 4 @@ -887,13 +945,13 @@ $Date: 2005/01/31 15:54:44 $) =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.47 $, $Date: 2005/03/27 -07:21:22 $) +=head2 perlfaq3 - Programming Tools =over 4 @@ -963,10 +1020,10 @@ References, Tutorials, Task-Oriented, Special Topics =item Is there an IDE or Windows Perl Editor? -Eclipse, Komodo, Open Perl IDE, OptiPerl, PerlBuilder, visiPerl+, Visual -Perl, GNU Emacs, MicroEMACS, XEmacs, Jed, Elvis, Vile, Vim, Codewright, -MultiEdit, SlickEdit, Bash, Ksh, Tcsh, Zsh, Affrus, Alpha, BBEdit and -BBEdit Lite +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? @@ -974,7 +1031,10 @@ BBEdit Lite =item How can I use curses with Perl? -=item How can I use X or Tk with Perl? +=item How can I write a GUI (X, Tk, Gtk, etc.) in Perl? +X X X X X X X X + +Tk, Wx, Gtk and Gtk2, Win32::GUI, CamelBones, Qt, Athena =item How can I make my Perl program run faster? @@ -993,8 +1053,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? @@ -1005,7 +1063,7 @@ 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? @@ -1016,12 +1074,13 @@ program; what am I doing wrong? =back +=item REVISION + =item AUTHOR AND COPYRIGHT =back -=head2 perlfaq4 - Data Manipulation ($Revision: 1.61 $, $Date: 2005/03/11 -16:27:53 $) +=head2 perlfaq4 - Data Manipulation =over 4 @@ -1078,7 +1137,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 @@ -1144,8 +1203,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? @@ -1167,6 +1224,8 @@ intersection of two arrays? =item How do I select a random element from an array? =item How do I permute N elements of a list? +X X X X +X X =item How do I sort an array by (anything)? @@ -1192,6 +1251,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? @@ -1235,12 +1295,13 @@ array of hashes or arrays? =back +=item REVISION + =item AUTHOR AND COPYRIGHT =back -=head2 perlfaq5 - Files and Formats ($Revision: 1.35 $, $Date: 2005/01/21 -12:26:11 $) +=head2 perlfaq5 - Files and Formats =over 4 @@ -1249,96 +1310,128 @@ array of hashes or arrays? =over 4 =item How do I flush/unbuffer an output filehandle? Why must I do this? - -=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? +X X X 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