=head1 NAME perldelta - what is new for perl v5.9.3 =head1 DESCRIPTION This document describes differences between the 5.9.2 and the 5.9.3 development releases. See L, L and L for the differences between 5.8.0 and 5.9.2. =head1 Incompatible Changes =head2 Parsing of C<-f _> C<_> is now forced to be a bareword after a filetest operator. This solves a number of misparsing issues when a global C<_> subroutine is defined. =head2 C C without arguments now defaults to C<$_>. =head2 Magic goto and eval The construct C is now disallowed. (Note that the similar construct, but with C instead, was already forbidden.) =head2 C<$#> has been removed The deprecated C<$#> variable (output format for numbers) has been removed. A new warning, C<$# is no longer supported>, has been added. =head2 C<:unique> The C<:unique> attribute has been made a no-op, since its current implementation was fundamentally flawed and not threadsafe. =head2 Scoping of the C pragma The C pragma is now lexically scoped. Its effect used to be global. =head1 Core Enhancements =head2 The C pragma The C pragma is used to enable new syntax that would break Perl's backward-compatibility with older releases of the language. It's a lexical pragma, like C or C. Currently the following new features are available: C (adds a switch statement), C<~~> (adds a Perl 6-like smart match operator), C (adds a C built-in function), and C (adds an C keyword). Those features are described below. Note that C low-precedence defined-or operator used to be enabled by default, but as a weak keyword. It's now only recognized when explicitly turned on. =head2 Switch and Smart Match operator XXX =head2 C say() is a new built-in, only avaiable when C is in effect, that is similar to print(), but that implicitly appends a newline to the printed string. See L. =head2 C Perl has now support for the C special subroutine. Like C, C is called once per package; however, it is called just before cloning starts, and in the context of the parent thread. If it returns a true value, then no objects of that class will be cloned. See L for details. =head2 C<${^CHILD_ERROR_NATIVE}> A new internal variable, C<${^CHILD_ERROR_NATIVE}>, gives the native status returned by the last pipe close, backtick command, successful call to wait() or waitpid(), or from the system() operator. See L for details. =head2 Assertions The support for assertions, introduced in perl 5.9.0, has been improved. The syntax for the C<-A> command-line switch has changed; it now accepts an optional module name, defaulting to C. See L and L. =head2 Unicode Character Database 4.1.0 The copy of the Unicode Character Database included in Perl 5.9 has been updated to 4.1.0. =head2 C You can now use C followed by a version number to specify that you want to use a version of perl inferior to the specified one. =head2 Recursive sort subs You can now use recursive subroutines with sort(). =head2 Effect of pragmas in eval The compile-time value of the C<%^H> hint variable can now propagate into eval("")uated code. This makes it more useful to implement lexical pragmas. As a side-effect of this, the overloaded-ness of constants now propagates into eval(""). =head2 New B<-E> command-line switch B<-E> is equivalent to B<-e>, but it implicitly enables all optional features. =head1 Modules and Pragmata =head2 C This new module implements the C pragma; see above in L. =head2 C =head2 C =head2 C =head2 C =head2 C =head1 Utility Changes =head2 C =head1 Documentation =head2 Perl Glossary The L manpage is a glossary of terms used in the Perl documentation, technical and otherwise. =head1 Performance Enhancements =head2 XS-assisted SWASHGET Some pure-perl code that perl was using to retrieve Unicode properties and transliteration mappings has been reimplemented in XS. =head2 Constants subroutines XXX =head1 Installation and Configuration Improvements =head2 New Or Improved Platforms Perl is being ported to Symbian OS. See L for more information. The VMS port has been improved. See L. DynaLoader::dl_unload_file() now works on Windows. Portability of Perl on various recent compilers on Windows has been improved (Borland C++, Visual C++ 7.0). =head2 New probes Perl will detect and use internally futimes(2) if available. =head2 Module auxiliary files README files and changelogs for CPAN modules bundled with perl are no longer installed. =head1 Selected Bug Fixes =head2 C C was ignoring taking a hard reference in an argument to defined(), as in : use strict "refs"; my $x = "foo"; if (defined $$x) {...} This now correctly produces the run-time error C. (However, C and C are still allowed. Those constructs are discouraged anyway.) =head2 Calling CORE::require() CORE::require() and CORE::do() were always parsed as require() and do() when they were overriden. This is now fixed. =head2 Subscripts of slices You can now use a non-arrowed form for chained subscripts after a list slice, like in: ({foo => "bar"})[0]{foo} This used to be a syntax error; a C<< -> >> was required. =head2 Remove over-optimisation Perl 5.9.2 introduced a change so that assignments of C to a scalar, or of an empty list to an array or a hash, were optimised out. As this could cause problems when C jumps were involved, this change was backed out. =head2 sprintf() fixes Using the sprintf() function with some formats could lead to a buffer overflow in some specific cases. This has been fixed, along with several other bugs, notably in bound checking. In related fixes, a format string injection vulnerability has been fixed in Sys::Syslog. =head2 Smaller fixes =over 4 =item * C now works better with directories where access rights are more restrictive than usual. =item * Several memory leaks in ithreads were closed. Also, ithreads were made less memory-intensive. =item * C now works better with non-default C<$/> settings. =item * You can now use the C operator to repeat a C list. This used to raise a syntax error. For example: C. =item * The debugger now traces correctly execution in eval("")uated code that contains #line directives. =item * The value of the C pragma is no longer ignored for three-argument opens. =item * C matches used to loop infinitely on tainted data. =back =head2 More Unicode Fixes =over 4 =item * chr() on a negative value now gives C<\x{FFFD}>, the Unicode replacement character, unless when the C pragma is in effect, where the low eight bytes of the value are used. =back =head1 New or Changed Diagnostics =head2 Attempt to set length of freed array This is a new warning, produced in situations like the following one: $r = do {my @a; \$#a}; $$r = 503; =head2 Search pattern not terminated or ternary operator parsed as search pattern This syntax error indicates that the lexer couldn't find the final delimiter of a C construct. Mentioning the ternary operator in this error message makes syntax diagnostic easier. =head2 "%s" variable %s masks earlier declaration This warning is now emitted in more consistent cases; in short, when one of the declarations involved is a C variable: my $x; my $x; # warns my $x; our $x; # warns our $x; my $x; # warns On the other hand, the following : our $x; our $x; now gives a C<"our" variable %s redeclared> warning. =head2 readdir()/closedir()/etc. attempted on invalid dirhandle These new warnings are now emitted when a dirhandle is used but is either closed or not really a dirhandle. =head1 Changed Internals XXX consting A new file, F, has been added. It contains functions that are no longer used in the perl core, but that remain available for binary or source compatibility reasons. However, those functions will not be compiled in if you add C<-DNO_MATHOMS> in the compiler flags. The C macro has been removed. =head2 B:: modules inheritance changed The inheritance hierarchy of C modules has changed; C now inherits from C (it used to inherit from C). =head1 Known Problems =head2 Platform Specific Problems =head1 Reporting Bugs If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ . There may also be information at http://www.perl.org/ , the Perl Home Page. If you believe you have an unreported bug, please run the B program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of C, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. =head1 SEE ALSO The F file for exhaustive details on what changed. The F file for how to build Perl. The F file for general stuff. The F and F files for copyright information. =cut