3 perldelta - what's new for perl v5.7.0
7 This document describes differences between the 5.6.0 release and
10 =head1 Core Enhancements
16 C<perl -d:Module=arg,arg,arg> now works (previously one couldn't pass
17 in multiple arguments.)
21 Infinity (in numerical context, for example as "Inf", the exact string
22 representation is platform-dependent) doesn't cause "not a number"
27 my __PACKAGE__ now works.
31 no Module; now works even if there is no "sub unimport" in the Module.
35 The numerical comparison <=> now returns C<undef> if either operand is a NaN.
36 Previously the behaviour was unspecified.
40 C<pack('U0a*', ...)> can now be used to force the string to UTF8.
44 prototype(\&) is now available.
48 sort() is now re-entrant (sort() can call sort(), in other words)
52 =head1 Modules and Pragmata
56 The Storable extnesion, version 0.7.2, released the 14th of August
57 2000, has been added to the Perl distribution. Storable gives
58 persistence to Perl data structures by allowing to store and retrieve
59 Perl data to and from files in fast and compact binary format.
61 =head2 Updated And Improved Modules and Pragmata
67 The attributes::reftype() now works on tied arguments.
71 AutoLoader can now be `stopped' by
77 B::Deparse now understands sub attributes.
81 Data::Dumper now works on negative number on 32-bit platforms where IV
82 (the Perl's integer datatype) is greater than 32 bits. Also, large
83 unsigned numbers are now dumped as such, not as large negative numbers.
87 CGI has been updated to version 2.72, released
88 the 20th of August 2000.
92 CPAN has been updated to version 1.57, released
93 the 16th of August 2000.
97 DB_File has been updated to version 1.73, released the
102 The English module can now be used without the infamous performance
105 use English '-no_performance_hit';
107 (Assuming, of course, that one doesn't need the troublesome variables
108 C<$`>, C<$&>, or C<$'>.) Also, introduce C<@LAST_MATCH_START> and
109 C<@LAST_MATCH_END> English aliases for C<@-> and C<@+>.
113 File::Find now has pre- and postprocessing callbacks.
114 It also correctly changes directories when chasing symbolic links.
115 Callbacks doing (naughtily) "next;" instead of "return;" now work.
119 File::Glob::globI() rename to File::Glob::bsd_glob() to avoid
120 prototype mismatch with CORE::glob().
124 File::Spec has been updated to version 0.82, released the
129 File::Temp has been updated to version 0.10 (unpublished as the 20th
134 Getopt::Long has been updated to version 2.23_05, released the 2nd of
139 IO::Poll has been thoroughly fixed.
143 IO::Socket::INET now works when given an unknown service name with
148 IPC::Open3 now allows the use of numeric filedescriptors.
152 use lib now works identically to @INC. Removing directories
153 with 'no lib' now works.
157 Math::BigFloat now more robust (less "uninitialized" warnings).
161 Math::Complex now handles extreme values (e.g. 1E20-1E30i more) more
166 The podlators bundle has been updated to version 1.02, released the
167 25th of April 2000. It contains the modules Pod::Man 1.04, Pod::Text
168 2.04, and modules Pod::Text::Color and Pod::Text::Termcap (no version
173 Pod::LaTeX has been updated to version 0.52, released the 15th
178 Pod::Parser has been updated to version 1.17, released the 25th of
179 July 2000. It contains the modules Pod::Checker 1.20, Pod::Find 0.21,
180 Pod::InputObjects 1.13, Pod::ParseUtils 0.22, Pod::Parser 1.12,
181 Pod::Select 1.13, and Pod::Usage 1.13.
185 The subpragma 'debug' of the 're' pragma now produces cleaner output.
189 C<%INC> now localized in a Safe compartment so that use/require work.
193 SelfLoader no more loses C<$@> in AUTOLOAD.
197 The Shell module now has an OO interface.
201 Sys::Syslog now works on domain sockets. Also, a forked child
202 now exits correctly if it fails to open /dev/console.
206 Term::ANSIColor has been updated to version 1.03, released the 6th of
211 The Test module has been updated to version 1.14, released the 21st of June
212 1999. This is for all practical purposes identical to the previous release
213 of Test included with the Perl distribution, 1.13, but upgrading the module
214 stops the CPAN module from suggesting an upgrade.
218 Test::Harness output now prettier on failed test.
222 Text::Wrap::wtbrap now handles multiline strings properly.
226 UNIVERSAL::isa no more caches methods incorrectly.
230 =head1 Utility Changes
232 =head2 cperl-mode version 4.31
234 The Emacs perl mode (emacs/cperl-mode.el) has been updated to version 4.31.
238 Perlbug is now much more robust. It also sends the bug report to perl.org,
241 =head2 perlcc now more cc-like and more robust
243 The perlcc utility has been rewritten and its user interface (that is,
244 command line) is much more like that of the UNIX C compiler, cc.
246 =head2 xsubpp now understands embedded pod
248 The xsubpp utility for extension writers now understands POD
249 documentation embedded in the *.xs files.
251 =head1 Improved Documentation
257 In many places say "alphanumeric characters" instead of "word
258 characters" because that was what was meant.
262 Eradicate "array context" from the documentation and diagnostics.
266 The return values of a failing backtick (`, qx{}) are now documented
271 caller() return values now better documented.
275 SDBM_File, NDBM_File, ODBM_File, now tell about tying instead of
280 Document that the C<$(> special variable does not interpolate
281 in regular expressions.
285 Add an URL for FSF in README.
289 The timeout unit of IO::Select is now documented to be identical
290 to the timeout unit of the 4-arg select(), that is, (optionally
291 fractional) seconds, or an undef to wait indefinitely.
295 Document the C<D> and C<d> magic types.
299 The ordering of PODs in perl.pod is now more sensical.
303 perlbook now only mentions the Camel III, all other book references
304 have been moved to perlfaq2, some good known books added.
308 Numerous missing warning/error messages added to perldiag.
312 Tell what's perl6 in perlfaq1.
316 perlhack much extended.
324 Add perlxstut example for passing/returning refs to arrays.
328 POSIX module documentation embellished.
332 Clarify the status of shadow password support.
336 Remind that preprocessors and source filters can alter
337 your code before Perl sees it and therefore debugging
338 can be somewhat surprising. ("I didn't write *that*!")
342 Remove incorrect documentation about implicit split to @_
343 in list context, which never really worked in Perl 5 anyway.
347 Tell that split /^/ is split /^/m.
351 Many more sprintf() examples in perlfunc.
355 Document the handling of negative indices to tied arrays.
359 The C<$yday> in localtime()/gmtime() is 0..364, not 1..365.
363 Document that tr() is not tr(1): that is, do not expect regular expressions.
367 Warn about the vagaries of UDP.
371 The uninitialized variable warnings now say "concat or string" or
372 "join or string" instead of just "concat" or "join" since many users
373 found the "concat" a bit surprising when they were doing "just"
374 variable interpolation.
378 Document that the values() are copies, not aliases.
382 =head2 New Documentation
388 perl56delta details the changes between the 5.005 release and the
393 perl56delta is a Perl debugging tutorial.
397 perlebcdic contains considerations for running Perl on EBCDIC platforms.
398 Note that unfortunately EBCDIC platforms that used to supported back in
399 Perl 5.005 are still unsupported by Perl 5.7; the plan, however, is to
400 bring them back to the fold.
404 perlnewmod tells about writing and submitting a new module.
408 perlposix-bc explains using Perl on the POSIX-BC platform
409 (a mainframe platform).
413 perlretut is a regular expression tutorial.
417 perlrequick is regular expressions quick-start guide.
418 Yes, much quicker than perlretut.
422 perlutil explains the command line utilities packaged with the Perl
427 =head1 Security Vulnerability
429 A potential security vulnerability in the optional suidperl component
430 of Perl has been identified. The suidperl is neither built nor
431 installed by default. As of August the 20th 2000 the only known
432 vulnerable platform is Linux, most likely all Linux distributions.
433 The CERT and various vendors have been alerted about the vulnerability.
435 The problem was caused by Perl trying to report a suspected security
436 exploit attempt using an external program, /bin/mail. In Linux
437 platforms the /bin/mail program had an undocumented feature which gave
438 access to a root shell, resulting in a serious compromise, instead of
439 reporting the exploit attempt. If you don't have /bin/mail or if you
440 have 'safe suid scripts' or if you haven't installed the suidperl, you
443 The exploit attempt reporting feature has been completely removed from
444 the Perl 5.7.0 release, so that particular vulnerability isn't there
445 anymore. However, further security vulnerabilities are,
446 unfortunately, always possible. The suidperl code is being reviewed
447 and if deemed too risky to continue being supported, in the extreme
448 case it may be completely removed in future releases. In any case,
449 suidperl should only be used by security experts who know exactly what
450 they are doing and why are they using suidperl instead of some other solution.
451 A good tool for similar needs is sudo: http://www.courtesan.com/sudo/
453 =head1 Performance Enhancements
455 map() that changes the size of the list should now work faster.
457 =head1 Installation and Configuration Improvements
459 =head2 INSTALL now explains 64-bit configuration.
461 In some platforms Perl can be configured to use 64-bit integers,
462 allowing 4 billion times better...sorry, switched accidentally to
463 marketdroid mode for a moment in there. (In platforms which are
464 natively 64-bit this makes no difference.)
466 =head2 Policy.sh policy change
468 If you are reusing a Policy.sh file (see INSTALL) and you use
469 Configure -Dprefix=/foo/bar and in the old Policy $prefix eq
470 $siteprefix and $prefix eq $vendorprefix, all of them will now
471 be changed to the new prefix, /foo/bar. (Previously only $prefix
472 did change.) If you do not like this new behaviour, specify
473 prefix, siteprefix, and vendorprefix explicitly.
475 =head2 Additional Library Locations
477 A new optional location for Perl libraries, otherlibdirs, is available.
478 It can be used for example for vendor add-ons without disturbing Perl's
479 own library directories.
481 =head2 gcc automatically tried if 'cc' does not seem to be working
483 In many platforms the vendor-supplied 'cc' is too stripped-down to
484 build Perl (basically, the 'cc' doesn't do ANSI C). If this seems
485 to be the case and the 'cc' does not seem to be the GNU C compiler
486 'gcc', an automatic attempt is made to find and use 'gcc' instead.
488 =head2 If gcc seems to be from from a different operating system release ...
490 gcc needs to closely track the operating system release because gcc
491 wants to have its own versions of the operating system header files
492 fixed to be clean enough for gcc's tastes. Therefore using a gcc
493 compiled for a different release of the operating system is often a
494 bad idea. If Configure can find out the operating system release that
495 was used to compile the gcc and that release is different from the one
496 being used now, gcc gives a clearly visible warning that trouble may
499 =head2 If no binary compatibilty with 5.005 wanted, no 5.005 modules, either
501 If no binary compatibility with the 5.005 release is wanted, Configure
502 does not suggest including the 5.005 modules in the @INC.
504 =head2 Configuration and Installation fixes
510 Configure C<-S> can now run non-interactively
514 configure.gnu now works with options with whitespace in them
518 installperl now outputs everything to STDERR
522 $Config{byteorder} is now computed dynamically (this is more robust
523 with "fat binaries" where an executable image contains binaries for
524 more than one binary platform.)
528 =head1 Platform Specific Changes and Fixes
532 Perl now works on post-4.0 BSD/OSes.
536 Setting the C<$0> now works (as much as possible, see perlvar for details).
544 Numerous updates; currently synchronized with Cygwin 1.1.4.
550 EPOC update after Perl 5.6.0. The EPOC port home page is at
551 http://members.linuxstart.com/~oflebbe/perl/perl5.html
555 Perl now works on post-3.0 FreeBSDs.
563 Document that the C<perl -P> causes problems if one uses C<s/foo//>
564 (because the HP C compiler does funny things to that // thinking it
565 to be C++), document also the workaround.
569 C<Configure -Duse64bitall> now almost works (one failing test).
579 Numerous compilation flag and hint enhancements.
583 Accidental mixing of 32-bit and 64-bit libraries (a doomed attempt)
594 Long doubles should now work (see INSTALL).
604 Compilation of the standard Perl distribution in MacOS Classic should
605 now work--assuming you have the Metrowerks development environment and
606 the missing Mac-specific toolkit bits, contact the macperl mailing
613 MPE/iX update after Perl 5.6.0. The Perl/iX home page is at
614 http://www.bixby.org/mark/perlix.html
618 Perl now works on NetBSD/sparc.
626 Now works with usethreads (see INSTALL).
636 64-bitness using the Sun Workshop compiler now works.
640 =head2 Tru64 (aka Digital UNIX, aka DEC OSF/1)
646 Allow compiling with gcc (previously explicitly forbidden). Compiling
647 with gcc still not recommended because buggy code results, even with
652 The operating system version letter now recorded in $Config{osvers}.
662 Fixed various alignment problems that lead into core dumps either
663 during build or later.
667 No more dying on math errors in runtime.
671 Now using full quad integers (64 bits), previously was using
672 only 43 bit integers for speed.
682 chdir() now works better despite a CRT bug.
686 Now works with MULTIPLICITY (see INSTALL).
690 Now works with Perl's malloc.
700 accept() no more leaks memory.
704 Better chdir() return value for a non-existent directory.
708 New %ENV entries now propagate to subprocesses.
712 $ENV{LIB} now used to search for libs under Visual C.
716 A failed (pseudo)fork now returns undef and sets errno to EAGAIN.
720 Allow REG_EXPAND_SZ keys in the registry.
724 Can now send() from all threads, not just the first one.
728 Fake signal handling reenabled, bugs and all.
732 Less stack reserved per thread so that more threads can run
733 concurrently. (still 16M perl thread)
737 C<File::Spec->tmpdir()> now prefers C:/temp over /tmp
738 (works better when perl running as service).
742 Better UNC path handling under ithreads.
746 wait() and waitpid() now work much better.
750 winsock handle leak fixed.
754 =head1 Selected Bug Fixes
756 The following is by no means a comprehensive list of all the
763 Redefining constant subroutines using eval (again) warns.
767 Several debugger fixes: exit code now reflects the script exit code,
768 condition C<"0"> now treated correctly, the C<d> command now checks
769 line number, the C<$.> no more gets corrupted, all debugger output now
770 goes correctly to the socket if RemotePort is set.
774 C<*foo{FORMAT}> now works.
778 Lexical warnings now propagating correctly between scopes.
782 Line renumbering with eval and C<#line> now works.
786 Module name now mandatory after the C<-M> switch.
790 Fixed numerous memory leaks, especially in eval "".
794 Moduli of unsigned numbers now works (4063328477 % 65535 used to
795 return 27406, instead of 27047).
799 msgrcv() no more warns about uninitialized input scalar.
803 Some "not a number" warnings introduce in 5.6.0 eliminated to be
804 more compatible with 5.005.
808 out() variables will not cause "will not stay shared" warnings
812 The pack "Z" now correctly terminates the string with an "\0".
816 Fix password routines which in some shadow password platforms
817 (e.g. HP-UX) caused getpwent() to return every other entry.
821 POSIX::STDERR_FILENO (not POSIX::STRERR_FILENO).
825 printf() no more resets the numeric locale to "C".
829 C<q(a\\b)> now parses as C<'a\\b'>.
833 In quad (64-bit) platforms numbers now stay integers longer
834 (as opposed to converting automatically to floating point numbers).
838 Printing quads (64-bit integers) with printfs/sprintf works now
839 without q L ll prefixes (assuming you are on a quad-capable platform).
843 Regular expressions on references and overloaded scalars now work.
847 Multiline matching of C<"a\nxb\n" =~ /(?!\A)x/m> now works.
855 C</x{ab}/> now works.
859 scalar() now doesn't force scalar context when used in void context.
863 All the documented examples Shell.pm now work.
867 sort() arguments are now compiled in the right wantarray context
868 (were accidentally using the context of the sort() itself).
872 Changed the POSIX character class C<[[:space:]]> to include the (very
873 rare) vertical tabulator character. Added a new POSIX-ish character
874 class C<[[:blank:]] which stands for horizontal whitespace (currently,
875 the space and the tabulator).
879 sprintf() format specs like C<%v-*d> now work.
883 The (nonsensical) C<%#p> format made illegal.
887 C<${$1}> now works (again).
891 $AUTOLOAD, sort(), lock(), and spawning subprocesses
892 in multiple thread simultaneously are now thread-safe.
896 Allow non-variable as left-handside of non-updating tr///.
900 Several Unicode fixes (but still not perfect).
902 BOMs (byte order marks) in the beginning of Perl files
903 (scripts, modules) should now be transparently skipped.
905 The character tables have been updated to new Unicode 3.0 features.
907 chr() for values greater than 127 now create utf8 when under use
910 Comparing with utf8 data does not magically upgrade non-utf8 data into
913 C<IsAlnum>, C<IsAlpha>, and C<IsWord> now match titlecase.
915 Concatenation with the C<.> operator or via variable interpolation,
916 C<eq>, C<substr>, C<reverse>, C<quotemeta>, the C<x> operator,
917 substitution with C<s///>, single-quoted UTF8, should now work--in
920 The C<tr///> operator now works I<slightly> better but is still rather
921 broken. Note that the C<tr///CU> functionality has been removed (but
924 Zero entries were missing from the Unicode classes like C<IsDigit>.
928 Unsignedness could disappear from a scalar causing later numeric
933 vec() now drops numericalness.
937 =head1 New or Changed Diagnostics
939 All regular expression compilation error messages are now hopefully
940 easier to understand both because the error message now comes before
941 the failed regex and because the point of failure is now clearly
944 The various "opened only for", "on closed", "never opened" warnings
945 drop the C<main::> prefix for filehandles in the C<main> package,
946 for example C<STDIN> instead of <main::STDIN>.
952 (perhaps you forgot to load "%s"?)
954 (F) This is an educated guess made in conjunction with the message
955 "Can't locate object method \"%s\" via package \"%s\"". It often means
956 that a method requires a package that has not been loaded.
960 Ambiguous range in transliteration operator
962 (F) You wrote something like C<tr/a-z-0//> which doesn't mean anything at
963 all. To include a C<-> character in a transliteration, put it either
964 first or last. (In the past, C<tr/a-z-0//> was synonymous with
965 C<tr/a-y//>, which was probably not what you would have expected.)
969 The "Unrecgonized escape" warning has been extended to include C<\8>,
970 C<\9>, and C<\_>. There is no need to espace any of the C<\w> characters.
980 lib/b tests the various compiler backends (see L<perlcompile>).
984 lib/cgi-pretty tests CGI pretty printing.
988 lib/ftmp-*.t test File::Temp.
992 lib/gol-oo tests Getopt::Long objected-oriented interface.
996 lib/peek tests Devel::Peek.
1000 lib/selfloader tests SelfLoader.
1004 lib/syslog tests Sys::Syslog.
1008 op/bless tests bless().
1012 op/stash tests the "my Package ..." feature.
1016 op/regmesg exercises all various regex errors.
1020 pod/find tests Pod::Find.
1024 =head2 Improved Tests
1030 op/sprintf coverage is now of much more comprehensive.
1034 op/taint now continues on failed shmget().
1038 lib/*lfs.t now continues even if SIXFSZ happens.
1042 lib/syslog.t now works without sockets.
1046 =head1 Incompatible Changes
1048 =head2 Arrays Now Always Interpolate Into Double-Quoted Strings
1050 Constructs like "foo@bar" now always assume the C<@bar> to be an array,
1051 and not dependent on whether it is known whether that is an array or not.
1053 =head2 bless(REF, REF) is now a fatal error
1055 The semantics of bless(REF, REF) were unclear and until someone proves
1056 it to make some sense, it is forbidden.
1058 =head2 The eg/* Directory Removed
1060 The very dusty examples in the eg/ directory have been removed.
1061 Suggestions for new shiny examples welcome but the main issue is that
1062 the examples need to be documented, tested, and most importantly maintained.
1064 =head2 The lib/chat2.pl
1066 The obsolete chat2 library that should never have been allowed
1067 to escape the laboratory has been decommissioned.
1069 =head2 The Unimplemented (But Recognized) POSIX Regex Features Now Fatal
1071 The unimplemented POSIX regex features [[.cc.]] and [[=c=]] are
1072 recognized as before but now cause fatal runtime errors. The previous
1073 behaviour of ignoring them by default and warning if requested was
1074 unacceptable since it in a way falsely promised that the features
1077 =head2 lstat(FILEHANDLE) now warns
1079 lstat(FILEHANDLE) now gives a warning because the operation makes no sense.
1080 In future releases this may become a fatal error.
1082 =head2 Obsolete String Comparison Operators Removed
1084 The long since deprecated uppercase aliases for the string comparison
1085 operators (EQ, NE, LT, LE, GE, GT) have now been removed.
1087 =head2 The Regular Expression Submatches Are Now Unset When Backtracking
1089 The regular expression captured submatches ($1, $2, ...) are now
1090 consistently unset if the match fails, instead of leaving false
1091 data lying around in them.
1093 =head2 tr///CU Removed, Not To Return
1095 The tr///C and tr///U features have been removed and will not return,
1096 the interface was a mistake. Sorry about that. For similar
1097 functionality, see pack('U0', ...) and pack('C0', ...).
1099 =head1 Changed Internals
1103 The perlapi.pod now attempts to document the internal API
1104 (a companion to perlguts).
1108 There is now a way to build really minimal perl called microperl.
1109 Building does not require even running Configure, C<make -f Makefile.micro>
1110 should be enough. Beware: microperl makes many assumptions, some of
1111 which may be too bold, the resulting executable may crash or
1112 otherwise misbehave in wondrous ways. For careful hackers only.
1114 =head2 Publicize More Functions
1116 Added rsignal(), whichsig(), do_join() to the publicized API.
1118 =head2 Propagating Exception Objects via Perl_croak() IN XS code
1120 Made possible to propagate customized exceptions via croak()ing.
1122 =head2 UTF8 Interfaces
1124 Added is_utf8_char(), is_utf8_string(), bytes_to_utf8(), and utf8_to_bytes().
1126 =head2 xsub attributes
1128 Now xsubs can have attributes just like subs.
1130 =head1 Known Problems
1132 =head2 Unicode Support Still Far From Perfect
1134 We're working on it. Stay tuned.
1136 =head2 EBCDIC Still A Lost Platform
1138 The plan is to bring them back.
1140 =head2 Building Extensions Can Fail Because Of Largefiles
1142 Certain extensions like mod_perl and BSD::Resource are known to have
1143 issues with `largefiles', a change brought by Perl 5.6.0 in where file
1144 offsets are by default 64 bits wide (assuming the platform supports
1145 such large files). Modules may fail to compile at all or compile and
1146 work incorrectly. Currently there is no good solution for the problem
1147 but Configure now stores the flags and libraries that effect the
1148 largefileness to the %Config hash, the extensions that are having
1149 problems can try configuring themselves without the largefileness.
1150 This is admittedly not a clean solution.
1152 =head1 Obsolete Diagnostics
1154 =head1 Reporting Bugs
1156 If you find what you think is a bug, you might check the
1157 articles recently posted to the comp.lang.perl.misc newsgroup.
1158 There may also be information at http://www.perl.com/perl/, the Perl
1161 If you believe you have an unreported bug, please run the B<perlbug>
1162 program included with your release. Be sure to trim your bug down
1163 to a tiny but sufficient test case. Your bug report, along with the
1164 output of C<perl -V>, will be sent off to perlbug@perl.com to be
1165 analysed by the Perl porting team.
1169 The F<Changes> file for exhaustive details on what changed.
1171 The F<INSTALL> file for how to build Perl.
1173 The F<README> file for general stuff.
1175 The F<Artistic> and F<Copying> files for copyright information.
1179 Written by Jarkko Hietaniemi <F<jhi@iki.fi>>, with many contributions
1180 from The Perl Porters and Perl Users submitting feedback and patches.
1182 Send omissions or corrections to <F<perlbug@perl.com>>.