[DOC PATCH] perldebtut
[p5sagit/p5-mst-13.2.git] / pod / perldelta.pod
index d873cdd..4d704f5 100644 (file)
@@ -4,17 +4,19 @@ perldelta - what is new for perl v5.8.0
 
 =head1 DESCRIPTION
 
-This document describes differences between the 5.6.0 release and the
-5.8.0 release.  Changes that have been integrated into the 5.6.1
-release are marked [561]. Changes that also appear in 5.6.1 but have
-been improved since are marked [561+].
+This document describes differences between the 5.6.0 release and
+the 5.8.0 release.
 
 Many of the bug fixes in 5.8.0 were already seen in the 5.6.1
 maintenance release since the two releases were kept closely
-coordinated.
+coordinated (while 5.8.0 was still called 5.7.something).
 
-If you are upgrading from Perl 5.005_03, you might also want
-to read L<perl56delta>.
+Changes that were integrated into the 5.6.1 release are marked C<[561]>.
+Many of these changes have been further developed since 5.6.1 was released,
+those are marked C<[561+]>.
+
+You can see the list of changes in the 5.6.1 release (both from the
+5.005_03 release and the 5.6.0 release) by reading L<perl561delta>.
 
 =head1 Highlights In 5.8.0
 
@@ -68,7 +70,7 @@ authors, however: PerlIO has been designed as a drop-in replacement
 (at the source code level) for the stdio interface.
 
 Depending on your platform, there are also other reasons why
-we decided to break binary compatibility, please read on. 
+we decided to break binary compatibility, please read on.
 
 =head2 64-bit platforms and malloc
 
@@ -225,6 +227,12 @@ since it, in a way, falsely promised that the features could be used.
 
 =item *
 
+In future releases, non-PerlIO aware XS modules may become completely
+unsupported.  Since PerlIO is a drop-in replacement for stdio at the
+source code level, this shouldn't be that drastic a change.
+
+=item *
+
 The current user-visible implementation of pseudo-hashes (the weird
 use of the first array element) is deprecated starting from Perl 5.8.0
 and will be removed in Perl 5.10.0, and the feature will be
@@ -272,6 +280,11 @@ release.
 
 =item *
 
+The C<exec LIST> and C<system LIST> operations will produce fatal
+errors on tainted data in some future release.
+
+=item *
+
 The existing behaviour when localising tied arrays and hashes is wrong,
 and will be changed in a future release, so do not rely on the existing
 behaviour. See L<"Localising Tied Arrays and Hashes Is Broken">.
@@ -319,7 +332,26 @@ Note for EBCDIC users: the pseudo layer ":utf8" is erroneously named
 for you since it's not UTF-8 what you will be getting but instead
 UTF-EBCDIC.  See L<perlunicode>, L<utf8>, and
 http://www.unicode.org/unicode/reports/tr16/ for more information.
-In future releases this naming may change.
+In future releases this naming may change.  See L<perluniintro>
+for more information about UTF-8.
+
+=item *
+
+If your environment variables (LC_ALL, LC_CTYPE, LANG, LANGUAGE) look
+like you want to use UTF-8 (any of the the variables match C</utf-?8/i>),
+your STDIN, STDOUT, STDERR handles and the default open discipline
+(see L<open>) are marked as UTF-8.
+
+Note that after this Perl really does assume that everything is UTF-8:
+for example if some input handle is not, Perl will probably very soon
+complain about the input data like this "Malformed UTF-8 ..." since
+any old eight-bit data is not legal UTF-8.
+
+Note for code authors: if you want to enable your users to use UTF-8
+as their default encoding  but in your code still have eight-bit I/O streams
+(such as images or zip files), you need to explicitly open() or binmode()
+with C<:bytes> (see L<perlfunc/open> and L<perlfunc/binmode>), or you
+can just use C<binmode(FH)> (nice for pre-5.8.0 backward compatibility).
 
 =item *
 
@@ -395,7 +427,7 @@ and L<perlunicode> for details.
 
 The Unicode Character Database coming with Perl has been upgraded
 to Unicode 3.2.0.  For more information, see http://www.unicode.org/ .
-[561+]
+[561+] (5.6.1 has UCD 3.0.1.)
 
 =item *
 
@@ -432,6 +464,37 @@ This change leads to often slightly faster and always less lossy
 arithmetics. (Previously Perl always preferred floating point numbers
 in its math.)
 
+=head2 Arrays now always interpolate into double-quoted strings [561]
+
+In double-quoted strings, arrays now interpolate, no matter what.  The
+behavior in earlier versions of perl 5 was that arrays would interpolate
+into strings if the array had been mentioned before the string was
+compiled, and otherwise Perl would raise a fatal compile-time error.
+In versions 5.000 through 5.003, the error was
+
+        Literal @example now requires backslash
+
+In versions 5.004_01 through 5.6.0, the error was
+
+        In string, @example now must be written as \@example
+
+The idea here was to get people into the habit of writing
+C<"fred\@example.com"> when they wanted a literal C<@> sign, just as
+they have always written C<"Give me back my \$5"> when they wanted a
+literal C<$> sign.
+
+Starting with 5.6.1, when Perl now sees an C<@> sign in a
+double-quoted string, it I<always> attempts to interpolate an array,
+regardless of whether or not the array has been used or declared
+already.  The fatal error has been downgraded to an optional warning:
+
+        Possible unintended interpolation of @example in string
+
+This warns you that C<"fred@example.com"> is going to turn into
+C<fred.com> if you don't backslash the C<@>.
+See http://www.plover.com/~mjd/perl/at-error.html for more details
+about the history here.
+
 =head2 Miscellaneous Changes
 
 =over 4
@@ -460,9 +523,16 @@ in multiple arguments.)
 
 =item *
 
+C<do> followed by a bareword now ensures that this bareword isn't
+a keyword (to avoid a bug where C<do q(foo.pl)> tried to call a
+subroutine called C<q>).  This means that for example instead of
+C<do format()> you must write C<do &format()>.
+
+=item *
+
 The builtin dump() now gives an optional warning
 C<dump() better written as CORE::dump()>,
-meaning that by default C<dump(...)> is resolved as the builtin 
+meaning that by default C<dump(...)> is resolved as the builtin
 dump() which dumps core and aborts, not as (possibly) user-defined
 C<sub dump>.  To call the latter, qualify the call as C<&dump(...)>.
 (The whole dump() feature is to considered deprecated, and possibly
@@ -478,7 +548,7 @@ replacements to override these builtins.
 =item *
 
 END blocks are now run even if you exit/die in a BEGIN block.
-Internally, the execution of END blocks is now controlled by 
+Internally, the execution of END blocks is now controlled by
 PL_exit_flags & PERL_EXIT_DESTRUCT_END. This enables the new
 behaviour for Perl embedders. This will default in 5.10. See
 L<perlembed>.
@@ -490,7 +560,7 @@ Formats now support zero-padded decimal fields.
 =item *
 
 Lvalue subroutines can now return C<undef> in list context.  However,
-the lvalue subroutine feature still remains experimental. [561+]
+the lvalue subroutine feature still remains experimental.  [561+]
 
 =item *
 
@@ -515,6 +585,12 @@ is a NaN.  Previously the behaviour was unspecified.
 
 =item *
 
+C<our> can now have an experimental optional attribute C<unique> that
+affects how global variables are shared among multiple interpreters,
+see L<perlfunc/our>.
+
+=item *
+
 The following builtin functions are now overridable: each(), keys(),
 pop(), push(), shift(), splice(), unshift(). [561]
 
@@ -556,7 +632,7 @@ of the parameters can vary.
 
 =item *
 
-prototype(\&) is now available.
+The (\&) prototype now works properly. [561]
 
 =item *
 
@@ -575,10 +651,10 @@ This is not a substitute for -T.>
 
 In other taint news, the C<exec LIST> and C<system LIST> have now been
 considered too risky (think C<exec @ARGV>: it can start any program
-with any arguments), and now the said forms cause a warning.
-You should carefully launder the arguments to guarantee their
-validity.  In future releases of Perl the forms will become fatal
-errors so consider starting laundering now.
+with any arguments), and now the said forms cause a warning under
+lexical warnings.  You should carefully launder the arguments to
+guarantee their validity.  In future releases of Perl the forms will
+become fatal errors so consider starting laundering now.
 
 =item *
 
@@ -631,12 +707,24 @@ The command-line options -s and -F are now recognized on the shebang
 Use of the C</c> match modifier without an accompanying C</g> modifier
 elicits a new warning: C<Use of /c modifier is meaningless without /g>.
 
-Use of C</c> in substitutions, even with C</g>, elicits 
-C<Use of /c modifier is meaningless in s///>.  
+Use of C</c> in substitutions, even with C</g>, elicits
+C<Use of /c modifier is meaningless in s///>.
 
 Use of C</g> with C<split> elicits C<Use of /g modifier is meaningless
 in split>.
 
+=item *
+
+Support for the C<CLONE> special subroutine had been added.
+With ithreads, when a new thread is created, all Perl data is cloned,
+however non-Perl data cannot be cloned automatically.  In C<CLONE> you
+can do whatever you need to do, like for example handle the cloning of
+non-Perl data, if necessary.  C<CLONE> will be executed once for every
+package that has it defined or inherited.  It will be called in the
+context of the new thread, so all modifications are made in the new area.
+
+See L<perlmod>
+
 =back
 
 =head1 Modules and Pragmata
@@ -779,8 +867,8 @@ Filter::Util::Call.  See L<Filter::Simple>.
 =item *
 
 C<File::Temp>, by Tim Jenness, allows one to create temporary files
-and directories in an easy, portable, and secure way.  See
-L<File::Temp>. [561+]
+and directories in an easy, portable, and secure way.  See L<File::Temp>.
+[561+]
 
 =item *
 
@@ -1135,7 +1223,7 @@ leads to better portability.
 
 =item *
 
-Fcntl, Socket, and Sys::Syslog have been rewritten by Nicholas Clark 
+Fcntl, Socket, and Sys::Syslog have been rewritten by Nicholas Clark
 to use the new-style constant dispatch section (see L<ExtUtils::Constant>).
 This means that they will be more robust and hopefully faster.
 
@@ -1161,8 +1249,9 @@ You can enable/disable them with C<use/no warnings 'File::Find';>.
 
 =item *
 
-File::Glob::glob() renamed to File::Glob::bsd_glob() to avoid
-prototype mismatch with CORE::glob(). [561]
+File::Glob::glob() has been renamed to File::Glob::bsd_glob()
+because the name clashes with the builtin glob().  The older
+name is still available for compatibility, but is deprecated. [561]
 
 =item *
 
@@ -1181,6 +1270,11 @@ as a sockatmark() function.
 
 =item *
 
+IO::Socket::INET failed to open the specified port if the service name
+was not known.  It now correctly uses the supplied port number as is. [561]
+
+=item *
+
 IO::Socket::INET has support for the ReusePort option (if your
 platform supports it).  The Reuse option now has an alias, ReuseAddr.
 For clarity, you may want to prefer ReuseAddr.
@@ -1469,11 +1563,15 @@ the installation as README.I<platform>, and after the installation
 as perlI<platform>:
 
     perlaix perlamiga perlapollo perlbeos perlbs2000
-    perlce perlcygwin perldgux perldos perlepoc perlhpux
-    perlhurd perlmachten perlmacos perlmint perlmpeix
+    perlce perlcygwin perldgux perldos perlepoc perlfreebsd perlhpux
+    perlhurd perlirix perlmachten perlmacos perlmint perlmpeix
     perlnetware perlos2 perlos390 perlplan9 perlqnx perlsolaris
     perltru64 perluts perlvmesa perlvms perlvos perlwin32
 
+These documents usually detail one or more of the following subjects:
+configuring, building, testing, installing, and sometimes also using
+Perl on the said platform.
+
 Eastern Asian Perl users are now welcomed in their own languages:
 README.jp (Japanese), README.ko (Korean), README.cn (simplified
 Chinese) and README.tw (traditional Chinese), which are written in
@@ -1509,6 +1607,12 @@ common scenarios. [561]
 
 =item *
 
+sort() is also fully reentrant, in the sense that the sort function
+can itself call sort().  This did not work reliably in previous
+releases. [561]
+
+=item *
+
 sort() has been changed to use primarily mergesort internally as
 opposed to the earlier quicksort.  For very small lists this may
 result in slightly slower sorting times, but in general the speedup
@@ -1651,7 +1755,7 @@ modules in @INC.
 
 =item *
 
-Configure C<-S> can now run non-interactively.
+Configure C<-S> can now run non-interactively. [561]
 
 =item *
 
@@ -1845,9 +1949,10 @@ need a thread library package installed. See README.hpux. [561]
 
 =item *
 
-Mac OS Classic (MacPerl has of course been available since
-perl 5.004 but now the source code bases of standard Perl
-and MacPerl have been synchronised)
+Mac OS Classic is now supported in the mainstream source package
+(MacPerl has of course been available since perl 5.004 but now the
+source code bases of standard Perl and MacPerl have been synchronised)
+[561]
 
 =item *
 
@@ -1884,9 +1989,11 @@ specific ones) have been merged back to the main distribution.
 =item *
 
 Perl has been tested with the GNU pth userlevel thread package
-( http://www.gnu.org/software/pth/pth.html ) . All but one thread
-test worked, and that one failure was because of test results arriving
-in unexpected order.
+( http://www.gnu.org/software/pth/pth.html ).  All thread tests
+of Perl now work, but not without adding some yield()s to the tests,
+so while pth (and other userlevel thread implementations) can be
+considered to be "working" with Perl ithreads, keep in mind the
+possible non-preemptability of the underlying thread implementation.
 
 =item *
 
@@ -1925,10 +2032,10 @@ The autouse pragma didn't work for Multi::Part::Function::Names.
 
 =item *
 
-caller() could cause core dumps in certain situations.  Carp was sometimes
-affected by this problem.  In particular, caller() now returns a
-subroutine name of C<(unknown)> for subroutines that have been removed
-from the symbol table. [561+]
+caller() could cause core dumps in certain situations.  Carp was
+sometimes affected by this problem.  In particular, caller() now
+returns a subroutine name of C<(unknown)> for subroutines that have
+been removed from the symbol table.
 
 =item *
 
@@ -1963,8 +2070,9 @@ now goes correctly to the socket if RemotePort is set. [561]
 
 =item *
 
-Perl 5.6.0 could emit spurious warnings about redefinition of dl_error()
-when statically building extensions into perl.  This has been corrected. [561]
+Perl 5.6.0 could emit spurious warnings about redefinition of
+dl_error() when statically building extensions into perl.
+This has been corrected. [561]
 
 =item *
 
@@ -1997,7 +2105,7 @@ were declared before the lexicals.
 =item *
 
 Lexical warnings now propagating correctly between scopes
-and into C<eval "...">. [561+]
+and into C<eval "...">.
 
 =item *
 
@@ -2084,7 +2192,8 @@ Attributes (such as :shared) didn't work with our().
 
 =item *
 
-our() variables will not cause "will not stay shared" warnings.
+our() variables will not cause bogus "Variable will not stay shared"
+warnings. [561]
 
 =item *
 
@@ -2215,10 +2324,6 @@ Sys::Syslog ignored the C<LOG_AUTH> constant.
 
 =item *
 
-All but the first argument of the IO syswrite() method are now optional.
-
-=item *
-
 $AUTOLOAD, sort(), lock(), and spawning subprocesses
 in multiple threads simultaneously are now thread-safe.
 
@@ -2336,7 +2441,7 @@ Previously DYNIX/ptx had problems in its Configure probe for non-blocking I/O.
 
 EPOC
 
-EPOC update after Perl 5.6.0.  See README.epoc. [561]
+EPOC now better supported.  See README.epoc. [561]
 
 =item *
 
@@ -2395,7 +2500,7 @@ MPE/iX update after Perl 5.6.0.  See README.mpeix. [561]
 
 NetBSD/threads: try installing the GNU pth (should be in the
 packages collection, or http://www.gnu.org/software/pth/),
-and Configure with -Duseithreads. 
+and Configure with -Duseithreads.
 
 =item *
 
@@ -2439,13 +2544,16 @@ Unicos
 
 Fixed various alignment problems that lead into core dumps either
 during build or later; no longer dies on math errors at runtime;
-now using full quad integers (64 bits), previously was using 
+now using full quad integers (64 bits), previously was using
 only 46 bit integers for speed.
 
 =item *
 
 VMS
 
+See L</"Socket Extension Dynamic in VMS"> and L</"IEEE-format Floating Point
+Default on OpenVMS Alpha"> for important changes not otherwise listed here.
+
 chdir() now works better despite a CRT bug; now works with MULTIPLICITY
 (see INSTALL); now works with Perl's malloc.
 
@@ -2454,7 +2562,7 @@ unimplemented.  It now works as documented.
 
 The C<waitpid> emulation has been improved.  The worst bug (now fixed)
 was that a pid of -1 would cause a wildcard search of all processes on
-the system.  
+the system.
 
 POSIX-style signals are now emulated much better on VMS versions prior
 to 7.0.
@@ -2466,7 +2574,7 @@ File access tests now use current process privileges rather than the
 user's default privileges, which could sometimes result in a mismatch
 between reported access and actual access.
 
-There is a new C<kill> implementation based on C<sys$sigprc> that allows 
+There is a new C<kill> implementation based on C<sys$sigprc> that allows
 older VMS systems (pre-7.0) to use C<kill> to send signals rather than
 simply force exit.  This implementation also allows later systems to
 call C<kill> from within a signal handler.
@@ -2546,6 +2654,10 @@ Can now send() from all threads, not just the first one. [561]
 
 =item *
 
+ExtUtils::MakeMaker now uses $ENV{LIB} to search for libraries.
+
+=item *
+
 Fake signal handling reenabled, bugs and all.
 
 =item *
@@ -2574,6 +2686,11 @@ under Windows 9x. [561]
 
 =item *
 
+Non-blocking waits for child processes (or pseudo-processes) are
+supported via C<waitpid($pid, &POSIX::WNOHANG)>.
+
+=item *
+
 Win64 compilation is now supported.
 
 =item *
@@ -2605,7 +2722,7 @@ marked by a C<E<lt>-- HERE> marker.
 
 The various "opened only for", "on closed", "never opened" warnings
 drop the C<main::> prefix for filehandles in the C<main> package,
-for example C<STDIN> instead of C<main::STDIN>. 
+for example C<STDIN> instead of C<main::STDIN>.
 
 =item *
 
@@ -2660,7 +2777,7 @@ for the C<"c"> format and a number less than -128 or more than 127.
 
 Certain regex modifiers such as C<(?o)> make sense only if applied to
 the entire regex.  You will get an optional warning if you try to do
-otherwise. 
+otherwise.
 
 =item *
 
@@ -2783,7 +2900,7 @@ should only be used by security experts who know exactly what they are
 doing and why they are using suidperl instead of some other solution
 such as sudo ( see http://www.courtesan.com/sudo/ ).
 
-=head1 New Tests [561+]
+=head1 New Tests
 
 Several new tests have been added, especially for the F<lib> and F<ext>
 subsections.  There are now about 65 000 individual tests (spread over
@@ -2858,9 +2975,10 @@ use the bundled C compiler.)
 
 =head2 AmigaOS
 
-Perl 5.8.0 doesn't build in AmigaOS.  It broke at some point
-during the ithreads work and we could not find Amiga experts
-to unbreak the problems. [561]
+Perl 5.8.0 doesn't build in AmigaOS.  It broke at some point during
+the ithreads work and we could not find Amiga experts to unbreak the
+problems.  Perl 5.6.1 still works for AmigaOS (as does the the 5.7.2
+development release).
 
 =head2 BeOS
 
@@ -2886,6 +3004,11 @@ If this test fails, it indicates that your libc (C library) is not
 threadsafe.  This particular test stress tests the localtime() call to
 find out whether it is threadsafe.  See L<perlthrtut> for more information.
 
+=head2 FreeBSD built with ithreads coredumps reading large directories
+
+This is a known bug in FreeBSD's readdir_r() (see L<perlfreebsd>
+(README.freebsd)), which hopefully will be fixed in FreeBSD 4.6.
+
 =head2 FreeBSD Failing locale Test 117 For ISO8859-15 Locales
 
 The ISO8859-15 locales may fail the locale test 117 in FreeBSD.
@@ -3060,12 +3183,6 @@ this assumption fails in UNICOS.
 
 =head2 UNICOS/mk
 
-=head2 VOS (Stratus)
-
-When Perl is built using the native build process on VOS Release
-14.5.0 and GNU C++/GNU Tools 2.0.1, all attempted tests either
-pass or result in TODO (ignored) failures.
-
 =over 4
 
 =item *
@@ -3107,6 +3224,12 @@ return only three values, not four.
 
 There are a few known test failures, see L<perluts> (README.uts).
 
+=head2 VOS (Stratus)
+
+When Perl is built using the native build process on VOS Release
+14.5.0 and GNU C++/GNU Tools 2.0.1, all attempted tests either
+pass or result in TODO (ignored) failures.
+
 =head2 VMS
 
 There should be no reported test failures with a default configuration,
@@ -3223,10 +3346,11 @@ because it was felt that it didn't have enough value in it to be a
 core module.  It is still a useful module, though, and is available
 from the CPAN.
 
-Perl 5.8 unfortunately does not build anymore on AmigaOS;
-this broke accidentally at some point.  Since there are not that many
-Amiga developers available, we could not get this fixed and tested in
-time for 5.8.0.
+Perl 5.8 unfortunately does not build anymore on AmigaOS; this broke
+accidentally at some point.  Since there are not that many Amiga
+developers available, we could not get this fixed and tested in time
+for 5.8.0.  Perl 5.6.1 still works for AmigaOS (as does the the 5.7.2
+development release).
 
 =head1 Reporting Bugs