summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-11-05 20:18:51 +0000
committerNicholas Clark <nick@ccl4.org>2004-11-05 20:18:51 +0000
commit33fd49fb58270542920bf9959d44bf1cd7a68675 (patch)
tree97e770f7dbf5c1449a5545435b07de58e7fda819
parent705c41e47dc665604dd0834d27d695677385c107 (diff)
downloadperl-33fd49fb58270542920bf9959d44bf1cd7a68675.tar.gz
Integrate:
[ 23423] Small updates to the web addresses for Perl, noticed by Robert Spier [ 23466] FAQ sync p4raw-link: @23466 on //depot/perl: c98c5709a1fc0acfba02e8ebb6a4c372fb300ad7 p4raw-link: @23423 on //depot/perl: c5f69108107d74addb45ef7db360779d1d1fd1a5 p4raw-id: //depot/maint-5.8/perl@23476 p4raw-integrated: from //depot/perl@23464 'copy in' pod/perlfaq.pod pod/perlfaq9.pod (@19188..) pod/perlfaq6.pod (@21166..) pod/perlfaq7.pod (@21349..) pod/perlfaq1.pod pod/perlfaq3.pod pod/perlfaq4.pod (@21835..) pod/perlfaq5.pod pod/perlfaq8.pod (@22258..) pod/perlfaq2.pod (@23423..) 'merge in' pod/perl.pod (@23392..)
-rw-r--r--pod/perl.pod3
-rw-r--r--pod/perlfaq.pod38
-rw-r--r--pod/perlfaq1.pod4
-rw-r--r--pod/perlfaq2.pod161
-rw-r--r--pod/perlfaq3.pod32
-rw-r--r--pod/perlfaq4.pod4
-rw-r--r--pod/perlfaq5.pod2
-rw-r--r--pod/perlfaq6.pod24
-rw-r--r--pod/perlfaq7.pod6
-rw-r--r--pod/perlfaq8.pod117
-rw-r--r--pod/perlfaq9.pod4
11 files changed, 221 insertions, 174 deletions
diff --git a/pod/perl.pod b/pod/perl.pod
index 600479020a..ab9064beb0 100644
--- a/pod/perl.pod
+++ b/pod/perl.pod
@@ -371,9 +371,10 @@ Perl developers, please write to perl-thanks@perl.org .
a2p awk to perl translator
s2p sed to perl translator
- http://www.perl.org/ the Perl Home Page
+ http://www.perl.org/ the Perl homepage
http://www.perl.com/ Perl articles (O'Reilly Media)
http://www.cpan.org/ the Comprehensive Perl Archive
+ http://www.pm.org/ the Perl Mongers
=head1 DIAGNOSTICS
diff --git a/pod/perlfaq.pod b/pod/perlfaq.pod
index 7acdf613d0..e97a59a6db 100644
--- a/pod/perlfaq.pod
+++ b/pod/perlfaq.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq - frequently asked questions about Perl ($Date: 2003/01/31 17:37:17 $)
+perlfaq - frequently asked questions about Perl ($Date: 2004/10/05 22:15:44 $)
=head1 DESCRIPTION
@@ -98,6 +98,7 @@ in respect of this information or its use.
=head1 The Questions
+
=head2 L<perlfaq1>: General Questions About Perl
Very general, high-level questions about Perl.
@@ -122,6 +123,10 @@ What are perl4 and perl5?
=item *
+What is Ponie?
+
+=item *
+
What is perl6?
=item *
@@ -169,8 +174,7 @@ How can I convince my sysadmin/supervisor/employees to use version 5/5.6.1/Perl
=head2 L<perlfaq2>: Obtaining and Learning about Perl
-Where to find source and documentation for Perl, support,
-and related matters.
+Where to find source and documentation for Perl, support, and related matters.
=over 4
@@ -374,7 +378,6 @@ Where can I learn about linking C with Perl? [h2xs, xsubpp]
=item *
I've read perlembed, perlguts, etc., but I can't embed perl in
-my C program; what am I doing wrong?
=item *
@@ -389,8 +392,7 @@ What's MakeMaker?
=head2 L<perlfaq4>: Data Manipulation
-Manipulating numbers, dates, strings, arrays, hashes, and
-miscellaneous data issues.
+Manipulating numbers, dates, strings, arrays, hashes, and miscellaneous data issues.
=over 4
@@ -400,6 +402,10 @@ Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I s
=item *
+Why is int() broken?
+
+=item *
+
Why isn't my octal data interpreted correctly?
=item *
@@ -408,7 +414,7 @@ Does Perl have a round() function? What about ceil() and floor()? Trig functio
=item *
-How do I convert between numeric representations?
+How do I convert between numeric representations/bases/radixes?
=item *
@@ -833,7 +839,7 @@ How do I close a file descriptor by number?
=item *
-Why can't I use "C:\temp\foo" in DOS paths? What doesn't `C:\temp\foo.exe` work?
+Why can't I use "C:\temp\foo" in DOS paths? Why doesn't `C:\temp\foo.exe` work?
=item *
@@ -856,7 +862,7 @@ Why do I get weird spaces when I print an array of lines?
=head2 L<perlfaq6>: Regular Expressions
-Pattern matching and regular expressions.
+This section is surprisingly small because the rest of the FAQ is littered with answers involving regular expressions. For example, decoding a URL and checking whether something is a number are handled with regular expressions, but those answers are found elsewhere in this document (in L<perlfaq9>: ``How do I decode or create those %-encodings on the web'' and L<perlfaq4>: ``How do I determine whether a scalar is a number/whole/integer/float'', to be precise).
=over 4
@@ -942,7 +948,7 @@ Are Perl regexes DFAs or NFAs? Are they POSIX compliant?
=item *
-What's wrong with using grep or map in a void context?
+What's wrong with using grep in a void context?
=item *
@@ -957,8 +963,7 @@ How do I match a pattern that is supplied by the user?
=head2 L<perlfaq7>: General Perl Language Issues
-General Perl language issues that don't clearly fit into any of the
-other sections.
+General Perl language issues that don't clearly fit into any of the other sections.
=over 4
@@ -1083,8 +1088,7 @@ What does "bad interpreter" mean?
=head2 L<perlfaq8>: System Interaction
-Interprocess communication (IPC), control over the user-interface
-(keyboard, screen and pointing devices).
+This section of the Perl FAQ covers questions involving operating system interaction. Topics include interprocess communication (IPC), control over the user-interface (keyboard, screen and pointing devices), and most anything else not related to data manipulation. Read the FAQs and documentation specific to the port of perl to your operating system (eg, L<perlvms>, L<perlplan9>, ...). These should contain more detailed information on the vagaries of your perl.
=over 4
@@ -1262,6 +1266,10 @@ How do I open a file without blocking?
=item *
+How do I tell the difference between errors from the shell and perl?
+
+=item *
+
How do I install a module from CPAN?
=item *
@@ -1278,7 +1286,7 @@ How do I add the directory my program lives in to the module/library search path
=item *
-How do I add a directory to my include path at runtime?
+How do I add a directory to my include path (@INC) at runtime?
=item *
diff --git a/pod/perlfaq1.pod b/pod/perlfaq1.pod
index 61fd1d173c..293aa7f826 100644
--- a/pod/perlfaq1.pod
+++ b/pod/perlfaq1.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq1 - General Questions About Perl ($Revision: 1.14 $, $Date: 2003/11/23 08:02:29 $)
+perlfaq1 - General Questions About Perl ($Revision: 1.15 $, $Date: 2004/10/11 05:06:29 $)
=head1 DESCRIPTION
@@ -173,7 +173,7 @@ Probably the best thing to do is try to write equivalent code to do a
set of tasks. These languages have their own newsgroups in which you
can learn about (but hopefully not argue about) them.
-Some comparison documents can be found at http://language.perl.com/versus/
+Some comparison documents can be found at http://www.perl.com/doc/FMTEYEWTK/versus/
if you really can't stop yourself.
=head2 Can I do [task] in Perl?
diff --git a/pod/perlfaq2.pod b/pod/perlfaq2.pod
index 88288ec822..4d419549b0 100644
--- a/pod/perlfaq2.pod
+++ b/pod/perlfaq2.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.25 $, $Date: 2003/10/16 04:57:38 $)
+perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.29 $, $Date: 2004/10/25 18:37:23 $)
=head1 DESCRIPTION
@@ -129,7 +129,7 @@ miscellaneous modules.
See http://www.cpan.org/modules/00modlist.long.html or
http://search.cpan.org/ for a more complete list of modules by category.
-CPAN is not affiliated with O'Reilly and Associates.
+CPAN is not affiliated with O'Reilly Media.
=head2 Is there an ISO or ANSI certified version of Perl?
@@ -218,34 +218,34 @@ This is faster and more productive than just posting a request.
=head2 Perl Books
-A number of books on Perl and/or CGI programming are available. A few of
-these are good, some are OK, but many aren't worth your money. Tom
-Christiansen maintains a list of these books, some with extensive
-reviews, at http://www.perl.com/perl/critiques/index.html .
+A number of books on Perl and/or CGI programming are available. A few
+of these are good, some are OK, but many aren't worth your money.
+There is a list of these books, some with extensive reviews, at
+http://books.perl.org/ .
The incontestably definitive reference book on Perl, written by
-the creator of Perl, is now (July 2000) in its third edition:
+the creator of Perl, is now (Sept 2004) in its third edition:
- Programming Perl (the "Camel Book"):
+ Programming Perl (the "Camel Book"):
by Larry Wall, Tom Christiansen, and Jon Orwant
- 0-596-00027-8 [3rd edition July 2000]
+ ISBN 0-596-00027-8 [3rd edition July 2000]
http://www.oreilly.com/catalog/pperl3/
- (English, translations to several languages are also available)
+ (English, translations to several languages are also available)
The companion volume to the Camel containing thousands
of real-world examples, mini-tutorials, and complete programs is:
- The Perl Cookbook (the "Ram Book"):
+ The Perl Cookbook (the "Ram Book"):
by Tom Christiansen and Nathan Torkington,
with Foreword by Larry Wall
- ISBN 1-56592-243-3 [1st Edition August 1998]
- http://perl.oreilly.com/catalog/cookbook/
+ ISBN 0-596-00313-7 [2nd Edition August 2003]
+ http://www.oreilly.com/catalog/perlckbk2/
If you're already a seasoned programmer, then the Camel Book might
suffice for you to learn Perl from. If you're not, check out the
Llama book:
- Learning Perl (the "Llama Book")
+ Learning Perl (the "Llama Book")
by Randal L. Schwartz and Tom Phoenix
ISBN 0-596-00132-0 [3rd edition July 2001]
http://www.oreilly.com/catalog/lperl3/
@@ -254,26 +254,26 @@ And for more advanced information on writing larger programs,
presented in the same style as the Llama book, continue your education
with the Alpaca book:
- Learning Perl Objects, References, and Modules (the "Alpaca Book")
- by Randal L. Schwartz, with Tom Phoenix (foreword by Damian Conway)
- ISBN 0-596-00478-8 [1st edition June 2003]
- http://www.oreilly.com/catalog/lrnperlorm/
+ Learning Perl Objects, References, and Modules (the "Alpaca Book")
+ by Randal L. Schwartz, with Tom Phoenix (foreword by Damian Conway)
+ ISBN 0-596-00478-8 [1st edition June 2003]
+ http://www.oreilly.com/catalog/lrnperlorm/
If you're not an accidental programmer, but a more serious and
possibly even degreed computer scientist who doesn't need as much
hand-holding as we try to provide in the Llama, please check out the
delightful book
- Perl: The Programmer's Companion
- by Nigel Chapman
- ISBN 0-471-97563-X [1997, 3rd printing Spring 1998]
- http://www.wiley.com/compbooks/catalog/97563-X.htm
- http://www.wiley.com/compbooks/chapman/perl/perltpc.html (errata etc)
+ Perl: The Programmer's Companion
+ by Nigel Chapman
+ ISBN 0-471-97563-X [1997, 3rd printing Spring 1998]
+ http://www.wiley.com/compbooks/catalog/97563-X.htm
+ http://www.wiley.com/compbooks/chapman/perl/perltpc.html (errata etc)
If you are more at home in Windows the following is available
(though unfortunately rather dated).
- Learning Perl on Win32 Systems (the "Gecko Book")
+ Learning Perl on Win32 Systems (the "Gecko Book")
by Randal L. Schwartz, Erik Olson, and Tom Christiansen,
with foreword by Larry Wall
ISBN 1-56592-324-3 [1st edition August 1997]
@@ -296,56 +296,56 @@ Recommended books on (or mostly on) Perl follow.
=item References
- Programming Perl
+ Programming Perl
by Larry Wall, Tom Christiansen, and Jon Orwant
ISBN 0-596-00027-8 [3rd edition July 2000]
http://www.oreilly.com/catalog/pperl3/
- Perl 5 Pocket Reference
- by Johan Vromans
+ Perl 5 Pocket Reference
+ by Johan Vromans
ISBN 0-596-00032-4 [3rd edition May 2000]
http://www.oreilly.com/catalog/perlpr3/
- Perl in a Nutshell
- by Ellen Siever, Stephan Spainhour, and Nathan Patwardhan
+ Perl in a Nutshell
+ by Ellen Siever, Stephan Spainhour, and Nathan Patwardhan
ISBN 1-56592-286-7 [1st edition December 1998]
http://www.oreilly.com/catalog/perlnut/
=item Tutorials
- Elements of Programming with Perl
+ Elements of Programming with Perl
by Andrew L. Johnson
ISBN 1-884777-80-5 [1st edition October 1999]
http://www.manning.com/Johnson/
- Learning Perl
+ Learning Perl
by Randal L. Schwartz and Tom Phoenix
ISBN 0-596-00132-0 [3rd edition July 2001]
http://www.oreilly.com/catalog/lperl3/
- Learning Perl Objects, References, and Modules
- by Randal L. Schwartz, with Tom Phoenix (foreword by Damian Conway)
- ISBN 0-596-00478-8 [1st edition June 2003]
- http://www.oreilly.com/catalog/lrnperlorm/
+ Learning Perl Objects, References, and Modules
+ by Randal L. Schwartz, with Tom Phoenix (foreword by Damian Conway)
+ ISBN 0-596-00478-8 [1st edition June 2003]
+ http://www.oreilly.com/catalog/lrnperlorm/
- Learning Perl on Win32 Systems
+ Learning Perl on Win32 Systems
by Randal L. Schwartz, Erik Olson, and Tom Christiansen,
with foreword by Larry Wall
ISBN 1-56592-324-3 [1st edition August 1997]
http://www.oreilly.com/catalog/lperlwin/
- Perl: The Programmer's Companion
+ Perl: The Programmer's Companion
by Nigel Chapman
ISBN 0-471-97563-X [1997, 3rd printing Spring 1998]
- http://www.wiley.com/compbooks/catalog/97563-X.htm
- http://www.wiley.com/compbooks/chapman/perl/perltpc.html (errata etc)
+ http://www.wiley.com/compbooks/catalog/97563-X.htm
+ http://www.wiley.com/compbooks/chapman/perl/perltpc.html (errata etc)
- Cross-Platform Perl
+ Cross-Platform Perl
by Eric Foster-Johnson
ISBN 1-55851-483-X [2nd edition September 2000]
http://www.pconline.com/~erc/perlbook.htm
- MacPerl: Power and Ease
+ MacPerl: Power and Ease
by Vicki Brown and Chris Nandor,
with foreword by Matthias Neeracher
ISBN 1-881957-32-2 [1st edition May 1998]
@@ -353,21 +353,20 @@ Recommended books on (or mostly on) Perl follow.
=item Task-Oriented
- The Perl Cookbook
+ The Perl Cookbook
by Tom Christiansen and Nathan Torkington
with foreword by Larry Wall
ISBN 1-56592-243-3 [1st edition August 1998]
http://www.oreilly.com/catalog/cookbook/
- Effective Perl Programming
+ Effective Perl Programming
by Joseph Hall
ISBN 0-201-41975-0 [1st edition 1998]
http://www.awl.com/
-
=item Special Topics
- Mastering Regular Expressions
+ Mastering Regular Expressions
by Jeffrey E. F. Friedl
ISBN 0-596-00289-0 [2nd edition July 2002]
http://www.oreilly.com/catalog/regex2/
@@ -393,15 +392,15 @@ Recommended books on (or mostly on) Perl follow.
ISBN 1-56592-716-8 [1st edition January 2002]
http://www.oreilly.com/catalog/mastperltk/
- Extending and Embedding Perl
- by Tim Jenness and Simon Cozens
- ISBN 1-930110-82-0 [1st edition August 2002]
- http://www.manning.com/jenness
+ Extending and Embedding Perl
+ by Tim Jenness and Simon Cozens
+ ISBN 1-930110-82-0 [1st edition August 2002]
+ http://www.manning.com/jenness
- Perl Debugger Pocket Reference
- by Richard Foley
- ISBN 0-596-00503-2 [1st edition January 2004]
- http://www.oreilly.com/catalog/perldebugpr/
+ Perl Debugger Pocket Reference
+ by Richard Foley
+ ISBN 0-596-00503-2 [1st edition January 2004]
+ http://www.oreilly.com/catalog/perldebugpr/
=back
@@ -481,32 +480,6 @@ as do the O'Reilly Perl Resource Kits (in both the Unix flavor
and in the proprietary Microsoft flavor); the free Unix distributions
also all come with Perl.
-Alternatively, you can purchase commercial incidence based support
-through the Perl Clinic. The following is a commercial from them:
-
-"The Perl Clinic is a commercial Perl support service operated by
-ActiveState Tool Corp. and The Ingram Group. The operators have many
-years of in-depth experience with Perl applications and Perl internals
-on a wide range of platforms.
-
-"Through our group of highly experienced and well-trained support engineers,
-we will put our best effort into understanding your problem, providing an
-explanation of the situation, and a recommendation on how to proceed."
-
-Contact The Perl Clinic at
-
- www.PerlClinic.com
-
- North America Pacific Standard Time (GMT-8)
- Tel: 1 604 606-4611 hours 8am-6pm
- Fax: 1 604 606-4640
-
- Europe (GMT)
- Tel: 00 44 1483 862814
- Fax: 00 44 1483 862801
-
-See also www.perl.com for updates on tutorials, training, and support.
-
=head2 Where do I send bug reports?
If you are reporting a bug in the perl interpreter or the modules
@@ -523,29 +496,27 @@ Read the perlbug(1) man page (perl5.004 or later) for more information.
=head2 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org?
-Perl.com at http://www.perl.com/ is part of the O'Reilly Network, a subsidiary
-of O'Reilly Media.
+Perl.com at http://www.perl.com/ is part of the O'Reilly Network, a
+subsidiary of O'Reilly Media.
-Perl Mongers is an advocacy organization for the Perl language which
-maintains the web site http://www.perl.org/ as a general advocacy
-site for the Perl language.
+The Perl Foundation is an advocacy organization for the Perl language
+which maintains the web site http://www.perl.org/ as a general
+advocacy site for the Perl language. It uses the domain to provide
+general support services to the Perl community, including the hosting
+of mailing lists, web sites, and other services. The web site
+http://www.perl.org/ is a general advocacy site for the Perl language,
+and there are many other sub-domains for special topics, such as
+
+ http://learn.perl.org/
+ http://use.perl.org/
+ http://jobs.perl.org/
+ http://lists.perl.org/
Perl Mongers uses the pm.org domain for services related to Perl user
groups, including the hosting of mailing lists and web sites. See the
Perl user group web site at http://www.pm.org/ for more information about
joining, starting, or requesting services for a Perl user group.
-Perl Mongers also maintain the perl.org domain to provide general
-support services to the Perl community, including the hosting of mailing
-lists, web sites, and other services. The web site
-http://www.perl.org/ is a general advocacy site for the Perl language,
-and there are many other sub-domains for special topics, such as
-
- http://bugs.perl.org/
- http://history.perl.org/
- http://lists.perl.org/
- http://use.perl.org/
-
http://www.cpan.org/ is the Comprehensive Perl Archive Network,
a replicated worlwide repository of Perl software, see
the I<What is CPAN?> question earlier in this document.
diff --git a/pod/perlfaq3.pod b/pod/perlfaq3.pod
index 2fdc2fc5e0..7c6eb5f194 100644
--- a/pod/perlfaq3.pod
+++ b/pod/perlfaq3.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq3 - Programming Tools ($Revision: 1.37 $, $Date: 2003/11/24 19:55:50 $)
+perlfaq3 - Programming Tools ($Revision: 1.40 $, $Date: 2004/10/19 17:02:27 $)
=head1 DESCRIPTION
@@ -227,16 +227,10 @@ If you want an IDE, check the following:
ActiveState's cross-platform (as of April 2001 Windows and Linux),
multi-language IDE has Perl support, including a regular expression
debugger and remote debugging
-( http://www.ActiveState.com/Products/Komodo/index.html ). (Visual
+( http://www.ActiveState.com/Products/Komodo/ ). (Visual
Perl, a Visual Studio.NET plug-in is currently (early 2001) in beta
( http://www.ActiveState.com/Products/VisualPerl/index.html )).
-=item The Object System
-
-( http://www.castlelink.co.uk/object_system/ ) is a Perl web
-applications development IDE, apparently for any platform
-that runs Perl.
-
=item Open Perl IDE
( http://open-perl-ide.sourceforge.net/ )
@@ -279,7 +273,7 @@ specifically for programming, such as Textpad
If you are using MacOS, the same concerns apply. MacPerl
(for Classic environments) comes with a simple editor.
Popular external editors are BBEdit ( http://www.bbedit.com/ )
-or Alpha ( http://www.kelehers.org/alpha/ ). MacOS X users can
+or Alpha ( http://www.his.com/~jguyer/Alpha/Alpha8.html ). MacOS X users can
use Unix editors as well.
=over 4
@@ -338,7 +332,7 @@ The following are Win32 multilanguage editor/IDESs that support Perl:
=item Codewright
-http://www.starbase.com/
+http://www.borland.com/codewright/
=item MultiEdit
@@ -399,16 +393,22 @@ no 32k limit).
=over 4
-=item BBEdit and BBEdit Lite
+=item Affrus
-are text editors for Mac OS that have a Perl sensitivity mode
-( http://web.barebones.com/ ).
+is a full Perl development enivornment with full debugger support (
+http://www.latenightsw.com ).
=item Alpha
is an editor, written and extensible in Tcl, that nonetheless has
built in support for several popular markup and programming languages
-including Perl and HTML ( http://alpha.olm.net/ ).
+including Perl and HTML ( http://www.his.com/~jguyer/Alpha/Alpha8.html ).
+
+=item BBEdit and BBEdit Lite
+
+are text editors for Mac OS that have a Perl sensitivity mode
+( http://web.barebones.com/ ).
+
=back
@@ -454,7 +454,7 @@ to the Athena Widget set. Both are available from CPAN. See the
directory http://www.cpan.org/modules/by-category/08_User_Interfaces/
Invaluable for Perl/Tk programming are the Perl/Tk FAQ at
-http://w4.lns.cornell.edu/%7Epvhp/ptk/ptkTOC.html , the Perl/Tk Reference
+http://phaseit.net/claird/comp.lang.perl.tk/ptkFAQ.html , the Perl/Tk Reference
Guide available at
http://www.cpan.org/authors/Stephen_O_Lidie/ , and the
online manpages at
@@ -780,7 +780,7 @@ Perl install anyway.
=head2 How can I compile Perl into Java?
You can also integrate Java and Perl with the
-Perl Resource Kit from O'Reilly and Associates. See
+Perl Resource Kit from O'Reilly Media. See
http://www.oreilly.com/catalog/prkunix/ .
Perl 5.6 comes with Java Perl Lingo, or JPL. JPL, still in
diff --git a/pod/perlfaq4.pod b/pod/perlfaq4.pod
index 6a882c53ff..0e62c2b436 100644
--- a/pod/perlfaq4.pod
+++ b/pod/perlfaq4.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq4 - Data Manipulation ($Revision: 1.54 $, $Date: 2003/11/30 00:50:08 $)
+perlfaq4 - Data Manipulation ($Revision: 1.55 $, $Date: 2004/10/11 05:06:29 $)
=head1 DESCRIPTION
@@ -559,7 +559,7 @@ C<$timestamp = gmtime(1005613200)> sets $timestamp to "Tue Nov 13 01:00:00
That doesn't mean that Perl can't be used to create non-Y2K compliant
programs. It can. But so can your pencil. It's the fault of the user,
not the language. At the risk of inflaming the NRA: ``Perl doesn't
-break Y2K, people do.'' See http://language.perl.com/news/y2k.html for
+break Y2K, people do.'' See http://www.perl.org/about/y2k.html for
a longer exposition.
=head1 Data: Strings
diff --git a/pod/perlfaq5.pod b/pod/perlfaq5.pod
index 49a348a81c..ef6e32c040 100644
--- a/pod/perlfaq5.pod
+++ b/pod/perlfaq5.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq5 - Files and Formats ($Revision: 1.30 $, $Date: 2003/11/23 08:07:46 $)
+perlfaq5 - Files and Formats ($Revision: 1.31 $, $Date: 2004/02/07 04:29:50 $)
=head1 DESCRIPTION
diff --git a/pod/perlfaq6.pod b/pod/perlfaq6.pod
index 168233bd1b..d19ba36bf8 100644
--- a/pod/perlfaq6.pod
+++ b/pod/perlfaq6.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq6 - Regular Expressions ($Revision: 1.20 $, $Date: 2003/01/03 20:05:28 $)
+perlfaq6 - Regular Expressions ($Revision: 1.26 $, $Date: 2004/10/25 18:47:04 $)
=head1 DESCRIPTION
@@ -354,7 +354,7 @@ created by Jeffrey Friedl and later modified by Fred Curtis.
$/ = undef;
$_ = <>;
- s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#$2#gs
+ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $2 ? $2 : ""#gse;
print;
This could, of course, be more legibly written with the C</x> modifier, adding
@@ -395,11 +395,11 @@ whitespace and comments. Here it is expanded, courtesy of Fred Curtis.
. ## Anything other char
[^/"'\\]* ## Chars which doesn't start a comment, string or escape
)
- }{$2}gxs;
+ }{defined $2 ? $2 : ""}gxse;
A slight modification also removes C++ comments:
- s#/\*[^*]*\*+([^/*][^*]*\*+)*/|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#$2#gs;
+ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $2 ? $2 : ""#gse;
=head2 Can I use Perl regular expressions to match balanced text?
@@ -745,17 +745,17 @@ Or like this:
}
Here's another, slightly less painful, way to do it from Benjamin
-Goldberg:
+Goldberg, who uses a zero-width negative look-behind assertion.
- $martian =~ m/
- (?!<[A-Z])
- (?:[A-Z][A-Z])*?
- GX
- /x;
+ print "found GX!\n" if $martian =~ m/
+ (?<![A-Z])
+ (?:[A-Z][A-Z])*?
+ GX
+ /x;
This succeeds if the "martian" character GX is in the string, and fails
-otherwise. If you don't like using (?!<), you can replace (?!<[A-Z])
-with (?:^|[^A-Z]).
+otherwise. If you don't like using (?<!), a zero-width negative
+look-behind assertion, you can replace (?<![A-Z]) with (?:^|[^A-Z]).
It does have the drawback of putting the wrong thing in $-[0] and $+[0],
but this usually can be worked around.
diff --git a/pod/perlfaq7.pod b/pod/perlfaq7.pod
index 96d6b88d4a..e6d4e5c89e 100644
--- a/pod/perlfaq7.pod
+++ b/pod/perlfaq7.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq7 - General Perl Language Issues ($Revision: 1.15 $, $Date: 2003/07/24 02:17:21 $)
+perlfaq7 - General Perl Language Issues ($Revision: 1.17 $, $Date: 2004/10/19 22:53:50 $)
=head1 DESCRIPTION
@@ -213,7 +213,7 @@ but encourages closures.
Here's a classic function-generating function:
sub add_function_generator {
- return sub { shift + shift };
+ return sub { shift() + shift() };
}
$add_sub = add_function_generator();
@@ -232,7 +232,7 @@ value that the lexical had when the function was created.
sub make_adder {
my $addpiece = shift;
- return sub { shift + $addpiece };
+ return sub { shift() + $addpiece };
}
$f1 = make_adder(20);
diff --git a/pod/perlfaq8.pod b/pod/perlfaq8.pod
index e2cc1faa90..ad07fa3656 100644
--- a/pod/perlfaq8.pod
+++ b/pod/perlfaq8.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq8 - System Interaction ($Revision: 1.17 $, $Date: 2003/01/26 17:44:04 $)
+perlfaq8 - System Interaction ($Revision: 1.22 $, $Date: 2004/10/05 22:13:49 $)
=head1 DESCRIPTION
@@ -413,31 +413,30 @@ foregrounded process group, which you then trap in your process.
Signals are documented in L<perlipc/"Signals"> and the
section on ``Signals'' in the Camel.
-Be warned that very few C libraries are re-entrant. Therefore, if you
-attempt to print() in a handler that got invoked during another stdio
-operation your internal structures will likely be in an
-inconsistent state, and your program will dump core. You can
-sometimes avoid this by using syswrite() instead of print().
+You can set the values of the %SIG hash to be the functions you want
+to handle the signal. After perl catches the signal, it looks in %SIG
+for a key with the same name as the signal, then calls the subroutine
+value for that key.
+
+ # as an anonymous subroutine
+
+ $SIG{INT} = sub { syswrite(STDERR, "ouch\n", 5 ) };
+
+ # or a reference to a function
+
+ $SIG{INT} = \&ouch;
+
+ # or the name of the function as a string
+
+ $SIG{INT} = "ouch";
+
+Perl versions before 5.8 had in its C source code signal handlers which
+would catch the signal and possibly run a Perl function that you had set
+in %SIG. This violated the rules of signal handling at that level
+causing perl to dump core. Since version 5.8.0, perl looks at %SIG
+*after* the signal has been caught, rather than while it is being caught.
+Previous versions of this answer were incorrect.
-Unless you're exceedingly careful, the only safe things to do inside a
-signal handler are (1) set a variable and (2) exit. In the first case,
-you should only set a variable in such a way that malloc() is not
-called (eg, by setting a variable that already has a value).
-
-For example:
-
- $Interrupted = 0; # to ensure it has a value
- $SIG{INT} = sub {
- $Interrupted++;
- syswrite(STDERR, "ouch\n", 5);
- }
-
-However, because syscalls restart by default, you'll find that if
-you're in a "slow" call, such as <FH>, read(), connect(), or
-wait(), that the only way to terminate them is by "longjumping" out;
-that is, by raising an exception. See the time-out handler for a
-blocking flock() in L<perlipc/"Signals"> or the section on ``Signals''
-in the Camel book.
=head2 How do I modify the shadow password file on a Unix system?
@@ -1066,6 +1065,74 @@ sysopen():
sysopen(FH, "/foo/somefile", O_WRONLY|O_NDELAY|O_CREAT, 0644)
or die "can't open /foo/somefile: $!":
+=head2 How do I tell the difference between errors from the shell and perl?
+
+(answer contributed by brian d foy, C<< <bdfoy@cpan.org> >>
+
+When you run a Perl script, something else is running the script for you,
+and that something else may output error messages. The script might
+emit its own warnings and error messages. Most of the time you cannot
+tell who said what.
+
+You probably cannot fix the thing that runs perl, but you can change how
+perl outputs its warnings by defining a custom warning and die functions.
+
+Consider this script, which has an error you may not notice immediately.
+
+ #!/usr/locl/bin/perl
+
+ print "Hello World\n";
+
+I get an error when I run this from my shell (which happens to be
+bash). That may look like perl forgot it has a print() function,
+but my shebang line is not the path to perl, so the shell runs the
+script, and I get the error.
+
+ $ ./test
+ ./test: line 3: print: command not found
+
+A quick and dirty fix involves a little bit of code, but this may be all
+you need to figure out the problem.
+
+ #!/usr/bin/perl -w
+
+ BEGIN {
+ $SIG{__WARN__} = sub{ print STDERR "Perl: ", @_; };
+ $SIG{__DIE__} = sub{ print STDERR "Perl: ", @_; exit 1};
+ }
+
+ $a = 1 + undef;
+ $x / 0;
+ __END__
+
+The perl message comes out with "Perl" in front. The BEGIN block
+works at compile time so all of the compilation errors and warnings
+get the "Perl:" prefix too.
+
+ Perl: Useless use of division (/) in void context at ./test line 9.
+ Perl: Name "main::a" used only once: possible typo at ./test line 8.
+ Perl: Name "main::x" used only once: possible typo at ./test line 9.
+ Perl: Use of uninitialized value in addition (+) at ./test line 8.
+ Perl: Use of uninitialized value in division (/) at ./test line 9.
+ Perl: Illegal division by zero at ./test line 9.
+ Perl: Illegal division by zero at -e line 3.
+
+If I don't see that "Perl:", it's not from perl.
+
+You could also just know all the perl errors, and although there are
+some people who may know all of them, you probably don't. However, they
+all should be in the perldiag manpage. If you don't find the error in
+there, it probably isn't a perl error.
+
+Looking up every message is not the easiest way, so let perl to do it
+for you. Use the diagnostics pragma with turns perl's normal messages
+into longer discussions on the topic.
+
+ use diagnostics;
+
+If you don't get a paragraph or two of expanded discussion, it
+might not be perl's message.
+
=head2 How do I install a module from CPAN?
The easiest way is to have a module also named CPAN do it for you.
diff --git a/pod/perlfaq9.pod b/pod/perlfaq9.pod
index f73c619b98..fa59003d10 100644
--- a/pod/perlfaq9.pod
+++ b/pod/perlfaq9.pod
@@ -1,6 +1,6 @@
=head1 NAME
-perlfaq9 - Networking ($Revision: 1.15 $, $Date: 2003/01/31 17:36:57 $)
+perlfaq9 - Networking ($Revision: 1.16 $, $Date: 2004/10/30 12:20:59 $)
=head1 DESCRIPTION
@@ -383,7 +383,7 @@ a database, send mail, or purchase a computer).
You can't, at least, not in real time. Bummer, eh?
Without sending mail to the address and seeing whether there's a human
-on the other hand to answer you, you cannot determine whether a mail
+on the other end to answer you, you cannot determine whether a mail
address is valid. Even if you apply the mail header standard, you
can have problems, because there are deliverable addresses that aren't
RFC-822 (the mail header standard) compliant, and addresses that aren't