This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Mon, 2 Jan 2006 19:40:28 +0000 (19:40 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 2 Jan 2006 19:40:28 +0000 (19:40 +0000)
[ 25233]
Sync change 25229 to .h source files

[ 25513]
Resolve [perl #37110]: Update README.win32

I give up trying to keep the Platform SDK links up-to-date. They seem
to have changed every time that I look at them, so make the
instructions more general.

[ 25523]
Yitzchak says that Tim says that we can distribute
the perl glossary under the same terms as Perl itself.

[ 25623]
Clarify what -MFoo=number does on the command-line

[ 25624]
POD nit by Yitzchak

[ 25625]
Comment nit by Vadim Konovalov
And while we're at it, reindent consistently.

[ 25678]
Clarify the documentation regarding the return value from C<push>.

[ 25691]
Fixes to Pod errors found by podchecker.

[ 25712]
Documentation nit in INSTALL found by Alan Burlison.

[ 25745]
Document that -F doesn't accept whitespace in patterns.
(fixes bug #37366)

[ 25777]
Doc/style fixes pointed out by Gisle

[ 25780]
Subject: Re: small addition to $, and $\ in perlvar.pod
From: Xavier Noria <fxn@hashref.com>
Date: Sun, 16 Oct 2005 12:27:30 +0200
Message-Id: <7CA83392-70CD-4AC8-AA44-D94F508BB028@hashref.com>

[ 25809]
Fix doc typo, by Gisle Aas

[ 25812]
Subject: Re: [PATCH] return values reworded in perlsub.pod
From: Xavier Noria <fxn@hashref.com>
Date: Fri, 21 Oct 2005 08:43:12 +0200
Message-Id: <1C8D7C5C-986C-4336-8C4F-8B965CE1AD17@hashref.com>

(with minor tweaks)

[ 25816]
Rewording of doc change #25812

[ 25820]
Documentation on getting a FORMAT ref from a GLOB was missing from
perlref.pod.  Thanks for David Wheeler for starting the discussion
and Paul Johnson for confirming that it could actually be done.

[ 25830]
Fix path in code example

[ 25857]
FAQ sync.

[ 25868]
Subject: [PATCH] perl5db.pl incorrect instructions in termination message
From: Brendan O'Dea <bod@debian.org>
Date: Sat, 29 Oct 2005 07:14:40 +1000
Message-ID: <20051028211440.GA23305@londo.c47.org>

[ 25887]
Subject: Re: [PATCH] predecrement vs postdecrement
From: Jarkko Hietaniemi <jhietaniemi@gmail.com>
Date: Sat, 29 Oct 2005 23:24:33 +0300
Message-ID: <4363DA81.6060600@gmail.com>

Nit in pod/perlhack.pod

[ 25894]
Fix typo in comment.

[ 25902]
Fix typos in comments.

[ 25912]
Robin Houston remarks that mention of a context is missing from the
threads.pm documentation.
p4raw-link: @25912 on //depot/perl: 16c6ee180818f1aed72b8e6ad2e7d9c44be8216f
p4raw-link: @25902 on //depot/perl: e3e4599ff44c1df42108810b2a899156903b540a
p4raw-link: @25894 on //depot/perl: 4a31713e65b514c8128b1b5004c0f6d73a80aec3
p4raw-link: @25887 on //depot/perl: 60a57c1cb96720ff157e8911ca10ada9c0a3c97e
p4raw-link: @25868 on //depot/perl: 6b27b0a01f1113e5e831a7896f1e08800942f3e5
p4raw-link: @25857 on //depot/perl: 9e72e4c611b0297cb770c791d72e9d74b901d604
p4raw-link: @25830 on //depot/perl: 6c567752fa0e804487ec72fcd915dfc0ae41e39f
p4raw-link: @25820 on //depot/perl: c0bd1adcfa702f7d9a93bc9b7c4b3e9adf29fe4a
p4raw-link: @25816 on //depot/perl: 9a9897716602799978192865b19161f65ea040c1
p4raw-link: @25812 on //depot/perl: dbb128be9d98f2152d3ce957d4c3c518a9f86260
p4raw-link: @25809 on //depot/perl: e51e835724b3f195406eacba91483ce44609510e
p4raw-link: @25780 on //depot/perl: d6584ed888482007614ade158c6741c0c11763fd
p4raw-link: @25777 on //depot/perl: 5ca7f68ddac45dcdfd991dcc23e59792a9900482
p4raw-link: @25745 on //depot/perl: d52fe7da486fd032a82c29ee467dd8504f394b88
p4raw-link: @25712 on //depot/perl: 779ec47719855ab60e913a3e26cf358bbda748ab
p4raw-link: @25691 on //depot/perl: 5f0135ebccd6cdb2441aabb64baa39aea87199d3
p4raw-link: @25678 on //depot/perl: cde9c2113453df62687a8b4e5904da70e91f3a36
p4raw-link: @25625 on //depot/perl: 14b1a0c4873dd26867581787ac2b4ee054e3b2a1
p4raw-link: @25624 on //depot/perl: 362eead3a268d127e89be572afb78c2557c1c3ad
p4raw-link: @25623 on //depot/perl: 642d0c2f60eb696d18d53486a98f0b8807f335a2
p4raw-link: @25523 on //depot/perl: 20fd23efee32fd4dc6fa842669b5cae4a592f9b2
p4raw-link: @25513 on //depot/perl: 1b4f03596832a66e98636ba69b9c0cfd65114918
p4raw-link: @25233 on //depot/perl: eeb8d49e03ea8546042df7d6382f30f100395536

p4raw-id: //depot/maint-5.8/perl@26582
p4raw-integrated: from //depot/perl@26577 'copy in' lib/User/grent.pm
(@12113..) lib/warnings/register.pm (@12185..) t/io/crlf.t
(@22998..) lib/perl5db.pl (@25261..) pod/perlglossary.pod
(@25274..) pod/perlfaq2.pod (@25301..) ext/threads/threads.pm
(@25307..) 'merge in' README.os2 (@22032..) cv.h (@24617..)
pad.h (@25042..) pod/perlvar.pod (@25324..) pod/perlfaq6.pod
pod/perlref.pod (@25748..)
p4raw-integrated: from //depot/perl@25902 'merge in' utf8.c (@25866..)
p4raw-integrated: from //depot/perl@25894 'merge in' hv.c (@25803..)
p4raw-integrated: from //depot/perl@25887 'merge in' pod/perlhack.pod
(@25260..)
p4raw-integrated: from //depot/perl@25857 'copy in' pod/perlfaq.pod
pod/perlfaq3.pod pod/perlfaq4.pod pod/perlfaq7.pod
pod/perlfaq9.pod (@25301..) 'merge in' pod/perlfaq5.pod
(@25748..)
p4raw-integrated: from //depot/perl@25830 'edit in' pod/perlfunc.pod
(@25748..)
p4raw-integrated: from //depot/perl@25812 'edit in' pod/perlsub.pod
(@25748..)
p4raw-integrated: from //depot/perl@25712 'merge in' INSTALL (@25015..)
p4raw-integrated: from //depot/perl@25623 'edit in' pod/perlrun.pod
(@24864..)
p4raw-integrated: from //depot/perl@25513 'merge in' README.win32
(@24868..)

27 files changed:
INSTALL
README.os2
README.win32
cv.h
ext/threads/threads.pm
hv.c
lib/User/grent.pm
lib/perl5db.pl
lib/warnings/register.pm
pad.h
pod/perlfaq.pod
pod/perlfaq2.pod
pod/perlfaq3.pod
pod/perlfaq4.pod
pod/perlfaq5.pod
pod/perlfaq6.pod
pod/perlfaq7.pod
pod/perlfaq9.pod
pod/perlfunc.pod
pod/perlglossary.pod
pod/perlhack.pod
pod/perlref.pod
pod/perlrun.pod
pod/perlsub.pod
pod/perlvar.pod
t/io/crlf.t
utf8.c

diff --git a/INSTALL b/INSTALL
index aac641e..e229bcf 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -666,7 +666,7 @@ to avoid these leaks. The default is now to perform direct manipulation
 whenever perl is running as a stand alone interpreter, and to call the safe
 but potentially leaky C<putenv()> function when the perl interpreter is
 embedded in another application. You can force perl to always use C<putenv()>
-by compiling with -DPERL_USE_SAVE_PUTENV. You can force an embedded perl to
+by compiling with -DPERL_USE_SAFE_PUTENV. You can force an embedded perl to
 use direct manipulation by setting C<PL_use_safe_putenv = 0;> after the
 C<perl_construct()> call.
 
index e9379bb..347f873 100644 (file)
@@ -2205,7 +2205,7 @@ in the I<default> behaviour.  One can start I<any> executable in
 I<any> kind of session by using the arguments C</fs>, C</pm> or
 C</win> switches of the command C<start> (of F<CMD.EXE> or a similar
 shell).  Alternatively, one can use the numeric first argument of the
-C<system> Perl function (see L<C<OS2::Process>>).
+C<system> Perl function (see L<OS2::Process>).
 
 =head2 F<perl___.exe>
 
index 43a3a4b..2ea7bec 100644 (file)
@@ -147,18 +147,14 @@ Framework Redistributable" to be installed first.  This can be downloaded and
 installed separately, but is included in the "Visual C++ Toolkit 2003" anyway.
 
 These packages can all be downloaded by searching in the Download Center at
-http://www.microsoft.com/downloads/search.aspx?displaylang=en
-
-The Platform SDK packages can also be obtained from the Platform SDK Update
-site: http://www.microsoft.com/msdownload/platformsdk/sdkupdate  Note that this
-site requires Internet Explorer 5.0 or later to function, but the site's home
-page currently gives links to two download pages for users of other browsers:
-
-For Windows XP Service Pack 2:
-http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
-
-For Windows Server 2003:
-http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
+http://www.microsoft.com/downloads/search.aspx?displaylang=en.  (Providing exact
+links to these packages has proven a pointless task because the links keep on
+changing so often.)
+
+Try to obtain the latest version of the Platform SDK.  Sometimes these packages
+contain a particular Windows OS version in their name, but actually work on
+other OS versions too.  For example, the "Windows Server 2003 SP1 Platform SDK"
+also runs on Windows XP SP2 and Windows 2000.
 
 According to the download pages the Toolkit and the .NET Framework SDK are only
 supported on Windows 2000/XP/2003, so trying to use these tools on Windows
diff --git a/cv.h b/cv.h
index 48687bf..dd54d00 100644 (file)
--- a/cv.h
+++ b/cv.h
@@ -170,7 +170,7 @@ C<CvWEAKOUTSIDE> flag in the child. This allows us to determine under what
 circumstances we should decrement the refcount of the parent when freeing
 the child.
 
-There is a further complication with non-closure anonymous subs (ie those
+There is a further complication with non-closure anonymous subs (i.e. those
 that do not refer to any lexicals outside that sub). In this case, the
 anonymous prototype is shared rather than being cloned. This has the
 consequence that the parent may be freed while there are still active
index c320d1c..ef66eb2 100755 (executable)
@@ -148,7 +148,7 @@ This will wait for the corresponding thread to join. When the thread
 finishes, join() will return the return values of the entry point
 function. If the thread has been detached, an error will be thrown.
 
-The context (scalar or list) of the thread creation is also the
+The context (void, scalar or list) of the thread creation is also the
 context for join().  This means that if you intend to return an array
 from a thread, you must use C<my ($thread) = threads->new(...)>, and
 that if you intend to return a scalar, you must use C<my $thread = ...>.
@@ -241,7 +241,7 @@ On some platforms it might not be possible to destroy "parent"
 threads while there are still existing child "threads".
 
 This will possibly be fixed in later versions of perl.
-  
+
 =item tid is I32
 
 The thread id is a 32 bit integer, it can potentially overflow.
diff --git a/hv.c b/hv.c
index 1519bd9..c7a2f17 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -107,7 +107,7 @@ S_save_hek_flags(pTHX_ const char *str, I32 len, U32 hash, int flags)
     return hek;
 }
 
-/* free the pool of temporary HE/HEK pairs retunrned by hv_fetch_ent
+/* free the pool of temporary HE/HEK pairs returned by hv_fetch_ent
  * for tied hashes */
 
 void
index d9581d8..97a5495 100644 (file)
@@ -51,7 +51,7 @@ User::grent - by-name interface to Perl's built-in getgr*() functions
      print "gid zero name wheel, with other members";
  } 
 
- use User::grent qw(:FIELDS;
+ use User::grent qw(:FIELDS);
  getgrgid(0) or die "No group zero";
  if ( $gr_name eq 'wheel' && @gr_members > 1 ) {
      print "gid zero name wheel, with other members";
index e783ef5..b4edc83 100644 (file)
@@ -2034,8 +2034,8 @@ to enter commands and have a valid context to be in.
             $term || &setterm;
             print_help(<<EOP);
 Debugged program terminated.  Use B<q> to quit or B<R> to restart,
-  use B<O> I<inhibit_exit> to avoid stopping after program termination,
-  B<h q>, B<h R> or B<h O> to get additional info.  
+  use B<o> I<inhibit_exit> to avoid stopping after program termination,
+  B<h q>, B<h R> or B<h o> to get additional info.  
 EOP
 
             # Set the DB::eval context appropriately.
index c5dc199..d07e464 100644 (file)
@@ -1,4 +1,4 @@
-package warnings::register ;
+package warnings::register;
 
 our $VERSION = '1.00';
 
@@ -10,42 +10,42 @@ warnings::register - warnings import function
 
 =head1 SYNOPSIS
 
-    use warnings::register ;
+    use warnings::register;
 
 =head1 DESCRIPTION
 
-Create a warnings category with the same name as the current package.
-
-See L<perlmodlib/Pragmatic Modules> and L<perllexwarn>.
+Creates a warnings category with the same name as the current package.
 
+See L<warnings> and L<perllexwarn> for more information on this module's
+usage.
 
 =cut
 
-require warnings ;
+require warnings;
 
 sub mkMask
 {
-    my ($bit) = @_ ;
-    my $mask = "" ;
+    my ($bit) = @_;
+    my $mask = "";
 
-    vec($mask, $bit, 1) = 1 ;
-    return $mask ;
+    vec($mask, $bit, 1) = 1;
+    return $mask;
 }
 
 sub import
 {
-    shift ;
-    my $package = (caller(0))[0] ;
+    shift;
+    my $package = (caller(0))[0];
     if (! defined $warnings::Bits{$package}) {
-        $warnings::Bits{$package}     = mkMask($warnings::LAST_BIT) ;
-        vec($warnings::Bits{'all'}, $warnings::LAST_BIT, 1) = 1 ;
-        $warnings::Offsets{$package}  = $warnings::LAST_BIT ++ ;
+        $warnings::Bits{$package}     = mkMask($warnings::LAST_BIT);
+        vec($warnings::Bits{'all'}, $warnings::LAST_BIT, 1) = 1;
+        $warnings::Offsets{$package}  = $warnings::LAST_BIT ++;
        foreach my $k (keys %warnings::Bits) {
-           vec($warnings::Bits{$k}, $warnings::LAST_BIT, 1) = 0 ;
+           vec($warnings::Bits{$k}, $warnings::LAST_BIT, 1) = 0;
        }
         $warnings::DeadBits{$package} = mkMask($warnings::LAST_BIT);
-        vec($warnings::DeadBits{'all'}, $warnings::LAST_BIT++, 1) = 1 ;
+        vec($warnings::DeadBits{'all'}, $warnings::LAST_BIT++, 1) = 1;
     }
 }
 
-1 ;
+1;
diff --git a/pad.h b/pad.h
index cb634e3..fbd809f 100644 (file)
--- a/pad.h
+++ b/pad.h
@@ -77,7 +77,7 @@ Save a pad slot (used to restore after an iteration)
 
 XXX DAPM it would make more sense to make the arg a PADOFFSET
 =for apidoc m|void|SAVECLEARSV |SV **svp
-Clear the pointed to pad value on scope exit. (ie the runtime action of 'my')
+Clear the pointed to pad value on scope exit. (i.e. the runtime action of 'my')
 
 =for apidoc m|void|SAVECOMPPAD
 save PL_comppad and PL_curpad
index 1e02381..e657fde 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq - frequently asked questions about Perl ($Date: 2005/08/10 16:01:17 $)
+perlfaq - frequently asked questions about Perl ($Revision: 1.26 $, $Date: 2005/10/13 19:50:54 $)
 
 =head1 DESCRIPTION
 
@@ -45,7 +45,7 @@ Several people have contributed answers, corrections, and comments.
 
 =head1 Author and Copyright Information
 
-Copyright (c) 1997-2003 Tom Christiansen, Nathan Torkington, and 
+Copyright (c) 1997-2005 Tom Christiansen, Nathan Torkington, and 
 other contributors noted in the answers.
 
 All rights reserved.
index 34d4825..0fd1d26 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.34 $, $Date: 2005/08/10 15:56:54 $)
+perlfaq2 - Obtaining and Learning about Perl ($Revision: 1.35 $, $Date: 2005/10/13 19:43:13 $)
 
 =head1 DESCRIPTION
 
@@ -149,9 +149,8 @@ You might also try C<perldoc perl> in case your system doesn't
 have a proper man command, or it's been misinstalled.  If that doesn't
 work, try looking in /usr/local/lib/perl5/pod for documentation.
 
-If all else fails, consult http://perldoc.cpan.org/ or
-http://www.perldoc.com/ both offer the complete documentation
-in html format.
+If all else fails, consult http://perldoc.perl.org/ which has the
+complete documentation in HTML and PDF format.
 
 Many good books have been written about Perl--see the section below
 for more details.
@@ -162,11 +161,9 @@ approach to objects, L<perlopentut> for file opening semantics,
 L<perlreftut> for managing references, L<perlretut> for regular
 expressions, L<perlthrtut> for threads, L<perldebtut> for debugging,
 and L<perlxstut> for linking C and Perl together.  There may be more
-by the time you read this.  The following URLs might also be of
-assistance:
+by the time you read this.  These URLs might also be useful:
 
-    http://perldoc.cpan.org/
-    http://www.perldoc.com/
+    http://perldoc.perl.org/
     http://bookmarks.cpan.org/search.cgi?cat=Training%2FTutorials
 
 =head2 What are the Perl newsgroups on Usenet?  Where do I post questions?
@@ -221,10 +218,11 @@ This is faster and more productive than just posting a request.
 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/ .
+http://books.perl.org/ . If you don't see your book listed here, you
+can write to perlfaq-workers@perl.org .
 
 The incontestably definitive reference book on Perl, written by
-the creator of Perl, is now (Sept 2004) in its third edition:
+the creator of Perl, is Programming Perl:
 
        Programming Perl (the "Camel Book"):
        by Larry Wall, Tom Christiansen, and Jon Orwant
@@ -242,13 +240,13 @@ of real-world examples, mini-tutorials, and complete programs is:
        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
+suffice for you to learn Perl.  If you're not, check out 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/
+       Learning Perl
+       by Randal L. Schwartz, Tom Phoenix, and brian d foy
+       ISBN 0-596-10105-8 [4th edition July 2005]
+       http://www.oreilly.com/catalog/learnperl4/
 
 And for more advanced information on writing larger programs,
 presented in the same style as the Llama book, continue your education
@@ -306,11 +304,6 @@ Recommended books on (or mostly on) Perl follow.
        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
-       ISBN 1-56592-286-7 [1st edition December 1998]
-       http://www.oreilly.com/catalog/perlnut/
-
 =item Tutorials
 
        Beginning Perl
@@ -324,38 +317,15 @@ Recommended books on (or mostly on) Perl follow.
        http://www.manning.com/Johnson/
 
        Learning Perl
-       by Randal L. Schwartz and Tom Phoenix
-       ISBN 0-596-00132-0 [3rd edition July 2001]
-       http://www.oreilly.com/catalog/lperl3/
+       by Randal L. Schwartz, Tom Phoenix, and brian d foy
+       ISBN 0-596-10105-8 [4th edition July 2005]
+       http://www.oreilly.com/catalog/learnperl4/
 
        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
-       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
-       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)
-
-       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
-       by Vicki Brown and Chris Nandor,
-           with foreword by Matthias Neeracher
-       ISBN 1-881957-32-2 [1st edition May 1998]
-       http://www.macperl.com/ptf_book/
-
 =item Task-Oriented
 
        Writing Perl Modules for CPAN
index b5f3562..67a8d43 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq3 - Programming Tools ($Revision: 1.51 $, $Date: 2005/08/10 15:56:39 $)
+perlfaq3 - Programming Tools ($Revision: 1.52 $, $Date: 2005/10/13 19:43:13 $)
 
 =head1 DESCRIPTION
 
@@ -47,7 +47,7 @@ shell that combines the interactive nature of a Unix shell with the
 power of Perl. The goal is a full featured shell that behaves as
 expected for normal shell activity and uses Perl syntax and
 functionality for control-flow statements and other things.
-You can get psh at http://www.focusresearch.com/gregor/psh/ .
+You can get psh at http://sourceforge.net/projects/psh/ .
 
 Zoidberg is a similar project and provides a shell written in perl,
 configured in perl and operated in perl. It is intended as a login shell
@@ -772,30 +772,26 @@ You probably won't see much of a speed increase either, since most
 solutions simply bundle a Perl interpreter in the final product
 (but see L<How can I make my Perl program run faster?>).
 
-The Perl Archive Toolkit (http://par.perl.org/index.cgi) is
-Perl's analog to Java's JAR.  It's freely available and on
-CPAN (http://search.cpan.org/dist/PAR/).
+The Perl Archive Toolkit ( http://par.perl.org/index.cgi ) is Perl's
+analog to Java's JAR.  It's freely available and on CPAN (
+http://search.cpan.org/dist/PAR/ ).
 
-The B::* namespace, often called "the Perl compiler", but is really a
-way for Perl programs to peek at its innards rather than create
-pre-compiled versions of your program.  However. the B::Bytecode
-module can turn your script  into a bytecode format that could be
-loaded later by the ByteLoader module and executed as a regular Perl
-script.
+The B::* namespace, often called "the Perl compiler", but is really a way
+for Perl programs to peek at its innards rather than create pre-compiled
+versions of your program.  However. the B::Bytecode module can turn your
+script  into a bytecode format that could be loaded later by the
+ByteLoader module and executed as a regular Perl script.
 
-There are also some commercial products that may work for
-you, although you have to buy a license for them.
+There are also some commercial products that may work for you, although
+you have to buy a license for them.
 
-The Perl Dev Kit
-(http://www.activestate.com/Products/Perl_Dev_Kit/) from
-ActiveState can "Turn your Perl programs into ready-to-run
+The Perl Dev Kit ( http://www.activestate.com/Products/Perl_Dev_Kit/ )
+from ActiveState can "Turn your Perl programs into ready-to-run
 executables for HP-UX, Linux, Solaris and Windows."
 
-Perl2Exe (http://www.indigostar.com/perl2exe.htm) is a
-command line program for converting perl scripts to
-executable files.  It targets both Windows and unix
-platforms.
-
+Perl2Exe ( http://www.indigostar.com/perl2exe.htm ) is a command line
+program for converting perl scripts to executable files.  It targets both
+Windows and unix platforms.
 
 =head2 How can I compile Perl into Java?
 
@@ -923,12 +919,11 @@ guides and references in L<perlfaq9> or in the CGI MetaFAQ:
 
 A good place to start is L<perltoot>, and you can use L<perlobj>,
 L<perlboot>, L<perltoot>, L<perltooc>, and L<perlbot> for reference.
-(If you are using really old Perl, you may not have all of these,
-try http://www.perldoc.com/ , but consider upgrading your perl.)
 
 A good book on OO on Perl is the "Object-Oriented Perl"
-by Damian Conway from Manning Publications,
-http://www.manning.com/Conway/index.html
+by Damian Conway from Manning Publications, or "Learning Perl
+References, Objects, & Modules" by Randal Schwartz and Tom
+Phoenix from O'Reilly Media.
 
 =head2 Where can I learn about linking C with Perl?
 
index 876ef78..179681b 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq4 - Data Manipulation ($Revision: 1.67 $, $Date: 2005/08/10 15:55:49 $)
+perlfaq4 - Data Manipulation ($Revision: 1.69 $, $Date: 2005/10/14 15:34:06 $)
 
 =head1 DESCRIPTION
 
@@ -1212,6 +1212,8 @@ same thing.
 
 =head2 How can I tell whether a certain element is contained in a list or array?
 
+(portions of this answer contributed by Anno Siegel)
+
 Hearing the word "in" is an I<in>dication that you probably should have
 used a hash, not a list or array, to store your data.  Hashes are
 designed to answer this question quickly and efficiently.  Arrays aren't.
@@ -1247,28 +1249,35 @@ quite a lot of space by using bit strings instead:
 
 Now check whether C<vec($read,$n,1)> is true for some C<$n>.
 
-Please do not use
+These methods guarantee fast individual tests but require a re-organization
+of the original list or array.  They only pay off if you have to test
+multiple values against the same array.
 
-    ($is_there) = grep $_ eq $whatever, @array;
+If you are testing only once, the standard module List::Util exports
+the function C<first> for this purpose.  It works by stopping once it
+finds the element. It's written in C for speed, and its Perl equivalant
+looks like this subroutine:
 
-or worse yet
+       sub first (&@) {
+               my $code = shift;
+               foreach (@_) {
+                       return $_ if &{$code}();
+               }
+               undef;
+       }
 
-    ($is_there) = grep /$whatever/, @array;
+If speed is of little concern, the common idiom uses grep in scalar context
+(which returns the number of items that passed its condition) to traverse the
+entire list. This does have the benefit of telling you how many matches it
+found, though.
 
-These are slow (checks every element even if the first matches),
-inefficient (same reason), and potentially buggy (what if there are
-regex characters in $whatever?).  If you're only testing once, then
-use:
+       my $is_there = grep $_ eq $whatever, @array;
 
-    $is_there = 0;
-    foreach $elt (@array) {
-       if ($elt eq $elt_to_find) {
-           $is_there = 1;
-           last;
-       }
-    }
-    if ($is_there) { ... }
+If you want to actually extract the matching elements, simply use grep in
+list context.
 
+       my @matches = grep $_ eq $whatever, @array;
+       
 =head2 How do I compute the difference of two arrays?  How do I compute the intersection of two arrays?
 
 Use a hash.  Here's code to do both and more.  It assumes that
@@ -1982,8 +1991,18 @@ in L<perltoot>.
 
 =head2 How can I use a reference as a hash key?
 
-You can't do this directly, but you could use the standard Tie::RefHash
-module distributed with Perl.
+(contributed by brian d foy)
+
+Hash keys are strings, so you can't really use a reference as the key.
+When you try to do that, perl turns the reference into its stringified
+form (for instance, C<HASH(0xDEADBEEF)>). From there you can't get back
+the reference from the stringified form, at least without doing some
+extra work on your own. Also remember that hash keys must be unique, but
+two different variables can store the same reference (and those variables
+can change later).
+
+The Tie::RefHash module, which is distributed with perl, might be what
+you want. It handles that extra work.
 
 =head1 Data: Misc
 
index 85f1c54..c53f5af 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq5 - Files and Formats ($Revision: 1.37 $, $Date: 2005/08/10 15:55:23 $)
+perlfaq5 - Files and Formats ($Revision: 1.38 $, $Date: 2005/10/13 19:49:13 $)
 
 =head1 DESCRIPTION
 
index ed0bc29..fe386ec 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq6 - Regular Expressions ($Revision: 1.35 $, $Date: 2005/08/10 15:55:08 $)
+perlfaq6 - Regular Expressions ($Revision: 1.36 $, $Date: 2005/10/13 19:49:13 $)
 
 =head1 DESCRIPTION
 
index 2dd24a4..cca3b17 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq7 - General Perl Language Issues ($Revision: 1.25 $, $Date: 2005/08/08 02:38:25 $)
+perlfaq7 - General Perl Language Issues ($Revision: 1.26 $, $Date: 2005/10/13 19:43:13 $)
 
 =head1 DESCRIPTION
 
@@ -271,24 +271,40 @@ $line back in its caller's scope.
 
 =head2 What is variable suicide and how can I prevent it?
 
-Variable suicide is when you (temporarily or permanently) lose the
-value of a variable.  It is caused by scoping through my() and local()
-interacting with either closures or aliased foreach() iterator
-variables and subroutine arguments.  It used to be easy to
-inadvertently lose a variable's value this way, but now it's much
-harder.  Take this code:
+This problem was fixed in perl 5.004_05, so preventing it means upgrading
+your version of perl. ;)
 
-    my $f = "foo";
+Variable suicide is when you (temporarily or permanently) lose the value
+of a variable.  It is caused by scoping through my() and local()
+interacting with either closures or aliased foreach() iterator variables
+and subroutine arguments.  It used to be easy to inadvertently lose a
+variable's value this way, but now it's much harder.  Take this code:
+
+    my $f = 'foo';
     sub T {
-      while ($i++ < 3) { my $f = $f; $f .= "bar"; print $f, "\n" }
+      while ($i++ < 3) { my $f = $f; $f .= $i; print $f, "\n" }
     }
     T;
     print "Finally $f\n";
 
+If you are experiencing variable suicide, that C<my $f> in the subroutine
+doesn't pick up a fresh copy of the C<$f> whose value is <foo>. The output
+shows that inside the subroutine the value of C<$f> leaks through when it
+shouldn't, as in this output:
+
+       foobar
+       foobarbar
+       foobarbarbar
+       Finally foo
+
 The $f that has "bar" added to it three times should be a new C<$f>
-(C<my $f> should create a new local variable each time through the loop).
-It isn't, however.  This was a bug, now fixed in the latest releases
-(tested against 5.004_05, 5.005_03, and 5.005_56).
+C<my $f> should create a new lexical variable each time through the loop.
+The expected output is:
+
+       foobar
+       foobar
+       foobar
+       Finally foo
 
 =head2 How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}?
 
index 336d22d..577d151 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-perlfaq9 - Networking ($Revision: 1.23 $, $Date: 2005/08/10 15:54:54 $)
+perlfaq9 - Networking ($Revision: 1.24 $, $Date: 2005/10/13 19:43:13 $)
 
 =head1 DESCRIPTION
 
@@ -366,9 +366,9 @@ C<param()> function.
 
        use CGI qw(:standard);
 
-       my $total = param( "price" ) + param( "shipping" );
+       my $total = param( 'price' ) + param( 'shipping' );
 
-       my @items = param( "item ); # multiple values, same field name
+       my @items = param( 'item' ); # multiple values, same field name
 
 If you want an object-oriented approach, CGI.pm can do that too.
 
@@ -376,9 +376,9 @@ If you want an object-oriented approach, CGI.pm can do that too.
 
        my $cgi = CGI->new();
 
-       my $total = $cgi->param( "price" ) + $cgi->param( "shipping" );
+       my $total = $cgi->param( 'price' ) + $cgi->param( 'shipping' );
 
-       my @items = $cgi->param( "item" );
+       my @items = $cgi->param( 'item' );
 
 You might also try CGI::Minimal which is a lightweight version
 of the same thing.  Other CGI::* modules on CPAN might work better
index ab13257..c817f4b 100644 (file)
@@ -2349,7 +2349,7 @@ functions will serve you better than will int().
 
 Implements the ioctl(2) function.  You'll probably first have to say
 
-    require "sys/ioctl.ph";    # probably in $Config{archlib}/ioctl.ph
+    require "sys/ioctl.ph";    # probably in $Config{archlib}/sys/ioctl.ph
 
 to get the correct function definitions.  If F<sys/ioctl.ph> doesn't
 exist or doesn't have the correct definitions you'll have to roll your
@@ -3898,7 +3898,8 @@ LIST.  Has the same effect as
        $ARRAY[++$#ARRAY] = $value;
     }
 
-but is more efficient.  Returns the new number of elements in the array.
+but is more efficient.  Returns the number of elements in the array following
+the completed C<push>.
 
 =item q/STRING/
 
@@ -4169,10 +4170,10 @@ version should be used instead.
     require 5.6.1;     # ditto
     require 5.006_001; # ditto; preferred for backwards compatibility
 
-Otherwise, C<ref> demands that a library file be included if it hasn't already
-been included.  The file is included via the do-FILE mechanism, which is
-essentially just a variety of C<eval>.  Has semantics similar to the
-following subroutine:
+Otherwise, C<require> demands that a library file be included if it
+hasn't already been included.  The file is included via the do-FILE
+mechanism, which is essentially just a variety of C<eval>.  Has
+semantics similar to the following subroutine:
 
     sub require {
        my ($filename) = @_;
index 24679c9..b274440 100644 (file)
@@ -3380,4 +3380,4 @@ administrator will Not Be Happy with you.
 Based on the Glossary of Programming Perl, Third Edition,
 by Larry Wall, Tom Christiansen & Jon Orwant.
 Copyright (c) 2000, 1996, 1991 O'Reilly Media, Inc.
-Used with permission.
+This document may be distributed under the same terms as Perl itself.
index 656654b..51ddb28 100644 (file)
@@ -2082,7 +2082,7 @@ F<testname.valgrind>.
 
 (Only in Tru64)  Run all the tests using the memory leak + naughty
 memory access tool "Third Degree".  The log files will be named
-F<perl3.log.testname>.
+F<perl.3log.testname>.
 
 =item test.torture torturetest
 
index 942e696..9b33a96 100644 (file)
@@ -238,6 +238,7 @@ known as foo).
     $coderef   = *handler{CODE};
     $ioref     = *STDIN{IO};
     $globref   = *foo{GLOB};
+    $formatref = *foo{FORMAT};
 
 All of these are self-explanatory except for C<*foo{IO}>.  It returns
 the IO handle, used for file handles (L<perlfunc/open>), sockets
index 3f5601c..310a2fc 100644 (file)
@@ -435,7 +435,7 @@ modules in non-standard locations.
 
 specifies the pattern to split on if B<-a> is also in effect.  The
 pattern may be surrounded by C<//>, C<"">, or C<''>, otherwise it will be
-put in single quotes.
+put in single quotes. You can't use literal whitespace in the pattern.
 
 =item B<-h>
 
@@ -604,6 +604,10 @@ importing symbols.  The actual code generated by B<-Mmodule=foo,bar> is
 C<use module split(/,/,q{foo,bar})>.  Note that the C<=> form
 removes the distinction between B<-m> and B<-M>.
 
+A consequence of this is that B<-MFoo=number> never does a version check
+(unless C<Foo::import()> itself is set up to do a version check, which
+could happen for example if Foo inherits from Exporter.)
+
 =item B<-n>
 
 causes Perl to assume the following loop around your program, which
index 1a9b145..983e468 100644 (file)
@@ -66,16 +66,19 @@ created the element whether or not the element was assigned to.)
 Assigning to the whole array C<@_> removes that aliasing, and does
 not update any arguments.
 
-The return value of a subroutine is the value of the last expression
-evaluated by that sub, or the empty list in the case of an empty sub.
-More explicitly, a C<return> statement may be used to exit the
-subroutine, optionally specifying the returned value, which will be
-evaluated in the appropriate context (list, scalar, or void) depending
-on the context of the subroutine call.  If you specify no return value,
-the subroutine returns an empty list in list context, the undefined
-value in scalar context, or nothing in void context.  If you return
-one or more aggregates (arrays and hashes), these will be flattened
-together into one large indistinguishable list.
+A C<return> statement may be used to exit a subroutine, optionally
+specifying the returned value, which will be evaluated in the
+appropriate context (list, scalar, or void) depending on the context of
+the subroutine call.  If you specify no return value, the subroutine
+returns an empty list in list context, the undefined value in scalar
+context, or nothing in void context.  If you return one or more
+aggregates (arrays and hashes), these will be flattened together into
+one large indistinguishable list.
+
+If no C<return> is found and if the last statement is an expression, its
+value is returned. If the last statement is a loop control structure
+like a C<foreach> or a C<while>, the returned value is unspecified. The
+empty sub returns the empty list.
 
 Perl does not have named formal parameters.  In practice all you
 do is assign to a C<my()> list of these.  Variables that aren't
index ba2b4bd..1c8cfdc 100644 (file)
@@ -424,12 +424,9 @@ for that.  (Mnemonic: when you want your pipes to be piping hot.)
 
 =item $,
 
-The output field separator for the print operator.  Ordinarily the
-print operator simply prints out its arguments without further
-adornment.  To get behavior more like B<awk>, set this variable as
-you would set B<awk>'s OFS variable to specify what is printed
-between fields.  (Mnemonic: what is printed when there is a "," in
-your print statement.)
+The output field separator for the print operator.  If defined, this
+value is printed between each of print's arguments.  Default is C<undef>.
+(Mnemonic: what is printed when there is a "," in your print statement.)
 
 =item IO::Handle->output_record_separator EXPR
 
@@ -439,14 +436,10 @@ your print statement.)
 
 =item $\
 
-The output record separator for the print operator.  Ordinarily the
-print operator simply prints out its arguments as is, with no
-trailing newline or other end-of-record string added.  To get
-behavior more like B<awk>, set this variable as you would set
-B<awk>'s ORS variable to specify what is printed at the end of the
-print.  (Mnemonic: you set C<$\> instead of adding "\n" at the
-end of the print.  Also, it's just like C<$/>, but it's what you
-get "back" from Perl.)
+The output record separator for the print operator.  If defined, this
+value is printed after the last of print's arguments.  Default is C<undef>.
+(Mnemonic: you set C<$\> instead of adding "\n" at the end of the print.
+Also, it's just like C<$/>, but it's what you get "back" from Perl.)
 
 =item $LIST_SEPARATOR
 
index be51400..c3c23e0 100644 (file)
@@ -15,72 +15,72 @@ END {
 }
 
 if (find PerlIO::Layer 'perlio') {
- plan(tests => 16);
- ok(open(FOO,">:crlf",$file));
- ok(print FOO 'a'.((('a' x 14).qq{\n}) x 2000) || close(FOO));
- ok(open(FOO,"<:crlf",$file));
   plan(tests => 16);
   ok(open(FOO,">:crlf",$file));
   ok(print FOO 'a'.((('a' x 14).qq{\n}) x 2000) || close(FOO));
   ok(open(FOO,"<:crlf",$file));
 
- my $text;
- { local $/; $text = <FOO> }
- is(count_chars($text, "\015\012"), 0);
- is(count_chars($text, "\n"), 2000);
   my $text;
   { local $/; $text = <FOO> }
   is(count_chars($text, "\015\012"), 0);
   is(count_chars($text, "\n"), 2000);
 
- binmode(FOO);
- seek(FOO,0,0);
- { local $/; $text = <FOO> }
- is(count_chars($text, "\015\012"), 2000);
   binmode(FOO);
   seek(FOO,0,0);
   { local $/; $text = <FOO> }
   is(count_chars($text, "\015\012"), 2000);
 
- SKIP:
- {
-  skip("miniperl can't rely on loading PerlIO::scalar")
-      if $ENV{PERL_CORE_MINITEST};
-  skip("no PerlIO::scalar") unless $Config{extensions} =~ m!\bPerlIO/scalar\b!;
-  require PerlIO::scalar;
-  my $fcontents = join "", map {"$_\015\012"} "a".."zzz";
-  open my $fh, "<:crlf", \$fcontents;
-  local $/ = "xxx";
-  local $_ = <$fh>;
-  my $pos = tell $fh; # pos must be behind "xxx", before "\nyyy\n"
-  seek $fh, $pos, 0;
-  $/ = "\n";
-  $s = <$fh>.<$fh>;
-  ok($s eq "\nxxy\n");
- }
   SKIP:
   {
+       skip("miniperl can't rely on loading PerlIO::scalar")
+       if $ENV{PERL_CORE_MINITEST};
+       skip("no PerlIO::scalar") unless $Config{extensions} =~ m!\bPerlIO/scalar\b!;
+       require PerlIO::scalar;
+       my $fcontents = join "", map {"$_\015\012"} "a".."zzz";
+       open my $fh, "<:crlf", \$fcontents;
+       local $/ = "xxx";
+       local $_ = <$fh>;
+       my $pos = tell $fh; # pos must be behind "xxx", before "\nxxy\n"
+       seek $fh, $pos, 0;
+       $/ = "\n";
+       $s = <$fh>.<$fh>;
+       ok($s eq "\nxxy\n");
   }
 
- ok(close(FOO));
   ok(close(FOO));
 
- # binmode :crlf should not cumulate.
- # Try it first once and then twice so that even UNIXy boxes
- # get to exercise this, for DOSish boxes even once is enough.
- # Try also pushing :utf8 first so that there are other layers
- # in between (this should not matter: CRLF layers still should
- # not accumulate).
- for my $utf8 ('', ':utf8') {
-     for my $binmode (1..2) {
-        open(FOO, ">$file");
-        # require PerlIO; print PerlIO::get_layers(FOO), "\n";
-        binmode(FOO, "$utf8:crlf") for 1..$binmode;
-        # require PerlIO; print PerlIO::get_layers(FOO), "\n";
-        print FOO "Hello\n";
-        close FOO;
-        open(FOO, "<$file");
-        binmode(FOO);
-        my $foo = scalar <FOO>;
-        close FOO;
-        print join(" ", "#", map { sprintf("%02x", $_) } unpack("C*", $foo)),
-              "\n";
-        ok($foo =~ /\x0d\x0a$/);
-        ok($foo !~ /\x0d\x0d/);
-     }
- }
   # binmode :crlf should not cumulate.
   # Try it first once and then twice so that even UNIXy boxes
   # get to exercise this, for DOSish boxes even once is enough.
   # Try also pushing :utf8 first so that there are other layers
   # in between (this should not matter: CRLF layers still should
   # not accumulate).
   for my $utf8 ('', ':utf8') {
+       for my $binmode (1..2) {
+           open(FOO, ">$file");
+           # require PerlIO; print PerlIO::get_layers(FOO), "\n";
+           binmode(FOO, "$utf8:crlf") for 1..$binmode;
+           # require PerlIO; print PerlIO::get_layers(FOO), "\n";
+           print FOO "Hello\n";
+           close FOO;
+           open(FOO, "<$file");
+           binmode(FOO);
+           my $foo = scalar <FOO>;
+           close FOO;
+           print join(" ", "#", map { sprintf("%02x", $_) } unpack("C*", $foo)),
+           "\n";
+           ok($foo =~ /\x0d\x0a$/);
+           ok($foo !~ /\x0d\x0d/);
+       }
   }
 }
 else {
- skip_all("No perlio, so no :crlf");
   skip_all("No perlio, so no :crlf");
 }
 
 sub count_chars {
-  my($text, $chars) = @_;
-  my $seen = 0;
-  $seen++ while $text =~ /$chars/g;
-  return $seen;
+    my($text, $chars) = @_;
+    my $seen = 0;
+    $seen++ while $text =~ /$chars/g;
+    return $seen;
 }
diff --git a/utf8.c b/utf8.c
index c8b0955..932b336 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -306,7 +306,7 @@ Perl_is_utf8_string(pTHX_ U8 *s, STRLEN len)
 /*
 =for apidoc A|bool|is_utf8_string_loclen|const U8 *s|STRLEN len|const U8 **ep|const STRLEN *el
 
-Like is_ut8_string() but stores the location of the failure (in the
+Like is_utf8_string() but stores the location of the failure (in the
 case of "utf8ness failure") or the location s+len (in the case of
 "utf8ness success") in the C<ep>, and the number of UTF-8
 encoded characters in the C<el>.
@@ -367,7 +367,7 @@ Perl_is_utf8_string_loclen(pTHX_ const U8 *s, STRLEN len, const U8 **ep, STRLEN
 /*
 =for apidoc A|bool|is_utf8_string_loc|const U8 *s|STRLEN len|const U8 **ep|const STRLEN *el
 
-Like is_ut8_string() but stores the location of the failure (in the
+Like is_utf8_string() but stores the location of the failure (in the
 case of "utf8ness failure") or the location s+len (in the case of
 "utf8ness success") in the C<ep>.