From: Jarkko Hietaniemi Date: Mon, 26 Nov 2001 11:11:08 +0000 (+0000) Subject: Pass 6 at perldelta - sort enhancements, generic and X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1f170bd13c59340f1c69c00ae61ac3708f148c2;p=p5sagit%2Fp5-mst-13.2.git Pass 6 at perldelta - sort enhancements, generic and platform specific bug fixes. p4raw-id: //depot/perl@13281 --- diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 8a17974..e3492a7 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -164,11 +164,6 @@ natively, ASCII or EBCDIC, unless GLOB_ALPHASORT is specified.) =head1 Core Enhancements -=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 @@ -239,50 +234,33 @@ The list form of C is now implemented for pipes (at least on UNIX): creates a pipe, and runs the equivalent of exec('cat', '/etc/motd') in the child process. -=item * - -The following builtin functions are now overridable: chop(), chomp(), -each(), keys(), pop(), push(), shift(), splice(), unshift(). - -=item * - -Formats now support zero-padded decimal fields. - -=item * +=back -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.) +=head2 Signals Are Now Safe -=item * +Perl used to be fragile in that signals arriving at inopportune moments +could corrupt Perl's internal state. Now Perl postpones handling of +signals until it's safe. -The printf() and sprintf() now support parameter reordering using the -C<%\d+\$> and C<*\d+\$> syntaxes. For example +=head2 Unicode Overhaul - print "%2\$s %1\$s\n", "foo", "bar"; +Unicode in general should be now much more usable than in Perl 5.6.0 +(or even in 5.6.1). Unicode can be used in hash keys, Unicode in +regular expressions should work now, Unicode in tr/// should work now, +Unicode in I/O should work now. -will print "bar foo\n"; This feature helps in writing -internationalised software. +=over 4 =item * -Unicode in general should be now much more usable. Unicode can be -used in hash keys, Unicode in regular expressions should work now, -Unicode in tr/// should work now (though tr/// seems to be a -particularly tricky to get right, so you have been warned) +The Unicode Character Database coming with Perl has been upgraded +to Unicode 3.1.1. For more information, see http://www.unicode.org/. =item * -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 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 +the lib/unicore subdirectory. The most notable omission, for space considerations, is the Unihan database. =item * @@ -296,11 +274,6 @@ C<\s> doesn't.) =back -=head2 Signals Are Now Safe - -Perl used to be fragile in that signals arriving at inopportune moments -could corrupt Perl's internal state. - =head2 Understanding of Numbers In general a lot of fixing has happened in the area of Perl's @@ -309,10 +282,24 @@ many systems the standard number parsing functions like C and C seem to have bugs, Perl tries to work around their deficiencies. This results hopefully in more accurate numbers. +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.) + +=head2 Miscellaneous Enhancements + =over 4 =item * +AUTOLOAD is now lvaluable, meaning that you can add the :lvalue attribute +to AUTOLOAD subroutines and you can assign to the AUTOLOAD return value. + +=item * + C now works (previously one couldn't pass in multiple arguments.) @@ -326,14 +313,7 @@ L. =item * -Lexicals I: lexicals outside an eval "" weren't resolved -correctly inside a subroutine definition inside the eval "" if they -were not already referenced in the top level of the eval""ed code. - -=item * - -Lexicals II: lexicals leaked at file scope into subroutines that -were declared before the lexicals. +Formats now support zero-padded decimal fields. =item * @@ -355,6 +335,11 @@ is a NaN. Previously the behaviour was unspecified. =item * +The following builtin functions are now overridable: each(), keys(), +pop(), push(), shift(), splice(), unshift(). + +=item * + C can now be used to force a string to UTF8. =item * @@ -363,22 +348,26 @@ my __PACKAGE__ $obj now works. =item * -prototype(\&) is now available. +The printf() and sprintf() now support parameter reordering using the +C<%\d+\$> and C<*\d+\$> syntaxes. For example + + print "%2\$s %1\$s\n", "foo", "bar"; + +will print "bar foo\n"; This feature helps in writing +internationalised software. =item * -Right-hand side magic (GMAGIC) could in many cases such as string -concatenation be invoked too many times. +prototype(\&) is now available. =item * -The rules for allowing underscores (underbars) in numeric constants -have been relaxed and simplified: now you can have an underscore -simply B. +prototype(\[$@%&]) is now available to implicitly create references +(useful for example if you want to emulate the tie() interface). =item * -An UNTIE method is now available. +UNTIE method is now recognised. =item * @@ -387,7 +376,9 @@ file timestamps to the current time. =item * -C now works. +The rules for allowing underscores (underbars) in numeric constants +have been relaxed and simplified: now you can have an underscore +simply B. =back @@ -432,9 +423,10 @@ but if not possible, the familiar Perl implementation is used. =item * -C, from Kenneth Albanowski, has been added. It is -primarily used by C to enhance portability of of XS modules -between different versions of Perl. +C, originally from Kenneth Albanowski and now +maintained by Paul Marquess, has been added. It is primarily used +by C to enhance portability of of XS modules between different +versions of Perl. =item * @@ -453,7 +445,7 @@ RFC 1321, from Gisle Aas, has been added. See L. print $digest, "\n"; # 01d19d9d2045e005c3f1b80e8b164de1 NOTE: the C backward compatibility module is deliberately not -included since its use is discouraged. +included since its further use is discouraged. =item * @@ -631,7 +623,7 @@ to Quoted-Printable. See L. =item * C, by Russ Allbery, has been added, -to parse L<> links in pods as described in the new +to parse L<> links in pods as described in the new perlpodspec. =item * @@ -1114,14 +1106,15 @@ map() that changes the size of the list should now work faster. =item * -sort() has been changed to use 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 should be at least -20%. Additional bonuses are that the worst case behaviour of sort() -is now better (in computer science terms it now runs in time O(N log N), -as opposed to quicksort's Theta(N**2) worst-case run time behaviour), -and that sort() is now stable (meaning that elements with identical -keys will stay ordered as they were before the sort). +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 +should be at least 20%. Additional bonuses are that the worst case +behaviour of sort() is now better (in computer science terms it now +runs in time O(N log N), as opposed to quicksort's Theta(N**2) +worst-case run time behaviour), and that sort() is now stable +(meaning that elements with identical keys will stay ordered as they +were before the sort). See the C pragma for information. =item * @@ -1257,6 +1250,23 @@ site-wide changes). =item * +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 ... + +This will create in /tmp/perl/build/directory a tree of symbolic links +pointing to files in /path/to/perl/source. The original files are left +unaffected. After Configure has finished you can just say + + make all test + +and Perl will be built and tested, all in /tmp/perl/build/directory. + +=item * + For Perl developers several new make targets for profiling and debugging have been added, see L. @@ -1385,172 +1395,172 @@ however, you must specify -Dusedl in the arguments of Configure. =head1 Selected Bug Fixes -Numerous memory leaks and uninitialized memory accesses 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 * -Several debugger fixes: exit code now reflects the script exit code, -condition C<"0"> now treated correctly, the C command now checks -line number, the C<$.> no longer gets corrupted, all debugger output now -goes correctly to the socket if RemotePort is set. - -=item * - -C<*foo{FORMAT}> now works. +The autouse pragma didn't work for Multi::Part::Function::Names. =item * -Lexical warnings now propagating correctly between scopes. +chop(@list) in list context returned the characters chopped in +reverse order. This has been reversed to be in the right order. =item * -Line renumbering with eval and C<#line> now works. +Configure no longer includes the DBM libraries (dbm, gdbm, db, ndbm) +when building the Perl binary. The only exception to this is SunOS 4.x, +which needs them. =item * -Fixed numerous memory leaks, especially in eval "". +The behaviour of non-decimal but numeric string constants such as +"0x23" was platform-dependent: in some platforms that was seen as 35, +in some as 0, in some as a floating point number (don't ask). This +was caused by Perl using the operating system libraries in a situation +where the result of the string to number conversion is undefined: now +Perl consistently handles such strings as zero in numeric contexts. =item * -Modulus of unsigned numbers now works (4063328477 % 65535 used to -return 27406, instead of 27047). +The order of DESTROYs has been made more predictable. =item * -Some "not a number" warnings introduced in 5.6.0 eliminated to be -more compatible with 5.005. Infinity is now recognised as a number. +Several debugger fixes: exit code now reflects the script exit code, +condition C<"0"> now treated correctly, the C command now checks +line number, the C<$.> no longer gets corrupted, all debugger output now +goes correctly to the socket if RemotePort is set. =item * -our() variables will not cause "will not stay shared" warnings. +L -R didn't work. =item * -pack "Z" now correctly terminates the string with "\0". +C<*foo{FORMAT}> now works. =item * -Fix password routines which in some shadow password platforms -(e.g. HP-UX) caused getpwent() to return every other entry. +UNIVERSAL::isa no longer caches methods incorrectly. (This broke +the Tk extension with 5.6.0.) =item * -printf() no longer resets the numeric locale to "C". +Lexicals I: lexicals outside an eval "" weren't resolved +correctly inside a subroutine definition inside the eval "" if they +were not already referenced in the top level of the eval""ed code. =item * -C now parses correctly as C<'a\\b'>. +Lexicals II: lexicals leaked at file scope into subroutines that +were declared before the lexicals. =item * -Printing quads (64-bit integers) with printf/sprintf now works -without the q L ll prefixes (assuming you are on a quad-capable platform). +Lexical warnings now propagating correctly between scopes. =item * -Regular expressions on references and overloaded scalars now work. +Line renumbering with eval and C<#line> now works. =item * -scalar() now forces scalar context even when used in void context. +Fixed numerous memory leaks, especially in eval "". =item * -sort() arguments are now compiled in the right wantarray context -(they were accidentally using the context of the sort() itself). +mkdir() now ignores trailing slashes in the directory name, +as mandated by POSIX. =item * -Changed the POSIX character class C<[[:space:]]> to include the (very -rare) vertical tab character. Added a new POSIX-ish character class -C<[[:blank:]]> which stands for horizontal whitespace (currently, -the space and the tab). +Some versions of glibc have a broken modfl(). This affects builds +with C<-Duselongdouble>. This version of Perl detects this brokenness +and has a workaround for it. The glibc release 2.2.2 is known to have +fixed the modfl() bug. =item * -$AUTOLOAD, sort(), lock(), and spawning subprocesses -in multiple threads simultaneously are now thread-safe. +Modulus of unsigned numbers now works (4063328477 % 65535 used to +return 27406, instead of 27047). =item * -Allow read-only string on left hand side of non-modifying tr///. +Some "not a number" warnings introduced in 5.6.0 eliminated to be +more compatible with 5.005. Infinity is now recognised as a number. =item * -Several Unicode fixes (but still not perfect). - -=over 8 +Attributes (like :shared) didn't work with our(). =item * -BOMs (byte order marks) in the beginning of Perl files -(scripts, modules) should now be transparently skipped. -UTF-16 (UCS-2) encoded Perl files should now be read correctly. +our() variables will not cause "will not stay shared" warnings. =item * -The character tables have been updated to Unicode 3.0.1. +pack "Z" now correctly terminates the string with "\0". =item * -chr() for values greater than 127 now create utf8 when under use -utf8. +Fix password routines which in some shadow password platforms +(e.g. HP-UX) caused getpwent() to return every other entry. =item * -Comparing with utf8 data does not magically upgrade non-utf8 data into -utf8. +The PERL5OPT environment variable (for passing command line arguments +to Perl) didn't work for more than a single group of options. =item * -C, C, and C now match titlecase. +PERL5OPT with embedded spaces didn't work. =item * -Concatenation with the C<.> operator or via variable interpolation, -C, C, C, C, the C operator, -substitution with C, single-quoted UTF8, should now work--in -theory. +printf() no longer resets the numeric locale to "C". =item * -The C operator now works I better but is still rather -broken. Note that the C functionality has been removed (but -see pack('U0', ...)). +C now parses correctly as C<'a\\b'>. =item * -vec() now refuses to deal with characters >255. +Printing quads (64-bit integers) with printf/sprintf now works +without the q L ll prefixes (assuming you are on a quad-capable platform). =item * -Zero entries were missing from the Unicode classes like C. +Regular expressions on references and overloaded scalars now work. =item * -chop(@list) in list context returned the characters chopped in -reverse order. This has been reversed to be in the right order. +Right-hand side magic (GMAGIC) could in many cases such as string +concatenation be invoked too many times. =item * -The order of DESTROYs has been made more predictable. +scalar() now forces scalar context even when used in void context. =item * -mkdir() now ignores trailing slashes in the directory name, -as mandated by POSIX. +SOCKS support is now much more robust. =item * -Attributes (like :shared) didn't work with our(). +sort() arguments are now compiled in the right wantarray context +(they were accidentally using the context of the sort() itself). =item * -The PERL5OPT environment variable (for passing command line arguments -to Perl) didn't work for more than a single group of options. +Changed the POSIX character class C<[[:space:]]> to include the (very +rare) vertical tab character. Added a new POSIX-ish character class +C<[[:blank:]]> which stands for horizontal whitespace (currently, +the space and the tab). =item * @@ -1560,124 +1570,70 @@ behaviour consistent with that of string interpolation. =item * -All but the first argument of the IO syswrite() method are now optional. - -=item * - -Tie::ARRAY SPLICE method was broken. - -=item * - -vec() now tries to work with characters <= 255 when possible, but it leaves -higher character values in place. In that case, if vec() was used to modify -the string, it is no longer considered to be utf8-encoded. - -=item * - -The autouse pragma didn't work for Multi::Part::Function::Names. - -=item * - -The behaviour of non-decimal but numeric string constants such as -"0x23" was platform-dependent: in some platforms that was seen as 35, -in some as 0, in some as a floating point number (don't ask). This -was caused by Perl using the operating system libraries in a situation -where the result of the string to number conversion is undefined: now -Perl consistently handles such strings as zero in numeric contexts. - -=item * - -L -R didn't work. - -=item * - -PERL5OPT with embedded spaces didn't work. +L ignored the C constant. =item * -L ignored the C constant. +All but the first argument of the IO syswrite() method are now optional. =item * -Some versions of glibc have a broken modfl(). This affects builds -with C<-Duselongdouble>. This version of Perl detects this brokenness -and has a workaround for it. The glibc release 2.2.2 is known to have -fixed the modfl() bug. +$AUTOLOAD, sort(), lock(), and spawning subprocesses +in multiple threads simultaneously are now thread-safe. =item * -Linux previously had problems related to sockaddrlen when using -accept(), revcfrom() (in Perl: recv()), getpeername(), and getsockname(). +Tie::ARRAY SPLICE method was broken. =item * -Previously DYNIX/ptx had problems in its Configure probe for non-blocking I/O. +Allow read-only string on left hand side of non-modifying tr///. =item * -Windows +Several Unicode fixes. =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++). +BOMs (byte order marks) in the beginning of Perl files +(scripts, modules) should now be transparently skipped. +UTF-16 (UCS-2) encoded Perl files should now be read correctly. =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. +The character tables have been updated to Unicode 3.1.1. =item * -Duping socket handles with open(F, ">&MYSOCK") now works under Windows 9x. +Comparing with utf8 data does not magically upgrade non-utf8 data +into utf8. =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 Win32 binary distribution). - -=back - -=back +C, C, and C now match titlecase. =item * -UNIVERSAL::isa no longer caches methods incorrectly. (This broke -the Tk extension with 5.6.0.) +Concatenation with the C<.> operator or via variable interpolation, +C, C, C, C, the C operator, +substitution with C, single-quoted UTF8, should now work. =item * -Configure no longer includes the DBM libraries (dbm, gdbm, db, ndbm) -when building the Perl binary. The only exception to this is SunOS 4.x, -which needs them. +The C operator now works. Note that the C +functionality has been removed (but see pack('U0', ...)). =item * -SOCKS support is now much more robust. +C now works. =item * -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 ... - -This will create in /tmp/perl/build/directory a tree of symbolic links -pointing to files in /path/to/perl/source. The original files are left -unaffected. After Configure has finished you can just say - - make all test +Zero entries were missing from the Unicode classes like C. -and Perl will be built and tested, all in /tmp/perl/build/directory. +=back =back @@ -1705,6 +1661,10 @@ Numerous updates; currently synchronised with Cygwin 1.1.4. =item * +Previously DYNIX/ptx had problems in its Configure probe for non-blocking I/O. + +=item * + EPOC EPOC update after Perl 5.6.0. See README.epoc. @@ -1732,10 +1692,21 @@ of 32-bit and 64-bit libraries (a doomed attempt) made much harder. Linux +=over 8 + +=item * + Long doubles should now work (see INSTALL). =item * +Linux previously had problems related to sockaddrlen when using +accept(), revcfrom() (in Perl: recv()), getpeername(), and getsockname(). + +=back + +=item * + MacOS Classic Compilation of the standard Perl distribution in MacOS Classic should @@ -1804,10 +1775,20 @@ accept() no longer leaks memory. =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 * + Better chdir() return value for a non-existent directory. =item * +Duping socket handles with open(F, ">&MYSOCK") now works under Windows 9x. + +=item * + New %ENV entries now propagate to subprocesses. =item * @@ -1816,10 +1797,24 @@ $ENV{LIB} now used to search for libs under 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 * + A failed (pseudo)fork now returns undef and sets errno to EAGAIN. =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 Win32 binary distribution). + +=item * + Allow REG_EXPAND_SZ keys in the registry. =item *