3 perldelta - what's new for perl v5.6 (as of v5.005_62)
7 This is an unsupported alpha release, meant for intrepid Perl developers
8 only. The included sources may not even build correctly on some platforms.
9 Subscribing to perl5-porters is the best way to monitor and contribute
10 to the progress of development releases (see www.perl.org for info).
12 This document describes differences between the 5.005 release and this one.
14 =head1 Incompatible Changes
16 =head2 Perl Source Incompatibilities
18 Beware that any new warnings that have been added are B<not> considered
21 Since all new warnings must be explicitly requested via the C<-w>
22 switch or the C<warnings> pragma, it is ultimately the programmer's
23 responsibility to ensure that warnings are enabled judiciously.
27 =item Possibly changed pseudo-random number generator
29 In 5.005_0x and earlier, perl's rand() function used the C library
30 rand(3) function. As of 5.005_52, Configure tests for drand48(),
31 random(), and rand() (in that order) and picks the first one it finds.
32 Perl programs that depend on reproducing a specific set of pseudo-random
33 numbers will now likely produce different output.
35 =item Hashing function for hash keys has changed
37 Perl hashes are not order preserving. The apparently random order
38 encountered when iterating on the contents of a hash is determined
39 by the hashing algorithm used. To improve the distribution of lower
40 bits in the hashed value, the algorithm has changed slightly as of
41 5.005_52. When iterating over hashes, this may yield a random order
42 that is B<different> from that of previous versions.
44 =item C<undef> fails on read only values
46 Using the C<undef> operator on a readonly value (such as $1) has
47 the same effect as assigning C<undef> to the readonly value--it
50 =item Close-on-exec bit may be set on pipe() handles
52 On systems that support a close-on-exec flag on filehandles, the
53 flag will be set for any handles created by pipe(), if that is
54 warranted by the value of $^F that may be in effect. Earlier
55 versions neglected to set the flag for handles created with
56 pipe(). See L<perlfunc/pipe> and L<perlvar/$^F>.
58 =item Writing C<"$$1"> to mean C<"${$}1"> is unsupported
60 Perl 5.004 deprecated the interpretation of C<$$1> and
61 similar within interpolated strings to mean C<$$ . "1">,
64 In Perl 5.6 and later, C<"$$1"> always means C<"${$1}">.
66 =item values(%h) and C<\(%h)> operate on aliases to values, not copies
68 each(), values() and hashes in a list context return the actual
69 values in the hash, instead of copies (as they used to in earlier
70 versions). Typical idioms for using these constructs copy the
71 returned values, but this is can make a significant difference when
72 creating references to the returned values.
74 Keys in the hash are still returned as copies when iterating on
77 =item vec(EXPR,OFFSET,BITS) enforces powers-of-two BITS
79 vec() generates a run-time error if the BITS arguments is not
80 a valid power-of-two integer.
82 =item Text of some diagnostic output has changed
84 Most references to internal Perl operations in diagnostics
85 have been changed to be more descriptive. This may be an
86 issue for programs that may incorrectly rely on the exact
87 text of diagnostics for proper functioning.
89 =item C<%@> has been removed
91 The undocumented special variable C<%@> that used to accumulate
92 "background" errors (such as those that happen in DESTROY())
93 has been removed, because it could potentially result in memory
98 =head2 C Source Incompatibilities
102 =item C<PERL_POLLUTE>
104 Release 5.005 grandfathered old global symbol names by providing preprocessor
105 macros for extension source compatibility. As of release 5.6, these
106 preprocessor definitions are not available by default. You need to explicitly
107 compile perl with C<-DPERL_POLLUTE> to get these definitions. For
108 extensions still using the old symbols, this option can be
109 specified via MakeMaker:
111 perl Makefile.PL POLLUTE=1
113 =item C<PERL_IMPLICIT_CONTEXT>
115 This new build option provides a set of macros for all API functions
116 such that an implicit interpreter/thread context argument is passed to
117 every API function. As a result of this, something like C<sv_setsv(foo,bar)>
118 amounts to a macro invocation that actually translates to something like
119 C<Perl_sv_setsv(my_perl,foo,bar)>. While this is generally expected
120 to not have any significant source compatibility issues, the difference
121 between a macro and a real function call will need to be considered.
123 This means that there B<is> a source compatibility issue as a result of
124 this if your extensions attempt to use pointers to any of the Perl API
127 Note that the above issue is not relevant to the default build of
128 Perl, whose interfaces continue to match those of prior versions
129 (but subject to the other options described here).
131 PERL_IMPLICIT_CONTEXT is automatically enabled whenever Perl is built
132 with one of -Dusethreads, -Dusemultiplicity, or both.
134 See L<perlguts/"The Perl API"> for detailed information on the
135 ramifications of building Perl using this option.
137 =item C<PERL_POLLUTE_MALLOC>
139 Enabling Perl's malloc in release 5.005 and earlier caused
140 the namespace of system versions of the malloc family of functions to
141 be usurped by the Perl versions, since by default they used the
144 Besides causing problems on platforms that do not allow these functions to
145 be cleanly replaced, this also meant that the system versions could not
146 be called in programs that used Perl's malloc. Previous versions of Perl
147 have allowed this behaviour to be suppressed with the HIDEMYMALLOC and
148 EMBEDMYMALLOC preprocessor definitions.
150 As of release 5.6, Perl's malloc family of functions have default names
151 distinct from the system versions. You need to explicitly compile perl with
152 C<-DPERL_POLLUTE_MALLOC> to get the older behaviour. HIDEMYMALLOC
153 and EMBEDMYMALLOC have no effect, since the behaviour they enabled is now
156 Note that these functions do B<not> constitute Perl's memory allocation API.
157 See L<perlguts/"Memory Allocation"> for further information about that.
159 =item C<PL_na> and C<dTHR> Issues
161 The C<PL_na> global is now thread local, so a C<dTHR> declaration is needed
162 in the scope in which the global appears. XSUBs should handle this automatically,
163 but if you have used C<PL_na> in support functions, you either need to
164 change the C<PL_na> to a local variable (which is recommended), or put in
169 =head2 Compatible C Source API Changes
173 =item C<PATCHLEVEL> is now C<PERL_VERSION>
175 The cpp macros C<PERL_REVISION>, C<PERL_VERSION>, and C<PERL_SUBVERSION>
176 are now available by default from perl.h, and reflect the base revision,
177 patchlevel, and subversion respectively. C<PERL_REVISION> had no
178 prior equivalent, while C<PERL_VERSION> and C<PERL_SUBVERSION> were
179 previously available as C<PATCHLEVEL> and C<SUBVERSION>.
181 The new names cause less pollution of the B<cpp> namespace and reflect what
182 the numbers have come to stand for in common practice. For compatibility,
183 the old names are still supported when F<patchlevel.h> is explicitly
184 included (as required before), so there is no source incompatibility
187 =item Support for C++ exceptions
189 change#3386, also needs perlguts documentation
190 [TODO - Chip Salzenberg <chip@perlsupport.com>]
194 =head2 Binary Incompatibilities
196 The default build of this release is binary compatible with the 5.005
197 release or its maintenance versions.
199 The usethreads or usemultiplicity builds are B<not> binary compatible
200 with the corresponding builds in 5.005.
202 =head1 Installation and Configuration Improvements
204 =head2 New Configure flags
206 The following new flags may be enabled on the Configure command line
207 by running Configure with C<-Dflag>.
215 =head2 -Dusethreads and -Duse64bits now more daring
217 The Configure options enabling the use of threads and the use of
218 64-bitness are now more daring in the sense that they no more have
219 an explicit list of operating systems of known threads/64-bit
220 capabilities. In other words: if your operating system has the
221 necessary APIs, you should be able just to go ahead and use them.
222 See also L<"64-bit support">.
226 Some platforms have "long doubles", floating point numbers of even
227 larger range than ordinary "doubles". To enable using ng doubles for
228 Perl's scalars, use -Duselongdouble.
232 You can enable both -Duse64bits and -Dlongdouble by -Dusemorebits.
233 See also L<"64-bit support">.
235 =head2 -Duselargefiles
237 Some platforms support large files, files larger than two gigabytes.
238 See L<"Large file support"> for more information.
240 =head2 installusrbinperl
242 You can use "Configure -Uinstallusrbinperl" which causes installperl
243 to skip installing perl also as /usr/bin/perl. This is useful if you
244 prefer not to modify /usr/bin for some reason or another but harmful
245 because many scripts assume to find Perl in /usr/bin/perl.
249 You can use "Configure -Dusesocks" which causes Perl to probe
250 for the SOCKS proxy protocol library, http://www.socks.nec.com/
254 You can "post-edit" the Configure variables using the Configure C<-A>
255 flag. The editing happens immediately after the platform specific
256 hints files have been processed but before the actual configuration
257 process starts. Run C<Configure -h> to find out the full C<-A> syntax.
259 =head2 New Installation Scheme
262 [TODO - Andy Dougherty <doughera@lafcol.lafayette.edu>]
266 =head2 Unicode and UTF-8 support
268 Perl can optionally use UTF-8 as its internal representation for character
269 strings. The C<utf8> pragma enables this support in the current lexical
270 scope. See L<utf8> for more information.
272 =head2 Lexically scoped warning categories
274 You can now control the granularity of warnings emitted by perl at a finer
275 level using the C<use warnings> pragma. See L<warnings> and L<perllexwarn>
278 =head2 Lvalue subroutines
280 WARNING: This is an experimental feature.
283 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>,
284 Tuomas Lukka <lukka@fas.harvard.edu>)]
286 =head2 "our" declarations
288 An "our" declaration introduces a value that can be best understood
289 as a lexically scoped symbolic alias to a global variable in the
290 current package. This is mostly useful as an alternative to the
291 C<vars> pragma, but also provides the opportunity to introduce
292 typing and other attributes for such variables. See L<perlfunc/our>.
294 =head2 Weak references
296 WARNING: This is an experimental feature.
298 change#3385, also need perlguts documentation
300 [TODO - Tuomas Lukka <lukka@fas.harvard.edu>]
302 =head2 Binary numbers supported
304 Binary numbers are now supported as literals, in s?printf formats, and
308 printf "The answer is: %b\n", oct("0b101010");
310 =head2 Some arrows may be omitted in calls through references
312 Perl now allows the arrow to be omitted in many constructs
313 involving subroutine calls through references. For example,
314 C<$foo[10]->('foo')> may now be written C<$foo[10]('foo')>.
315 This is rather similar to how the arrow may be omitted from
316 C<$foo[10]->{'foo'}>. Note however, that the arrow is still
317 required for C<foo(10)->('bar')>.
319 =head2 syswrite() ease-of-use
321 The length argument of C<syswrite()> has become optional.
323 =head2 Filehandles can be autovivified
325 The construct C<open(my $fh, ...)> can be used to create filehandles
326 more easily. The filehandle will be automatically closed at the end
327 of the scope of $fh, provided there are no other references to it. This
328 largely eliminates the need for typeglobs when opening filehandles
329 that must be passed around, as in the following example:
333 or die "Can't open '@_': $!";
338 my $f = myopen("</etc/motd");
340 # $f implicitly closed here
343 [TODO - this idiom needs more pod penetration]
345 =head2 64-bit support
347 All platforms that have 64-bit integers either (a) natively as longs
348 or ints (b) via special compiler flags (c) using long long are able to
349 use "quads" (64-integers) as follows:
355 constants (decimal, hexadecimal, octal, binary) in the code
359 arguments to oct() and hex()
363 arguments to print(), printf() and sprintf() (flag prefixes ll, L, q)
371 pack() and unpack() "q" and "Q" formats
375 in basic arithmetics: + - * / %
379 vec() (but see the below note about bit arithmetics)
383 Note that unless you have the case (a) you will have to configure
384 and compile Perl using the -Duse64bits Configure flag.
386 Unfortunately bit arithmetics (&, |, ^, ~, <<, >>) for numbers are not
387 64-bit clean, they are explictly forced to be 32-bit. Bit arithmetics
388 for bit vectors (created by vec()) are not limited in their width.
390 Last but not least: note that due to Perl's habit of always using
391 floating point numbers the quads are still not true integers.
392 When quads overflow their limits (0...18_446_744_073_709_551_615 unsigned,
393 -9_223_372_036_854_775_808...9_223_372_036_854_775_807 signed), they
394 are silently promoted to floating point numbers, after which they will
395 start losing precision (their lower digits).
397 =head2 Large file support
399 If you have filesystems that support "large files" (files larger than
400 2 gigabytes), you may now also be able to create and access them from
401 Perl. You have to use Configure -Duselargefiles. Turning on the
402 large file support turns on also the 64-bit support, for obvious reasons.
404 Note that in addition to requiring a proper file system to do large
405 files you may also need to adjust your per-process (or your
406 per-system, or per-process-group, or per-user-group) maximum filesize
407 limits before running Perl scripts that try to handle large files,
408 especially if you intend to write such files.
410 Finally, in addition to your process/process group maximum filesize
411 limits, you may have quota limits on your filesystems that stop you
412 (your user id or your user group id) from using large files.
414 Adjusting your process/user/group/file system/operating system limits
415 is outside the scope of Perl core language. For process limits, you
416 may try increasing the limits using your shell's limits/limit/ulimit
417 command before running Perl. The BSD::Resource extension (not
418 included with the standard Perl distribution) may also be of use, it
419 offers the getrlimit/setrlimit interface that can be used to adjust
420 process resource usage limits, including the maximum filesize limit.
424 In some systems you may be able to use long doubles to enhance the
425 range of precision of your double precision floating point numbers
426 (that is, Perl's numbers). Use Configure -Duselongdouble to enable
427 this support (if it is available).
431 You can Configure -Dusemorebits to turn on both the 64-bit support
432 and the long double support.
434 =head2 Better syntax checks on parenthesized unary operators
438 print defined(&foo,&bar,&baz);
439 print uc("foo","bar","baz");
442 used to be accidentally allowed in earlier versions, and produced
443 unpredictable behaviour. Some produced ancillary warnings
444 when used in this way; others silently did the wrong thing.
446 The parenthesized forms of most unary operators that expect a single
447 argument now ensure that they are not called with more than one
448 argument, making the cases shown above syntax errors. The usual
451 print defined &foo, &bar, &baz;
452 print uc "foo", "bar", "baz";
455 remains unchanged. See L<perlop>.
457 =head2 POSIX character class syntax [: :] supported
459 For example to match alphabetic characters use /[[:alpha:]]/.
460 See L<perlre> for details.
462 =head2 Improved C<qw//> operator
464 The C<qw//> operator is now evaluated at compile time into a true list
465 instead of being replaced with a run time call to C<split()>. This
466 removes the confusing misbehaviour of C<qw//> in scalar context, which
467 had inherited that behaviour from split().
471 $foo = ($bar) = qw(a b c); print "$foo|$bar\n";
473 now correctly prints "3|a", instead of "2|a".
475 =head2 pack() format 'Z' supported
477 The new format type 'Z' is useful for packing and unpacking null-terminated
478 strings. See L<perlfunc/"pack">.
480 =head2 pack() format modifier '!' supported
482 The new format type modifier '!' is useful for packing and unpacking
483 native shorts, ints, and longs. See L<perlfunc/"pack">.
485 =head2 pack() and unpack() support counted strings
487 The template character '/' can be used to specify a counted string
488 type to be packed or unpacked. See L<perlfunc/"pack">.
490 =head2 Comments in pack() templates
492 The '#' character in a template introduces a comment up to
493 end of the line. This facilitates documentation of pack()
496 =head2 $^X variables may now have names longer than one character
498 Formerly, $^X was synonymous with ${"\cX"}, but $^XY was a syntax
499 error. Now variable names that begin with a control character may be
500 arbitrarily long. However, for compatibility reasons, these variables
501 I<must> be written with explicit braces, as C<${^XY}> for example.
502 C<${^XYZ}> is synonymous with ${"\cXYZ"}. Variable names with more
503 than one control character, such as C<${^XY^Z}>, are illegal.
505 The old syntax has not changed. As before, `^X' may be either a
506 literal control-X character or the two-character sequence `caret' plus
507 `X'. When braces are omitted, the variable name stops after the
508 control character. Thus C<"$^XYZ"> continues to be synonymous with
509 C<$^X . "YZ"> as before.
511 As before, lexical variables may not have names beginning with control
512 characters. As before, variables whose names begin with a control
513 character are always forced to be in package `main'. All such variables
514 are reserved for future extensions, except those that begin with
515 C<^_>, which may be used by user programs and are guaranteed not to
516 acquire special meaning in any future version of Perl.
518 =head2 C<use attrs> implicit in subroutine attributes
520 Formerly, if you wanted to mark a subroutine as being a method call or
521 as requiring an automatic lock() when it is entered, you had to declare
522 that with a C<use attrs> pragma in the body of the subroutine.
523 That can now be accomplished with a declaration syntax, like this:
525 sub mymethod : locked, method ;
527 sub mymethod : locked, method {
531 F<AutoSplit.pm> and F<SelfLoader.pm> have been updated to keep the attributes
532 with the stubs they provide. See L<attributes>.
534 =head2 Regular expression improvements
536 change#2827,2373,2372,2365,1813,1800,4112,4158,4215,4301
537 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
539 =head2 Overloading improvements
542 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
544 =head2 open() with more than two arguments
546 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
548 =head2 Support for interpolating named characters
551 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
553 =head2 Experimental support form user-hooks in @INC
555 [TODO - Ken Fox <kfox@ford.com>]
557 =head2 C<require> and C<do> may be overridden
559 C<require> and C<do 'file'> operations may be overridden locally
560 by importing subroutines of the same name into the current package
561 (or globally by importing them into the CORE::GLOBAL:: namespace).
562 Overriding C<require> will also affect C<use>, provided the override
563 is visible at compile-time.
564 See L<perlsub/"Overriding Built-in Functions">.
566 =head2 New variable $^C reflects C<-c> switch
568 C<$^C> contains a boolean that reflects whether perl is being run
569 in compile-only mode (i.e. via the C<-c> switch). Since
570 BEGIN blocks are executed under such conditions, this variable
571 enables perl code to determine whether actions that make sense
572 only during normal running are warranted. See L<perlvar>.
574 =head2 Optional Y2K warnings
576 If Perl is built with the cpp macro C<PERL_Y2KWARN> defined,
577 it emits optional warnings when concatenating the number 19
580 This behavior must be specifically enabled when running Configure.
581 See L<INSTALL> and L<README.Y2K>.
583 =head1 Significant bug fixes
585 =head2 E<lt>HANDLEE<gt> on empty files
587 With C<$/> set to C<undef>, slurping an empty file returns a string of
588 zero length (instead of C<undef>, as it used to) the first time the
589 HANDLE is read. Further reads yield C<undef>.
591 This means that the following will append "foo" to an empty file (it used
594 perl -0777 -pi -e 's/^/foo/' empty_file
598 perl -pi -e 's/^/foo/' empty_file
600 is unchanged (it continues to leave the file empty).
602 =head2 C<eval '...'> improvements
604 Line numbers (as reflected by caller() and most diagnostics) within
605 C<eval '...'> were often incorrect when here documents were involved.
606 This has been corrected.
608 Lexical lookups for variables appearing in C<eval '...'> within
609 functions that were themselves called within an C<eval '...'> were
610 searching the wrong place for lexicals. The lexical search now
611 correctly ends at the subroutine's block boundary.
613 Parsing of here documents used to be flawed when they appeared as
614 the replacement expression in C<eval 's/.../.../e'>. This has
617 =head2 All compilation errors are true errors
619 Some "errors" encountered at compile time were by neccessity
620 generated as warnings followed by eventual termination of the
621 program. This enabled more such errors to be reported in a
622 single run, rather than causing a hard stop at the first error
623 that was encountered.
625 The mechanism for reporting such errors has been reimplemented
626 to queue compile-time errors and report them at the end of the
627 compilation as true errors rather than as warnings. This fixes
628 error messages that used to leak through as warnings when code
629 was compiled at run time using C<eval STRING>, and allows such
630 errors to be reliably trapped using __DIE__ hooks.
632 =head2 Automatic flushing of output buffers
634 fork(), exec(), system(), qx//, and pipe open()s now flush buffers
635 of all files opened for output when the operation
636 was attempted. This mostly eliminates confusing
637 buffering mishaps suffered by users unaware of how Perl internally
640 =head2 Better diagnostics on meaningless filehandle operations
642 Constructs such as C<open(E<lt>FHE<gt>)> and C<close(E<lt>FHE<gt>)>
643 are compile time errors. Attempting to read from filehandles that
644 were opened only for writing will now produce warnings (just as
645 writing to read-only filehandles does).
647 =head2 Where possible, buffered data discarded from duped input filehandle
649 C<open(NEW, "E<lt>&OLD")> now attempts to discard any data that
650 was previously read and buffered in C<OLD> before duping the handle.
651 On platforms where doing this is allowed, the next read operation
652 on C<NEW> will return the same data as the corresponding operation
653 on C<OLD>. Formerly, it would have returned the data from the start
654 of the following disk block instead.
656 =head2 system(), backticks and pipe open now reflect exec() failure
658 On Unix and similar platforms, system(), qx() and open(FOO, "cmd |")
659 etc., are implemented via fork() and exec(). When the underlying
660 exec() fails, earlier versions did not report the error properly,
661 since the exec() happened to be in a different process.
663 The child process now communicates with the parent about the
664 error in launching the external command, which allow these
665 constructs to return with their usual error value and set $!.
667 =head2 Implicitly closed filehandles are safer
669 Sometimes implicitly closed filehandles (as when they are localized,
670 and Perl automatically closes them on exiting the scope) could
671 inadvertently set $? or $!. This has been corrected.
673 =head2 C<(\$)> prototype and C<$foo{a}>
675 An scalar reference prototype now correctly allows a hash or
676 array element in that slot.
678 =head2 Pseudo-hashes work better
680 Dereferencing some types of reference values in a pseudo-hash,
681 such as C<$ph->{foo}[1]>, was accidentally disallowed. This has
684 When applied to a pseudo-hash element, exists() now reports whether
685 the specified value exists, not merely if the key is valid.
687 =head2 C<goto &sub> and AUTOLOAD
689 C<goto &sub> construct works correctly when C<&sub> happens
692 =head2 C<-bareword> allowed under C<use integer>
694 The autoquoting of barewords preceded by C<-> did not work
695 in prior versions when the C<integer> pragma was enabled.
698 =head2 Boolean assignment operators are legal lvalues
700 Constructs such as C<($a ||= 2) += 1> are now allowed.
702 =head2 C<sort $coderef @foo> allowed
704 sort() did not accept a subroutine reference as the comparison
705 function in earlier versions. This has been fixed.
707 =head2 Failures in DESTROY()
709 When code in a destructor threw an exception, it went unnoticed
710 in earlier versions of Perl, unless someone happened to be
711 looking in $@ just after the point the destructor happened to
712 run. Such failures are now visible as warnings when warnings are
715 =head2 Locale bugs fixed
717 printf() and sprintf() previously did reset the numeric locale
718 back to the default "C" locale. This has been fixed.
720 Numbers formatted according to the local numeric locale
721 (such as using a decimal comma instead of a decimal dot) caused
722 "isn't numeric" warnings, even while the operations accessing
723 those numbers produced correct results. The warnings are gone.
727 The C<eval 'return sub {...}'> construct could sometimes leak
728 memory. This has been fixed.
730 Operations that aren't filehandle constructors used to leak memory
731 when used on invalid filehandles. This has been fixed.
733 Constructs that modified C<@_> could fail to deallocate values
734 in C<@_> and thus leak memory. This has been corrected.
736 =head2 Spurious subroutine stubs after failed subroutine calls
738 Perl could sometimes create empty subroutine stubs when a
739 subroutine was not found in the package. Such cases stopped
740 later method lookups from progressing into base packages.
741 This has been corrected.
743 =head2 Consistent numeric conversions
746 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
748 =head2 Taint failures under C<-U>
750 When running in unsafe mode, taint violations could sometimes
751 cause silent failures. This has been fixed.
753 =head2 END blocks and the C<-c> switch
755 Prior versions used to run BEGIN B<and> END blocks when Perl was
756 run in compile-only mode. Since this is typically not the expected
757 behavior, END blocks are not executed when the C<-c> switch
760 Note that something resembling the previous behavior can still be
761 obtained by putting C<BEGIN { $^C = 0; exit; } at the very end of
762 the top level source file.
764 =head2 Potential to leak DATA filehandles
766 Using the C<__DATA__> token creates an implicit filehandle to
767 the file that contains the token. It is the program's
768 responsibility to close it when it is done reading from it.
770 This caveat is now better explained in the documentation.
773 =head2 Diagnostics follow STDERR
775 Diagnostic output now goes to whichever file the C<STDERR> handle
776 is pointing at, instead of always going to the underlying C runtime
779 =head2 Other fixes for better diagnostics
781 Line numbers are suppressed no more (under most likely circumstances)
782 during the global destruction phase.
784 Diagnostics emitted from code running in threads other than the main
785 thread are now accompanied by the thread ID.
787 Embedded null characters in diagnostics now actually show up. They
788 used to truncate the message in prior versions.
790 $foo::a and $foo::b are now exempt from "possible typo" warnings only
791 if sort() is encountered in package foo.
793 Unrecognized alphabetic escapes encountered when parsing quoting
794 constructs now generate a warning, since they may take on new
795 semantics in later versions of Perl.
797 =head1 Performance enhancements
799 =head2 Simple sort() using { $a <=> $b } and the like are optimized
801 Many common sort() opertions using a simple inlined block are now
802 optimized for faster performance.
804 =head2 Optimized assignments to lexical variables
806 Certain operations in the RHS of assignment statements have been
807 optimized to directly set the lexical variable on the LHS,
808 eliminating redundant copying overheads.
810 =head2 Method lookups optimized
812 [TODO - Chip Salzenberg <chip@perlsupport.com>]
814 =head2 Faster mechanism to invoke XSUBs
817 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
819 =head2 Perl_malloc() improvements
822 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
824 =head2 Faster subroutine calls
826 Minor changes in how subroutine calls are handled internally
827 provide marginal improvements in performance.
829 =head1 Platform specific changes
831 =head2 Additional supported platforms
837 VM/ESA is now supported.
841 Siemens BS2000 is now supported under the POSIX Shell.
845 The Mach CThreads (NEXTSTEP, OPENSTEP) are now supported by the Thread
850 GNU/Hurd is now supported.
854 Rhapsody is now supported.
858 EPOC is is now supported (on Psion 5).
864 [TODO - Laszlo Molnar <laszlo.molnar@eth.ericsson.se>]
868 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
872 [TODO - Charles Bailey <bailey@newman.upenn.edu>]
876 Site library searches failed to look for ".../site/5.XXX/lib"
877 if ".../site/5.XXXYY/lib" wasn't found. This has been corrected.
879 When given a pathname that consists only of a drivename, such
880 as C<A:>, opendir() and stat() now use the current working
881 directory for the drive rather than the drive root.
883 The builtin XSUB functions in the Win32:: namespace are
884 documented. See L<Win32>.
886 $^X now contains the full path name of the running executable.
888 A Win32::GetLongPathName() function is provided to complement
889 Win32::GetFullPathName() and Win32::GetShortPathName(). See L<Win32>.
891 POSIX::uname() is supported.
893 system(1,...) now returns true process IDs rather than process
894 handles. kill() accepts any real process id, rather than strictly
895 return values from system(1,...).
897 The C<Shell> module is supported.
907 Compatibility tests for C<sub : attrs> vs the older C<use attrs>.
911 IO constants (SEEK_*, _IO*).
915 Directory-related IO methods (new, read, close, rewind, tied delete).
917 =item lib/io_multihomed
919 INET sockets with multi-homed hosts.
931 Regression tests for C<my ($x,@y,%z) : attrs> and <sub : attrs>.
939 Verify operations that access pad objects (lexicals and temporaries).
943 =head1 Modules and Pragmata
951 While used internally by Perl as a pragma, this module also
952 provides a way to fetch subroutine and variable attributes.
957 [TODO - Vishal Bhatia <vishal@gol.com>,
958 Nick Ing-Simmons <nick@ni-s.u-net.com>]
962 The ByteLoader is a dedicated extension to generate and run
963 Perl bytecode. See L<ByteLoader>.
967 The Perl Compiler suite has been extensively reworked for this
972 References can now be used. See L<constant>.
977 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
981 A C<Maxdepth> setting can be specified to avoid venturing
982 too deeply into data structures that may be very deep.
985 Dumping C<qr//> objects works correctly.
989 C<DB> is an experimental module that exposes a clean abstraction
990 to Perl's debugging API.
994 [TODO - Paul Marquess <paul.marquess@bt.com>]
998 Devel::DProf, a Perl source code profiler has been added. See L<DProf>.
1002 Added Dumpvalue module provides screen dumps of Perl data.
1006 You can now run tests for I<n> seconds instead of guessing the right
1007 number of tests to run: e.g. timethese(-5, ...) will run each
1008 code for at least 5 CPU seconds. Zero as the "number of repetitions"
1009 means "for at least 3 CPU seconds". The output format has also
1010 changed. For example:
1012 use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
1014 will now output something like this:
1016 Benchmark: running a, b, each for at least 5 CPU seconds...
1017 a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516)
1018 b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686)
1020 New features: "each for at least N CPU seconds...", "wallclock secs",
1021 and the "@ operations/CPU second (n=operations)".
1023 change#4265,4266,4292
1024 [TODO - Barrie Slaymaker <barries@slaysys.com>]
1028 The Devel::Peek module provides access to the internal representation
1029 of Perl variables and data. It is a data debugging tool for the XS programmer.
1031 =item ExtUtils::MakeMaker
1033 change#4135, also needs docs in module pod
1034 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
1038 More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for
1039 large (more than 4G) file access (64-bit support is not yet
1040 working, though, so no need to get overly excited), Free/Net/OpenBSD
1041 locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and
1042 O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR.
1046 A compare_text() function has been added, which allows custom
1047 comparison functions. See L<File::Compare>.
1051 File::Find now works correctly when the wanted() function is either
1052 autoloaded or is a symbolic reference.
1054 A bug that cause File::Find to lose track of the working directory
1055 when pruning top-level directories has been fixed.
1059 New methods have been added to the File::Spec module: devnull() returns
1060 the name of the null device (/dev/null on Unix) and tmpdir() the name of
1061 the temp directory (normally /tmp on Unix). There are now also methods
1062 to convert between absolute and relative filenames: abs2rel() and
1063 rel2abs(). For compatibility with operating systems that specify volume
1064 names in file paths, the splitpath(), splitdir(), and catdir() methods
1067 =item File::Spec::Functions
1069 The new File::Spec::Functions modules provides a function interface
1070 to the File::Spec module. Allows shorthand
1072 $fullname = catfile($dir1, $dir2, $file);
1076 $fullname = File::Spec->catfile($dir1, $dir2, $file);
1080 [TODO - Johan Vromans <jvromans@squirrel.nl>]
1084 write() and syswrite() will now accept a single-argument
1085 form of the call, for consistency with Perl's syswrite().
1087 You can now create a TCP-based IO::Socket::INET without forcing
1088 a connect attempt. This allows you to configure its options
1089 (like making it non-blocking) and then call connect() manually.
1091 A bug that prevented the IO::Socket::protocol() accessor
1092 from ever returning the correct value has been corrected.
1096 Java Perl Lingo is now distributed with Perl. See jpl/README
1097 for more information.
1101 The logical operations C<E<lt>E<lt>>, C<E<gt>E<gt>>, C<&>, C<|>,
1102 and C<~> are now supported on bigints.
1106 The accessor methods Re, Im, arg, abs, rho, and theta can now also
1107 act as mutators (accessor $z->Re(), mutator $z->Re(3)).
1111 A little bit of radial trigonometry (cylindrical and spherical),
1112 radial coordinate conversions, and the great circle distance were added.
1116 [TODO - Brad Appleton <bradapp@enteract.com>]
1118 =item Pod::Text and Pod::Man
1120 [TODO - Russ Allbery <rra@stanford.edu>]
1124 An EXISTS method has been added to this module (and sdbm_exists() has
1125 been added to the underlying sdbm library), so one can now call exists
1126 on an SDBM_File tied hash and get the correct result, rather than a
1129 A bug that may have caused data loss when more than one disk block
1130 happens to be read from the database in a single FETCH() has been
1135 The timelocal() and timegm() functions used to silently return bogus
1136 results when the date exceeded the machine's integer range. They
1137 now consistently croak() if the date falls in an unsupported range.
1141 The error return value in list context has been changed for all functions
1142 that return a list of values. Previously these functions returned a list
1143 with a single element C<undef> if an error occurred. Now these functions
1144 return the empty list in these situations. This applies to the following
1150 The remaining functions are unchanged and continue to return C<undef> on
1151 error even in list context.
1153 The Win32::SetLastError(ERROR) function has been added as a complement
1154 to the Win32::GetLastError() function.
1156 The new Win32::GetFullPathName(FILENAME) returns the full absolute
1157 pathname for FILENAME in scalar context. In list context it returns
1158 a two-element list containing the fully qualified directory name and
1163 A new feature called "DBM Filters" has been added to all the
1164 DBM modules--DB_File, GDBM_File, NDBM_File, ODBM_File, and SDBM_File.
1165 DBM Filters add four new methods to each DBM module:
1172 These can be used to filter key-value pairs before the pairs are
1173 written to the database or just after they are read from the database.
1174 See L<perldbmfilter> for further information.
1180 C<use attrs> is now obsolescent, and is only provided for
1181 backward-compatibility. It's been replaced by the C<sub : attributes>
1182 syntax. See L<perlsub/"Subroutine Attributes"> and L<attributes>.
1184 C<use utf8> to enable UTF-8 and Unicode support.
1186 C<use caller 'encoding'> allows modules to inherit pragmatic attributes
1187 from the caller's context. C<encoding> is currently the only supported
1190 Lexical warnings pragma, C<use warnings;>, to control optional warnings.
1193 C<use filetest> to control the behaviour of filetests (C<-r> C<-w>
1194 ...). Currently only one subpragma implemented, "use filetest
1195 'access';", that uses access(2) or equivalent to check permissions
1196 instead of using stat(2) as usual. This matters in filesystems
1197 where there are ACLs (access control lists): the stat(2) might lie,
1198 but access(2) knows better.
1200 =head1 Utility Changes
1204 [TODO - Kurt Starsinic <kstar@chapin.edu>]
1208 C<perlcc> now supports the C and Bytecode backends. By default,
1209 it generates output from the simple C backend rather than the
1210 optimized C backend.
1212 Support for non-Unix platforms has been improved.
1217 [TODO - Ilya Zakharevich <ilya@math.ohio-state.edu>]
1219 =head1 Documentation Changes
1223 =item perlopentut.pod
1225 A tutorial on using open() effectively.
1227 =item perlreftut.pod
1229 A tutorial that introduces the essentials of references.
1233 A tutorial on managing class data for object modules.
1235 =item perlcompile.pod
1237 An introduction to using the Perl Compiler suite.
1241 =head1 New Diagnostics
1243 =item "my sub" not yet implemented
1245 (F) Lexically scoped subroutines are not yet implemented. Don't try that
1248 =item %s package attribute may clash with future reserved word: %s
1250 (W) A lowercase attribute name was used that had a package-specific handler.
1251 That name might have a meaning to Perl itself some day, even though it
1252 doesn't yet. Perhaps you should use a mixed-case attribute name, instead.
1255 =item /%s/: Unrecognized escape \\%c passed through
1257 (W) You used a backslash-character combination which is not recognized
1258 by Perl. This combination appears in an interpolated variable or a
1259 C<'>-delimited regular expression.
1261 =item Filehandle %s opened only for output
1263 (W) You tried to read from a filehandle opened only for writing. If you
1264 intended it to be a read-write filehandle, you needed to open it with
1265 "+E<lt>" or "+E<gt>" or "+E<gt>E<gt>" instead of with "E<lt>" or nothing. If
1266 you intended only to read from the file, use "E<lt>". See
1269 =item Invalid %s attribute: %s
1271 The indicated attribute for a subroutine or variable was not recognized
1272 by Perl or by a user-supplied handler. See L<attributes>.
1274 =item Invalid %s attributes: %s
1276 The indicated attributes for a subroutine or variable were not recognized
1277 by Perl or by a user-supplied handler. See L<attributes>.
1279 =item Invalid separator character %s in attribute list
1281 (F) Something other than a comma or whitespace was seen between the
1282 elements of an attribute list. If the previous attribute
1283 had a parenthesised parameter list, perhaps that list was terminated
1284 too soon. See L<attributes>.
1286 =item Missing command in piped open
1288 (W) You used the C<open(FH, "| command")> or C<open(FH, "command |")>
1289 construction, but the command was missing or blank.
1291 =item Missing name in "my sub"
1293 (F) The reserved syntax for lexically scoped subroutines requires that they
1294 have a name with which they can be found.
1296 =item Unrecognized escape \\%c passed through
1298 (W) You used a backslash-character combination which is not recognized
1301 =item Unterminated attribute parameter in attribute list
1303 (F) The lexer saw an opening (left) parenthesis character while parsing an
1304 attribute list, but the matching closing (right) parenthesis
1305 character was not found. You may need to add (or remove) a backslash
1306 character to get your parentheses to balance. See L<attributes>.
1308 =item Unterminated attribute list
1310 (F) The lexer found something other than a simple identifier at the start
1311 of an attribute, and it wasn't a semicolon or the start of a
1312 block. Perhaps you terminated the parameter list of the previous attribute
1313 too soon. See L<attributes>.
1315 =item defined(@array) is deprecated
1317 (D) defined() is not usually useful on arrays because it checks for an
1318 undefined I<scalar> value. If you want to see if the array is empty,
1319 just use C<if (@array) { # not empty }> for example.
1321 =item defined(%hash) is deprecated
1323 (D) defined() is not usually useful on hashes because it checks for an
1324 undefined I<scalar> value. If you want to see if the hash is empty,
1325 just use C<if (%hash) { # not empty }> for example.
1327 =item Invalid separator character %s in subroutine attribute list
1329 (F) Something other than a comma or whitespace was seen between the
1330 elements of a subroutine attribute list. If the previous attribute
1331 had a parenthesised parameter list, perhaps that list was terminated
1334 =item Possible Y2K bug: %s
1336 (W) You are concatenating the number 19 with another number, which
1337 could be a potential Year 2000 problem.
1339 =item Unterminated attribute parameter in subroutine attribute list
1341 (F) The lexer saw an opening (left) parenthesis character while parsing a
1342 subroutine attribute list, but the matching closing (right) parenthesis
1343 character was not found. You may need to add (or remove) a backslash
1344 character to get your parentheses to balance.
1346 =item Unterminated subroutine attribute list
1348 (F) The lexer found something other than a simple identifier at the start
1349 of a subroutine attribute, and it wasn't a semicolon or the start of a
1350 block. Perhaps you terminated the parameter list of the previous attribute
1353 =item /%s/ should probably be written as "%s"
1355 (W) You have used a pattern where Perl expected to find a string,
1356 like in the first argument to C<join>. Perl will treat the true
1357 or false result of matching the pattern against $_ as the string,
1358 which is probably not what you had in mind.
1360 =item %s() called too early to check prototype
1362 (W) You've called a function that has a prototype before the parser saw a
1363 definition or declaration for it, and Perl could not check that the call
1364 conforms to the prototype. You need to either add an early prototype
1365 declaration for the subroutine in question, or move the subroutine
1366 definition ahead of the call to get proper prototype checking. Alternatively,
1367 if you are certain that you're calling the function correctly, you may put
1368 an ampersand before the name to avoid the warning. See L<perlsub>.
1370 =head1 Obsolete Diagnostics
1376 If you find what you think is a bug, you might check the headers of
1377 articles recently posted to the comp.lang.perl.misc newsgroup.
1378 There may also be information at http://www.perl.com/perl/, the Perl
1381 If you believe you have an unreported bug, please run the B<perlbug>
1382 program included with your release. Make sure to trim your bug down
1383 to a tiny but sufficient test case. Your bug report, along with the
1384 output of C<perl -V>, will be sent off to perlbug@perl.com to be
1385 analysed by the Perl porting team.
1389 The F<Changes> file for exhaustive details on what changed.
1391 The F<INSTALL> file for how to build Perl.
1393 The F<README> file for general stuff.
1395 The F<Artistic> and F<Copying> files for copyright information.
1399 Written by Gurusamy Sarathy <F<gsar@activestate.com>>, with many
1400 contributions from The Perl Porters.
1402 Send omissions or corrections to <F<perlbug@perl.com>>.