Follow that camel ... another sync.
[p5sagit/p5-mst-13.2.git] / pod / perldelta.pod
index 75423ce..6344ee4 100644 (file)
@@ -15,8 +15,8 @@ This document describes differences between the 5.005 release and this one.
 
 =head2 Perl Source Incompatibilities
 
-Beware that any new warnings that have been added are B<not> considered
-incompatible changes.
+Beware that any new warnings that have been added or enhanced old
+warnings are B<not> considered incompatible changes.
 
 Since all new warnings must be explicitly requested via the C<-w>
 switch or the C<warnings> pragma, it is ultimately the programmer's
@@ -55,7 +55,8 @@ In 5.005_0x and earlier, perl's rand() function used the C library
 rand(3) function.  As of 5.005_52, Configure tests for drand48(),
 random(), and rand() (in that order) and picks the first one it finds.
 Perl programs that depend on reproducing a specific set of pseudo-random
-numbers will now likely produce different output.
+numbers will now likely produce different output.  You can use
+C<sh Configure -Drandfunc=rand> to obtain the old behavior.
 
 =item Hashing function for hash keys has changed
 
@@ -93,7 +94,7 @@ In Perl 5.6 and later, C<"$$1"> always means C<"${$1}">.
 each(), values() and hashes in a list context return the actual
 values in the hash, instead of copies (as they used to in earlier
 versions).  Typical idioms for using these constructs copy the
-returned values, but this is can make a significant difference when
+returned values, but this can make a significant difference when
 creating references to the returned values.
 
 Keys in the hash are still returned as copies when iterating on
@@ -181,14 +182,6 @@ the default.
 Note that these functions do B<not> constitute Perl's memory allocation API.
 See L<perlguts/"Memory Allocation"> for further information about that.
 
-=item C<PL_na> and C<dTHR> Issues
-
-The C<PL_na> global is now thread local, so a C<dTHR> declaration is needed
-in the scope in which the global appears.  XSUBs should handle this automatically,
-but if you have used C<PL_na> in support functions, you either need to
-change the C<PL_na> to a local variable (which is recommended), or put in
-a C<dTHR>.
-
 =back
 
 =head2 Compatible C Source API Changes
@@ -249,7 +242,7 @@ See also L<"64-bit support">.
 =head2 Long Doubles
 
 Some platforms have "long doubles", floating point numbers of even
-larger range than ordinary "doubles".  To enable using ng doubles for
+larger range than ordinary "doubles".  To enable using long doubles for
 Perl's scalars, use -Duselongdouble.
 
 =head2 -Dusemorebits
@@ -272,7 +265,8 @@ because many scripts assume to find Perl in /usr/bin/perl.
 =head2 SOCKS support
 
 You can use "Configure -Dusesocks" which causes Perl to probe
-for the SOCKS proxy protocol library, http://www.socks.nec.com/
+for the SOCKS (v5, not v4) proxy protocol library,
+http://www.socks.nec.com/
 
 =head2 C<-A> flag
 
@@ -281,10 +275,14 @@ flag.  The editing happens immediately after the platform specific
 hints files have been processed but before the actual configuration
 process starts.  Run C<Configure -h> to find out the full C<-A> syntax.
 
-=head2 New Installation Scheme
+=head2 Enhanced Installation Directories
 
-vendorprefix et al
-[TODO - Andy Dougherty <doughera@lafcol.lafayette.edu>]
+The installation structure has been enriched to improve the support for 
+maintaining multiple versions of perl, to provide locations for
+vendor-supplied modules and scripts, and to ease maintenance of
+locally-added modules and scripts.  See the section on Installation 
+Directories in the INSTALL file for complete details.  For most users
+building and installing from source, the defaults should be fine.
 
 =head1 Core Changes
 
@@ -324,6 +322,15 @@ change#3385, also need perlguts documentation
 
 [TODO - Tuomas Lukka <lukka@fas.harvard.edu>]
 
+=head2 File globbing implemented internally
+
+WARNING: This is currently an experimental feature.  Interfaces and
+implementation are likely to change.
+
+Perl can be compiled with -DPERL_INTERNAL_GLOB to use the File::Glob
+implementation of the glob() operator.  This avoids using an external
+csh process and the problems associated with it.
+
 =head2 Binary numbers supported
 
 Binary numbers are now supported as literals, in s?printf formats, and
@@ -443,7 +450,7 @@ command before running Perl.  The BSD::Resource extension (not
 included with the standard Perl distribution) may also be of use, it
 offers the getrlimit/setrlimit interface that can be used to adjust
 process resource usage limits, including the maximum filesize limit.
+
 =head2 Long doubles
 
 In some systems you may be able to use long doubles to enhance the
@@ -686,7 +693,7 @@ exec() fails, earlier versions did not report the error properly,
 since the exec() happened to be in a different process.
 
 The child process now communicates with the parent about the
-error in launching the external command, which allow these
+error in launching the external command, which allows these
 constructs to return with their usual error value and set $!.
 
 =head2 Implicitly closed filehandles are safer
@@ -739,7 +746,7 @@ enabled.
 
 =head2 Locale bugs fixed
 
-printf() and sprintf() previously did reset the numeric locale
+printf() and sprintf() previously reset the numeric locale
 back to the default "C" locale.  This has been fixed.
 
 Numbers formatted according to the local numeric locale
@@ -783,7 +790,7 @@ behavior, END blocks are not executed anymore when the C<-c> switch
 is used.
 
 Note that something resembling the previous behavior can still be
-obtained by putting C<BEGIN { $^C = 0; exit; } at the very end of
+obtained by putting C<BEGIN { $^C = 0; exit; }> at the very end of
 the top level source file.
 
 =head2 Potential to leak DATA filehandles
@@ -803,7 +810,7 @@ library's C<stderr>.
 
 =head2 Other fixes for better diagnostics
 
-Line numbers are suppressed no more (under most likely circumstances)
+Line numbers are no longer suppressed (under most likely circumstances)
 during the global destruction phase.
 
 Diagnostics emitted from code running in threads other than the main
@@ -815,7 +822,7 @@ used to truncate the message in prior versions.
 $foo::a and $foo::b are now exempt from "possible typo" warnings only
 if sort() is encountered in package foo.
 
-Unrecognized alphabetic escapes encountered when parsing quoting
+Unrecognized alphabetic escapes encountered when parsing quote
 constructs now generate a warning, since they may take on new
 semantics in later versions of Perl.
 
@@ -982,6 +989,9 @@ See L<attributes>.
 
 =item B
 
+The Perl Compiler suite has been extensively reworked for this
+release.
+
 [TODO - Vishal Bhatia <vishal@gol.com>,
 Nick Ing-Simmons <nick@ni-s.u-net.com>]
 
@@ -990,11 +1000,6 @@ Nick Ing-Simmons <nick@ni-s.u-net.com>]
 The ByteLoader is a dedicated extension to generate and run
 Perl bytecode.  See L<ByteLoader>.
 
-=item B
-
-The Perl Compiler suite has been extensively reworked for this
-release.
-
 =item constant
 
 References can now be used.  See L<constant>.
@@ -1007,8 +1012,7 @@ change#4052
 =item Data::Dumper
 
 A C<Maxdepth> setting can be specified to avoid venturing
-too deeply into data structures that may be very deep.
-See L<Data::Dumper>.
+too deeply into deep data structures.  See L<Data::Dumper>.
 
 Dumping C<qr//> objects works correctly.
 
@@ -1023,33 +1027,52 @@ to Perl's debugging API.
 
 =item Devel::DProf
 
-Devel::DProf, a Perl source code profiler has been added.  See L<DProf>.
+Devel::DProf, a Perl source code profiler has been added.  See
+L<Devel::DProf> and L<dprofpp>.
 
 =item Dumpvalue
 
-Added Dumpvalue module provides screen dumps of Perl data.
+The Dumpvalue module provides screen dumps of Perl data.
 
 =item Benchmark
 
+Overall, Benchmark results exhibit lower average error and better timing
+accuracy.  
+
 You can now run tests for I<n> seconds instead of guessing the right
 number of tests to run: e.g. timethese(-5, ...) will run each 
 code for at least 5 CPU seconds.  Zero as the "number of repetitions"
 means "for at least 3 CPU seconds".  The output format has also
 changed.  For example:
 
-use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
+   use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
 
 will now output something like this:
 
-Benchmark: running a, b, each for at least 5 CPU seconds...
-         a:  5 wallclock secs ( 5.77 usr +  0.00 sys =  5.77 CPU) @ 200551.91/s (n=1156516)
-         b:  4 wallclock secs ( 5.00 usr +  0.02 sys =  5.02 CPU) @ 159605.18/s (n=800686)
+   Benchmark: running a, b, each for at least 5 CPU seconds...
+            a:  5 wallclock secs ( 5.77 usr +  0.00 sys =  5.77 CPU) @ 200551.91/s (n=1156516)
+            b:  4 wallclock secs ( 5.00 usr +  0.02 sys =  5.02 CPU) @ 159605.18/s (n=800686)
 
 New features: "each for at least N CPU seconds...", "wallclock secs",
 and the "@ operations/CPU second (n=operations)".
 
-change#4265,4266,4292
-[TODO - Barrie Slaymaker <barries@slaysys.com>]
+timethese() now returns a reference to a hash of Benchmark objects containing
+the test results, keyed on the names of the tests.
+
+timethis() now returns the iterations field in the Benchmark result object
+instead of 0.
+
+timethese(), timethis(), and the new cmpthese() (see below) can also take
+a format specifier of 'none' to suppress output.
+
+A new function countit() is just like timeit() except that it takes a
+TIME instead of a COUNT.
+
+A new function cmpthese() prints a chart comparing the results of each test
+returned from a timethese() call.  For each possible pair of tests, the
+percentage speed difference (iters/sec or seconds/iter) is shown.
+
+For other details, see L<Benchmark>.
 
 =item Devel::Peek
 
@@ -1082,6 +1105,12 @@ autoloaded or is a symbolic reference.
 A bug that caused File::Find to lose track of the working directory
 when pruning top-level directories has been fixed.
 
+=item File::Glob
+
+This extension implements BSD-style file globbing.  It will also be
+used for the internal implementation of the glob() operator if
+Perl was compiled with -DPERL_INTERNAL_GLOB.  See L<File::Glob>.
+
 =item File::Spec
 
 New methods have been added to the File::Spec module: devnull() returns
@@ -1105,7 +1134,64 @@ instead of
 
 =item Getopt::Long
 
-[TODO - Johan Vromans <jvromans@squirrel.nl>]
+Getopt::Long licensing has changed to allow the Perl Artistic License
+as well as the GPL. It used to be GPL only, which got in the way of
+non-GPL applications that wanted to use Getopt::Long.
+
+Getopt::Long encourages the use of Pod::Usage to produce help
+messages. For example:
+
+    use Getopt::Long;
+    use Pod::Usage;
+    my $man = 0;
+    my $help = 0;
+    GetOptions('help|?' => \$help, man => \$man) or pod2usage(2);
+    pod2usage(1) if $help;
+    pod2usage(-exitstatus => 0, -verbose => 2) if $man;
+
+    __END__
+
+    =head1 NAME
+
+    sample - Using GetOpt::Long and Pod::Usage
+
+    =head1 SYNOPSIS
+
+    sample [options] [file ...]
+
+     Options:
+       -help            brief help message
+       -man             full documentation
+
+    =head1 OPTIONS
+
+    =over 8
+
+    =item B<-help>
+
+    Print a brief help message and exits.
+
+    =item B<-man>
+
+    Prints the manual page and exits.
+
+    =back
+
+    =head1 DESCRIPTION
+
+    B<This program> will read the given input file(s) and do someting
+    useful with the contents thereof.
+
+    =cut
+
+See L<Pod::Usage> for details.
+
+A bug that prevented the non-option call-back E<lt>E<gt> from being
+specified as the first argument has been fixed.
+
+To specify the characters E<lt> and E<gt> as option starters, use
+E<gt>E<lt>. Note, however, that changing option starters is strongly
+deprecated. 
 
 =item IO
 
@@ -1131,7 +1217,7 @@ C<no lib> removes all named entries.
 
 =item Math::BigInt
 
-The logical operations C<E<lt>E<lt>>, C<E<gt>E<gt>>, C<&>, C<|>,
+The bitwise operations C<E<lt>E<lt>>, C<E<gt>E<gt>>, C<&>, C<|>,
 and C<~> are now supported on bigints.
 
 =item Math::Complex
@@ -1166,7 +1252,7 @@ fixed.
 =item Time::Local
 
 The timelocal() and timegm() functions used to silently return bogus
-results when the date exceeded the machine's integer range.  They
+results when the date fell outside the machine's integer range.  They
 now consistently croak() if the date falls in an unsupported range.
 
 =item Win32
@@ -1189,7 +1275,7 @@ to the Win32::GetLastError() function.
 The new Win32::GetFullPathName(FILENAME) returns the full absolute
 pathname for FILENAME in scalar context.  In list context it returns
 a two-element list containing the fully qualified directory name and
-the filename.
+the filename.  See L<Win32>.
 
 =item DBM Filters
 
@@ -1210,7 +1296,7 @@ See L<perldbmfilter> for further information.
 
 =head2 Pragmata
 
-C<use attrs> is now obsolescent, and is only provided for
+C<use attrs> is now obsolete, and is only provided for
 backward-compatibility.  It's been replaced by the C<sub : attributes>
 syntax.  See L<perlsub/"Subroutine Attributes"> and L<attributes>.
 
@@ -1257,6 +1343,10 @@ change#4232
 
 An introduction to using the Perl Compiler suite.
 
+=item perlfilter.pod
+
+An introduction to writing Perl source filters.
+
 =item perlhack.pod
 
 Some guidelines for hacking the Perl source code.
@@ -1275,7 +1365,7 @@ A tutorial on managing class data for object modules.
 
 =back
 
-=head1 New Diagnostics
+=head1 New or Changed Diagnostics
 
 =over 4
 
@@ -1304,7 +1394,7 @@ See L<perlfunc/pack>.
 
 =item / must be followed by a*, A* or Z*
 
-(F) You had an pack template indicating a counted-length string,
+(F) You had a pack template indicating a counted-length string,
 Currently the only things that can have their length counted are a*, A* or Z*.
 See L<perlfunc/pack>.
 
@@ -1314,26 +1404,21 @@ See L<perlfunc/pack>.
 but this did not follow some numeric unpack specification.
 See L<perlfunc/pack>.
 
-=item Repeat count in pack overflows
-
-(F) You can't specify a repeat count so large that it overflows
-your signed integers.  See L<perlfunc/pack>.
-
-=item Repeat count in unpack overflows
-
-(F) You can't specify a repeat count so large that it overflows
-your signed integers.  See L<perlfunc/unpack>.
-
 =item /%s/: Unrecognized escape \\%c passed through
 
 (W) You used a backslash-character combination which is not recognized
 by Perl.  This combination appears in an interpolated variable or a
-C<'>-delimited regular expression.
+C<'>-delimited regular expression.  The character was understood literally.
+
+=item /%s/: Unrecognized escape \\%c in character class passed through
+
+(W) You used a backslash-character combination which is not recognized
+by Perl inside character classes.  The character was understood literally.
 
 =item /%s/ should probably be written as "%s"
 
 (W) You have used a pattern where Perl expected to find a string,
-like in the first argument to C<join>.  Perl will treat the true
+as in the first argument to C<join>.  Perl will treat the true
 or false result of matching the pattern against $_ as the string,
 which is probably not what you had in mind.
 
@@ -1409,10 +1494,19 @@ so it was truncated to the string shown.
 
 (P) For some reason you can't check the filesystem of the script for nosuid.
 
+=item Can't ignore signal CHLD, forcing to default
+
+(W) Perl has detected that it is being run with the SIGCHLD signal
+(sometimes known as SIGCLD) disabled.  Since disabling this signal
+will interfere with proper determination of exit status of child
+processes, Perl has reset the signal to its default value.
+This situation typically indicates that the parent program under
+which Perl may be running (e.g. cron) is being very careless.
+
 =item Can't modify non-lvalue subroutine call
 
-(F) Subroutines used in lvalue context should be marked as such, see
-L<perlsub/"Lvalue subroutines">.
+(F) Subroutines meant to be used in lvalue context should be declared as
+such, see L<perlsub/"Lvalue subroutines">.
 
 =item Can't read CRTL environ
 
@@ -1441,13 +1535,15 @@ references can be weakened.
 =item Character class [:%s:] unknown
 
 (F) The class in the character class [: :] syntax is unknown.
+See L<perlre>.
 
 =item Character class syntax [%s] belongs inside character classes
 
 (W) The character class constructs [: :], [= =], and [. .]  go
 I<inside> character classes, the [] are part of the construct,
-for example: /[012[:alpha:]345]/.  Note that the last two constructs
-are not currently implemented, they are placeholders for future extensions.
+for example: /[012[:alpha:]345]/.  Note that [= =] and [. .]
+are not currently implemented; they are simply placeholders for
+future extensions.
 
 =item Constant is not %s reference
 
@@ -1492,10 +1588,17 @@ See Server error.
 (F) While under the C<use filetest> pragma, switching the real and
 effective uids or gids failed.
 
+=item false [] range "%s" in regexp
+
+(W) A character class range must start and end at a literal character, not
+another character class like C<\d> or C<[:alpha:]>.  The "-" in your false
+range is interpreted as a literal "-".  Consider quoting the "-",  "\-".
+See L<perlre>.
+
 =item Filehandle %s opened only for output
 
 (W) You tried to read from a filehandle opened only for writing.  If you
-intended it to be a read-write filehandle, you needed to open it with
+intended it to be a read/write filehandle, you needed to open it with
 "+E<lt>" or "+E<gt>" or "+E<gt>E<gt>" instead of with "E<lt>" or nothing.  If
 you intended only to read from the file, use "E<lt>".  See
 L<perlfunc/open>.
@@ -1521,7 +1624,7 @@ line was ignored.
 
 =item Illegal binary digit %s
 
-(F) You used a digit other than 0 and 1 in a binary number.
+(F) You used a digit other than 0 or 1 in a binary number.
 
 =item Illegal binary digit %s ignored
 
@@ -1536,7 +1639,7 @@ two from 1 to 32 (or 64, if your platform supports that).
 =item Integer overflow in %s number
 
 (W) The hexadecimal, octal or binary number you have specified either
-as a literal in your code or as a scalar is too big for your
+as a literal or as an argument to hex() or oct() is too big for your
 architecture, and has been converted to a floating point number.  On a
 32-bit architecture the largest hexadecimal, octal or binary number
 representable without overflow is 0xFFFFFFFF, 037777777777, or
@@ -1555,6 +1658,10 @@ by Perl or by a user-supplied handler.  See L<attributes>.
 The indicated attributes for a subroutine or variable were not recognized
 by Perl or by a user-supplied handler.  See L<attributes>.
 
+=item invalid [] range "%s" in regexp
+
+The offending range is now explicitly displayed.
+
 =item Invalid separator character %s in attribute list
 
 (F) Something other than a comma or whitespace was seen between the
@@ -1638,6 +1745,16 @@ could be a potential Year 2000 problem.
 
 See Server error.
 
+=item Repeat count in pack overflows
+
+(F) You can't specify a repeat count so large that it overflows
+your signed integers.  See L<perlfunc/pack>.
+
+=item Repeat count in unpack overflows
+
+(F) You can't specify a repeat count so large that it overflows
+your signed integers.  See L<perlfunc/unpack>.
+
 =item realloc() of freed memory ignored
 
 (S) An internal routine called realloc() on something that had already
@@ -1666,7 +1783,7 @@ repetitions of "xyz" is C</abc(?=(?:xyz){3})/>, not C</abc(?=xyz){3}/>.
 (F) While under the C<use filetest> pragma, we cannot switch the
 real and effective uids or gids.
 
-=item This Perl can't reset CRTL eviron elements (%s)
+=item This Perl can't reset CRTL environ elements (%s)
 
 =item This Perl can't set CRTL environ elements (%s=%s)
 
@@ -1679,9 +1796,9 @@ L<perlvms>) so that the environ array isn't the target of the change to
 
 =item Unknown open() mode '%s'
 
-(F) The second argument of 3-arguments open is not one from the list
-of C<L<lt>>, C<L<gt>>, C<E<gt>E<gt>>, C<+L<lt>>, C<+L<gt>>,
-C<+E<gt>E<gt>>, C<-|>, C<|-> of possible open() modes.
+(F) The second argument of 3-argument open() is not among the list
+of valid modes: C<L<lt>>, C<L<gt>>, C<E<gt>E<gt>>, C<+L<lt>>,
+C<+L<gt>>, C<+E<gt>E<gt>>, C<-|>, C<|->.
 
 =item Unknown process %x sent message to prime_env_iter: %s
 
@@ -1693,7 +1810,7 @@ subvert Perl's population of %ENV for nefarious purposes.
 =item Unrecognized escape \\%c passed through
 
 (W) You used a backslash-character combination which is not recognized
-by Perl.
+by Perl.  The character was understood literally.
 
 =item Unterminated attribute parameter in attribute list
 
@@ -1783,7 +1900,7 @@ warning.  And in Perl 5.005, this special treatment will cease.
 
 =head1 BUGS
 
-If you find what you think is a bug, you might check the headers of
+If you find what you think is a bug, you might check the
 articles recently posted to the comp.lang.perl.misc newsgroup.
 There may also be information at http://www.perl.com/perl/, the Perl
 Home Page.