X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperl571delta.pod;h=80478716ec4629e9b2b936c5726764f864c2d168;hb=6bd23935f1e5b7c6f7035440f4b48e4c9659d61f;hp=bdae56ed761ef4e5083311532fb97b51e147b76e;hpb=8b40ef3a3461de58babf78ece05c176203e55df2;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perl571delta.pod b/pod/perl571delta.pod index bdae56e..8047871 100644 --- a/pod/perl571delta.pod +++ b/pod/perl571delta.pod @@ -8,7 +8,7 @@ This document describes differences between the 5.7.0 release and the 5.7.1 release. (To view the differences between the 5.6.0 release and the 5.7.0 -release, see L). +release, see L.) =head1 Security Vulnerability Closed @@ -62,13 +62,15 @@ natively, ASCII or EBCDIC, unless GLOB_ALPHASORT is specified.) =head1 Core Enhancements -=over 4 - -=item * +=head2 AUTOLOAD Is Now Lvaluable AUTOLOAD is now lvaluable, meaning that you can add the :lvalue attribute to AUTOLOAD subroutines and you can assign to the AUTOLOAD return value. +=head2 PerlIO is Now The Default + +=over 4 + =item * IO is now by default done via PerlIO rather than system's "stdio". @@ -100,10 +102,11 @@ File handles can be marked as accepting Perl's internal encoding of Unicode open($fh,">:utf8","Uni.txt"); -Note for EBCDIC users: the pseudo layer ":utf8" is badly named for you -since it's not UTF-8 what you will be getting but instead UTF-EBCDIC. -See http://www.unicode.org/unicode/reports/tr16/ for more information. -In future release this naming issue may or may not change. +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, L, and +http://www.unicode.org/unicode/reports/tr16/ for more information. +In future releases this naming may change. =item * @@ -136,7 +139,7 @@ the child process. =item * -The following builtin functions are now overrideable: chop(), chomp(), +The following builtin functions are now overridable: chop(), chomp(), each(), keys(), pop(), push(), shift(), splice(), unshift(). =item * @@ -149,11 +152,11 @@ Perl now tries internally to use integer values in numeric conversions and basic arithmetics (+ - * /) if the arguments are integers, and tries also to keep the results stored internally as integers. This change leads into often slightly faster and always less lossy -arithmetics (previously Perl always preferred floating point numbers -in its math) +arithmetics. (Previously Perl always preferred floating point numbers +in its math.) =item * - + The printf() and sprintf() now support parameter reordering using the C<%\d+\$> and C<*\d+\$> syntaxes. For example @@ -175,7 +178,7 @@ The Unicode Character Database coming with Perl has been upgraded to Unicode 3.1. For more information, see http://www.unicode.org/, and http://www.unicode.org/unicode/reports/tr27/ -For developers interested in enhanching Perl's Unicode capabilities: +For developers interested in enhancing Perl's Unicode capabilities: almost all the UCD files are included with the Perl distribution in the lib/unicode subdirectory. The most notable omission, for space considerations, is the Unihan database. @@ -191,7 +194,12 @@ C<\s> doesn't.) =back -=head2 Modules and Pragmata +=head2 Signals Are Now Safe + +Perl used to be fragile in that signals arriving at inopportune moments +could corrupt Perl's internal state. + +=head1 Modules and Pragmata =head2 New Modules @@ -199,15 +207,18 @@ C<\s> doesn't.) =item * -B::Concise is a new compiler backend for walking the Perl syntax tree, -printing concise info about ops. The output is highly customisable, -so customisable that B::Terse has been re-implemented in terms of -B::Concise. +B::Concise, by Stephen McCamant, is a new compiler backend for +walking the Perl syntax tree, printing concise info about ops. +The output is highly customisable. + +See L for more information. =item * -Class::ISA for reporting the search path for a class's ISA tree, -from Sean Burke, has been added. +Class::ISA, by Sean Burke, for reporting the search path for a +class's ISA tree, has been added. + +See L for more information. =item * @@ -220,35 +231,74 @@ if not possible, the familiar Perl library implementation is used. Digest, a frontend module for calculating digests (checksums), from Gisle Aas, has been added. +See L for more information. + =item * -Digest::MD5 for calculating MD5 digests (checksums), from Gisle Aas, +Digest::MD5 for calculating MD5 digests (checksums), by Gisle Aas, has been added. -NOTE: the MD5 backward compatibility module is purposefully not + use Digest::MD5 'md5_hex'; + + $digest = md5_hex("Thirsty Camel"); + + print $digest, "\n"; # 01d19d9d2045e005c3f1b80e8b164de1 + +NOTE: the MD5 backward compatibility module is deliberately not included since its use is discouraged. +See L for more information. + =item * -Encode provides a mechanism to translate between different character -encodings. Support for Unicode, ISO-8859-*, ASCII, CP*, KOI8-R, and -three variants of EBCDIC are compiled in to the module. Several other -encodings (like Japanese, Chinese, and MacIntosh encodings) are -included and will be loaded at runtime. +Encode, by Nick Ing-Simmons, provides a mechanism to translate +between different character encodings. Support for Unicode, +ISO-8859-*, ASCII, CP*, KOI8-R, and three variants of EBCDIC are +compiled in to the module. Several other encodings (like Japanese, +Chinese, and MacIntosh encodings) are included and will be loaded at +runtime. Any encoding supported by Encode module is also available to the ":encoding()" layer if PerlIO is used. +See L for more information. + =item * Filter::Simple is an easy-to-use frontend to Filter::Util::Call, from Damian Conway. + # in MyFilter.pm: + + package MyFilter; + + use Filter::Simple sub { + while (my ($from, $to) = splice @_, 0, 2) { + s/$from/$to/g; + } + }; + + 1; + + # in user's code: + + use MyFilter qr/red/ => 'green'; + + print "red\n"; # this code is filtered, will print "green\n" + print "bored\n"; # this code is filtered, will print "bogreen\n" + + no MyFilter; + + print "red\n"; # this code is not filtered, will print "red\n" + +See L for more information. + =item * -Filter::Util::Call, from Paul Marquess, provides you with the +Filter::Util::Call, by Paul Marquess, provides you with the framework to write I in Perl. For most uses the frontend Filter::Simple is to be preferred. +See L for more information. =item * @@ -257,36 +307,72 @@ from Neil Bowers, have been added. They provide the codes for various locale standards, such as "fr" for France, "usd" for US Dollar, and "jp" for Japanese. + use Locale::Country; + + $country = code2country('jp'); # $country gets 'Japan' + $code = country2code('Norway'); # $code gets 'no' + +See L, L, L, +and L for more information. + =item * -MIME::Base64, from Gisle Aas, allows you to encode data in base64. +MIME::Base64, by Gisle Aas, allows you to encode data in base64. + + use MIME::Base64; + + $encoded = encode_base64('Aladdin:open sesame'); + $decoded = decode_base64($encoded); + + print $encoded, "\n"; # "QWxhZGRpbjpvcGVuIHNlc2FtZQ==" + +See L for more information. =item * -MIME::QuotedPrint, from Gisle Aas, allows you to encode data in +MIME::QuotedPrint, by Gisle Aas, allows you to encode data in quoted-printable encoding. + use MIME::QuotedPrint; + + $encoded = encode_qp("Smiley in Unicode: \x{263a}"); + $decoded = decode_qp($encoded); + + print $encoded, "\n"; # "Smiley in Unicode: =263A" + MIME::QuotedPrint has been enhanced to provide the basic methods necessary to use it with PerlIO::Via as in : - use MIME::QuotedPrint; - open($fh,">Via(MIME::QuotedPrint)",$path) + use MIME::QuotedPrint; + open($fh,">Via(MIME::QuotedPrint)",$path) + +See L for more information. =item * -PerlIO::Scalar provides the IO to "in memory" perl scalars discussed -above. It also serves as an example of a loadable layer. +PerlIO::Scalar, by Nick Ing-Simmons, provides the implementation of +IO to "in memory" Perl scalars as discussed above. It also serves as +an example of a loadable layer. Other future possibilities include +PerlIO::Array and PerlIO::Code. See L for more +information. =item * -PerlIO::Via acts as a PerlIO layer and wraps PerlIO layer -functionality provided by a class (typically implemented in -perl code). +PerlIO::Via, by Nick Ing-Simmons, acts as a PerlIO layer and wraps +PerlIO layer functionality provided by a class (typically implemented +in perl code). + + use MIME::QuotedPrint; + open($fh,">Via(MIME::QuotedPrint)",$path) + +This will automatically convert everything output to C<$fh> +to Quoted-Printable. See L for more information. =item * -Pod::Text::Overstrike, from Joe Smith, has been added. +Pod::Text::Overstrike, by Joe Smith, has been added. It converts POD data to formatted overstrike text. +See L for more information. =item * @@ -296,21 +382,52 @@ Switch from Damian Conway has been added. Just by saying you have C and C available in Perl. + use Switch; + + switch ($val) { + + case 1 { print "number 1" } + case "a" { print "string a" } + case [1..10,42] { print "number in list" } + case (@array) { print "number in list" } + case /\w+/ { print "pattern" } + case qr/\w+/ { print "pattern" } + case (%hash) { print "entry in hash" } + case (\%hash) { print "entry in hash" } + case (\&sub) { print "arg to subroutine" } + else { print "previous case not true" } + } + +See L for more information. + =item * Text::Balanced from Damian Conway has been added, for extracting delimited text sequences from strings. + use Text::Balanced 'extract_delimited'; + + ($a, $b) = extract_delimited("'never say never', he never said", "'", ''); + +$a will be "'never say never'", $b will be ', he never said'. + +In addition to extract_delimited() there are also extract_bracketed(), +extract_quotelike(), extract_codeblock(), extract_variable(), +extract_tagged(), extract_multiple(), gen_delimited_pat(), and +gen_extract_tagged(). With these you can implement rather advanced +parsing algorithms. See L for more information. + =item * -Tie::RefHash::Nestable, from Edward Avis, allows storing hash references -(unlike the standard Tie::Refhash) +Tie::RefHash::Nestable, by Edward Avis, allows storing hash references +(unlike the standard Tie::RefHash) The module is contained within +Tie::RefHash. =item * -XS::Typemap is a test extension that exercises XS typemaps. -Nothing gets installed but for extension writers the code is -worth studying. +XS::Typemap, by Tim Jenness, is a test extension that exercises XS +typemaps. Nothing gets installed but for extension writers the code +is worth studying. =back @@ -320,18 +437,21 @@ worth studying. =item * -B::Deparse should be now more robust (still far from providing a full -round trip for any random piece of Perl code). +B::Deparse should be now more robust. It still far from providing a full +round trip for any random piece of Perl code, though, and is under active +development: expect more robustness in 5.7.2. =item * -Class::Struct has now compile-time features. +Class::Struct can now define the classes in compile time. =item * -Math::BigFloat has undergone much fixing. (The fixed Math::BigFloat -module is also available in CPAN for those who can't upgrade their Perl: -http://www.cpan.org/authors/id/J/JP/JPEACOCK/) +Math::BigFloat has undergone much fixing, and in addition the fmod() +function now supports modulus operations. + +(The fixed Math::BigFloat module is also available in CPAN for those +who can't upgrade their Perl: http://www.cpan.org/authors/id/J/JP/JPEACOCK/) =item * @@ -345,14 +465,18 @@ IO::Socket has now atmark() method, which returns true if the socket is positioned at the out-of-band mark. The method is also exportable as a sockatmark() function. -=item +=item * IO::Socket::INET has support for ReusePort option (if your platform -supports it). The Reuse option has now an alias, ReuseAddr. +supports it). The Reuse option now has an alias, ReuseAddr. For clarity +you may want to prefer ReuseAddr. =item * -Net::Ping has been greatly enhanced. +Net::Ping has been enhanced. There is now "external" protocol which +uses Net::Ping::External module which runs external ping(1) and parses +the output. An alpha version of Net::Ping::External is available in +CPAN and in 5.7.2 the Net::Ping::External may be integrated to Perl. =item * @@ -362,6 +486,8 @@ using PerlIO. =item * POSIX::sigaction() is now much more flexible and robust. +You can now install coderef handlers, 'DEFAULT', and 'IGNORE' +handlers, installing new handlers was not atomic. =item * @@ -378,8 +504,8 @@ has been implemented. =back The following modules have been upgraded from the versions at CPAN: -CPAN, CGI, DB::File, Getopt::Long, Pod::Man, Pod::Text, Storable, -Text-Tabs+Wrap. +CPAN, CGI, DB_File, File::Temp, Getopt::Long, Pod::Man, Pod::Text, +Storable, Text-Tabs+Wrap. =head1 Performance Enhancements @@ -388,12 +514,13 @@ Text-Tabs+Wrap. =item * Hashes now use Bob Jenkins "One-at-a-Time" hashing key algorithm -(http://burtleburtle.net/bob/hash/doobs.html). -This algorithm is reasonably fast while producing a much better spread -of values. Hash values output from the algorithm on a hash of all -3-char printable ASCII keys comes much closer to passing the DIEHARD -random number generation tests. According to perlbench, this change -has not affected the overall speed of Perl. +(http://burtleburtle.net/bob/hash/doobs.html). This algorithm is +reasonably fast while producing a much better spread of values than +the old hashing algorithm (originally by Chris Torek, later tweaked by +Ilya Zakharevich). Hash values output from the algorithm on a hash of +all 3-char printable ASCII keys comes much closer to passing the +DIEHARD random number generation tests. According to perlbench, this +change has not affected the overall speed of Perl. =item * @@ -475,8 +602,6 @@ will be installed as L. Documentation on how to use the Perl source repository has been added. -=head1 Performance Enhancements - =head1 Installation and Configuration Improvements =over 4 @@ -491,8 +616,8 @@ line option -Uuseperlio), you will get "-stdio" appended. =item * Another change related to the architecture name is that "-64all" -(-Duse64bitall, or "maximally 64-bit") is appended only if your pointers -are 64 bits wide. +(-Duse64bitall, or "maximally 64-bit") is appended only if your +pointers are 64 bits wide. (To be exact, the use64bitall is ignored.) =item * @@ -508,7 +633,7 @@ has been documented in INSTALL. =item * If you are on IRIX or Tru64 platforms, new profiling/debugging options -have been added, see L for more information about pixie and +have been added, see L for more information about pixie and Third Degree. =back @@ -538,9 +663,9 @@ L (for POSIX-BC), and L for more information. =item * -In HP-UX 10.20 Perl threading is now working with the various threading -packages available for HP-UX. See L (or in the source -distribution, README.hpux) for more information. +Building perl with -Duseithreads or -Duse5005threads now works under +HP-UX 10.20 (previously it only worked under 10.30 or later). You will +need a thread library package installed. See README.hpux. =item * @@ -550,15 +675,15 @@ and MacPerl have been synchronised) =item * -NCR MP-RAS +NCR MP-RAS is now supported. =item * -NonStop-UX +NonStop-UX is now supported. =item * -Amdahl UTS +Amdahl UTS is now supported. =item * @@ -645,7 +770,7 @@ SOCKS support is now much more robust. If your file system supports symbolic links you can build Perl outside of the source directory by - + mkdir /tmp/perl/build/directory cd /tmp/perl/build/directory sh /path/to/perl/source/Configure -Dmksymlinks ... @@ -662,14 +787,19 @@ and Perl will be built and tested, all in /tmp/perl/build/directory. =head1 Selected Bug Fixes -Numerous memory leaks have been hunted down. Most importantly anonymous -subs used to leak quite a bit. +Numerous memory leaks and uninitialized memory accesses have been hunted down. +Most importantly anonymous subs used to leak quite a bit. =over 4 =item * -The order of DESTROYS has been made more predictable. +chop(@list) in list context returned the characters chopped in +reverse order. This has been reversed to be in the right order. + +=item * + +The order of DESTROYs has been made more predictable. =item * @@ -687,6 +817,12 @@ to Perl) didn't work for more than a single group of options. =item * +The tainting behaviour of sprintf() has been rationalized. It does +not taint the result of floating point formats anymore, making the +behaviour consistent with that of string interpolation. + +=item * + All but the first argument of the IO syswrite() method are now optional. =item * @@ -714,6 +850,38 @@ accept(), revcfrom() (in Perl: recv()), getpeername(), and getsockname(). Previously DYNIX/ptx had problems in its Configure probe for non-blocking I/O. +=item * + +Windows + +=over 8 + +=item * + +Borland C++ v5.5 is now a supported compiler that can build Perl. +However, the generated binaries continue to be incompatible with those +generated by the other supported compilers (GCC and Visual C++). + +=item * + +Win32::GetCwd() correctly returns C:\ instead of C: when at the drive root. +Other bugs in chdir() and Cwd::cwd() have also been fixed. + +=item * + +Duping socket handles with open(F, ">&MYSOCK") now works under Windows 9x. + +=item * + +HTML files will be installed in c:\perl\html instead of c:\perl\lib\pod\html + +=item * + +The makefiles now provide a single switch to bulk-enable all the features +enabled in ActiveState ActivePerl (a popular binary distribution). + +=back + =back =head1 New or Changed Diagnostics @@ -727,7 +895,7 @@ respectively. =item * -If an attempt to use a (non-blessed) reference as an array element +If an attempt to use a (non-blessed) reference as an array index is made, a warning is given. =item * @@ -754,47 +922,98 @@ a no-op) and the latter replaced with dSP. =item * -Perl now uses system malloc instead of Perl malloc in all 64-bit -platforms. This change breaks backward compatibility but Perl's -malloc has problems with large address spaces and also the speed of -vendors' malloc is generally better in large address space machines -(Perl's malloc is mostly tuned for space). +Perl now uses system malloc instead of Perl malloc on all 64-bit +platforms, and even in some not-always-64-bit platforms like AIX, +IRIX, and Solaris. This change breaks backward compatibility but +Perl's malloc has problems with large address spaces and also the +speed of vendors' malloc is generally better in large address space +machines (Perl's malloc is mostly tuned for space). =back +=head1 New Tests + +Many new tests have been added. The most notable is probably the +lib/1_compile: it is very notable because running it takes quite a +long time -- it test compiles all the Perl modules in the distribution. +Please be patient. + =head1 Known Problems -=head2 lib/b test 19 +Note that unlike other sections in this document (which describe +changes since 5.7.0) this section is cumulative containing known +problems for all the 5.7 releases. -The test fails in various platforms (PA64 and IA64 are known), but the -exact cause is still being investigated. +=head2 AIX vac 5.0.0.0 May Produce Buggy Code For Perl -=head2 Localising a Tied Variable Leaks Memory +The AIX C compiler vac version 5.0.0.0 may produce buggy code, +resulting in few random tests failing, but when the failing tests +are run by hand, they succeed. We suggest upgrading to at least +vac version 5.0.1.0, that has been known to compile Perl correctly. +"lslpp -L|grep vac.C" will tell you the vac version. - use Tie::Hash; - tie my %tie_hash => 'Tie::StdHash'; +=head2 lib/ftmp-security tests warn 'system possibly insecure' - ... +Don't panic. Read INSTALL 'make test' section instead. - local($tie_hash{Foo}) = 1; # leaks +=head2 lib/io_multihomed Fails In LP64-Configured HP-UX -Code like the above is known to leak memory every time the local() -is executed. +The lib/io_multihomed test may hang in HP-UX if Perl has been +configured to be 64-bit. Because other 64-bit platforms do not hang in +this test, HP-UX is suspect. All other tests pass in 64-bit HP-UX. The +test attempts to create and connect to "multihomed" sockets (sockets +which have multiple IP addresses). + +=head2 Test lib/posix Subtest 9 Fails In LP64-Configured HP-UX + +If perl is configured with -Duse64bitall, the successful result of the +subtest 10 of lib/posix may arrive before the successful result of the +subtest 9, which confuses the test harness so much that it thinks the +subtest 9 failed. + +=head2 lib/b test 19 + +The test fails on various platforms (PA64 and IA64 are known), but the +exact cause is still being investigated. + +=head2 Linux With Sfio Fails op/misc Test 48 + +No known fix. =head2 sigaction test 13 in VMS -The test is known to fail, whether it's because of VMS of because -of faulty test, is not known. +The test is known to fail; whether it's because of VMS of because +of faulty test is not known. =head2 sprintf tests 129 and 130 -The op/sprintf tests 129 and 130 are known to fail in some platforms. -Examples include any platform using sfio, and Tandem's NonStop-UX. +The op/sprintf tests 129 and 130 are known to fail on some platforms. +Examples include any platform using sfio, and Compaq/Tandem's NonStop-UX. The failing platforms do not comply with the ANSI C Standard, line 19ff on page 134 of ANSI X3.159 1989 to be exact. (They produce something else than "1" and "-1" when formatting 0.6 and -0.6 using the printf format "%.0f", most often they produce "0" and "-0".) +=head2 Failure of Thread tests + +The subtests 19 and 20 of lib/thr5005.t test are known to fail due to +fundamental problems in the 5.005 threading implementation. These are +not new failures--Perl 5.005_0x has the same bugs, but didn't have +these tests. (Note that support for 5.005-style threading remains +experimental.) + +=head2 Localising a Tied Variable Leaks Memory + + use Tie::Hash; + tie my %tie_hash => 'Tie::StdHash'; + + ... + + local($tie_hash{Foo}) = 1; # leaks + +Code like the above is known to leak memory every time the local() +is executed. + =head2 Self-tying of Arrays and Hashes Is Forbidden Self-tying of arrays and hashes is broken in rather deep and @@ -802,6 +1021,27 @@ hard-to-fix ways. As a stop-gap measure to avoid people from getting frustrated at the mysterious results (core dumps, most often) it is for now forbidden (you will get a fatal error even from an attempt). +=head2 Building Extensions Can Fail Because Of Largefiles + +Some extensions like mod_perl are known to have issues with +`largefiles', a change brought by Perl 5.6.0 in which file offsets +default to 64 bits wide, where supported. Modules may fail to compile +at all or compile and work incorrectly. Currently there is no good +solution for the problem, but Configure now provides appropriate +non-largefile ccflags, ldflags, libswanted, and libs in the %Config +hash (e.g., $Config{ccflags_nolargefiles}) so the extensions that are +having problems can try configuring themselves without the +largefileness. This is admittedly not a clean solution, and the +solution may not even work at all. One potential failure is whether +one can (or, if one can, whether it's a good idea) link together at +all binaries with different ideas about file offsets, all this is +platform-dependent. + +=head2 The Compiler Suite Is Still Experimental + +The compiler suite is slowly getting better but is nowhere near +working order yet. + =head1 Reporting Bugs If you find what you think is a bug, you might check the articles