3 perldelta - what is new for perl v5.9.3
7 This document describes differences between the 5.9.2 and the 5.9.3
8 development releases. See L<perl590delta>, L<perl591delta> and
9 L<perl592delta> for the differences between 5.8.0 and 5.9.2.
11 =head1 Incompatible Changes
13 =head2 Parsing of C<-f _>
15 C<_> is now forced to be a bareword after a filetest operator. This solves
16 a number of misparsing issues when a global C<_> subroutine is defined.
20 C<mkdir()> without arguments now defaults to C<$_>.
22 =head2 Magic goto and eval
24 The construct C<eval { goto &foo }> is now disallowed. (Note that the
25 similar construct, but with C<eval("")> instead, was already forbidden.)
27 =head2 C<$#> has been removed
29 The deprecated C<$#> variable (output format for numbers) has been
30 removed. A new warning, C<$# is no longer supported>, has been added.
34 The C<:unique> attribute has been made a no-op, since its current
35 implementation was fundamentally flawed and not threadsafe.
37 =head2 Scoping of the C<sort> pragma
39 The C<sort> pragma is now lexically scoped. Its effect used to be global.
41 =head1 Core Enhancements
43 =head2 The C<feature> pragma
45 The C<feature> pragma is used to enable new syntax that would break Perl's
46 backward-compatibility with older releases of the language. It's a lexical
47 pragma, like C<strict> or C<warnings>.
49 Currently the following new features are available: C<switch> (adds a
50 switch statement), C<~~> (adds a Perl 6-like smart match operator), C<say>
51 (adds a C<say> built-in function), and C<err> (adds an C<err> keyword).
52 Those features are described below.
54 Note that C<err> low-precedence defined-or operator used to be enabled by
55 default, but as a weak keyword. It's now only recognized when explicitly
58 =head2 Switch and Smart Match operator
64 say() is a new built-in, only avaiable when C<use feature 'say'> is in
65 effect, that is similar to print(), but that implicitly appends a newline
66 to the printed string. See L<perlfunc/say>.
68 =head2 C<CLONE_SKIP()>
70 Perl has now support for the C<CLONE_SKIP> special subroutine. Like
71 C<CLONE>, C<CLONE_SKIP> is called once per package; however, it is called
72 just before cloning starts, and in the context of the parent thread. If it
73 returns a true value, then no objects of that class will be cloned. See
74 L<perlmod> for details.
76 =head2 C<${^CHILD_ERROR_NATIVE}>
78 A new internal variable, C<${^CHILD_ERROR_NATIVE}>, gives the native
79 status returned by the last pipe close, backtick command, successful call
80 to wait() or waitpid(), or from the system() operator. See L<perlrun> for
85 The support for assertions, introduced in perl 5.9.0, has been improved.
86 The syntax for the C<-A> command-line switch has changed; it now accepts
87 an optional module name, defaulting to C<assertions::activate>. See
88 L<assertions> and L<perlrun>.
90 =head2 Unicode Character Database 4.1.0
92 The copy of the Unicode Character Database included in Perl 5.9 has
93 been updated to 4.1.0.
97 You can now use C<no> followed by a version number to specify that you
98 want to use a version of perl inferior to the specified one.
100 =head2 Recursive sort subs
102 You can now use recursive subroutines with sort().
104 =head2 Effect of pragmas in eval
106 The compile-time value of the C<%^H> hint variable can now propagate into
107 eval("")uated code. This makes it more useful to implement lexical
110 As a side-effect of this, the overloaded-ness of constants now propagates
113 =head2 New B<-E> command-line switch
115 B<-E> is equivalent to B<-e>, but it implicitly enables all
118 =head1 Modules and Pragmata
122 This new module implements the C<feature> pragma; see above in
123 L</"Core Enhancements">.
125 =head2 C<assertions::compat>
127 =head2 C<Math::BigInt::FastCalc>
129 =head2 C<Compress::Zlib>
133 =head2 C<Archive::Tar>
135 =head1 Utility Changes
143 The L<perlglossary> manpage is a glossary of terms used in the Perl
144 documentation, technical and otherwise.
146 =head1 Performance Enhancements
148 =head2 XS-assisted SWASHGET
150 Some pure-perl code that perl was using to retrieve Unicode properties and
151 transliteration mappings has been reimplemented in XS.
153 =head2 Constants subroutines
157 =head1 Installation and Configuration Improvements
159 =head2 New Or Improved Platforms
161 Perl is being ported to Symbian OS. See L<perlsymbian> for more
164 The VMS port has been improved. See L<perlvms>.
166 DynaLoader::dl_unload_file() now works on Windows.
168 Portability of Perl on various recent compilers on Windows has been
169 improved (Borland C++, Visual C++ 7.0).
173 Perl will detect and use internally futimes(2) if available.
175 =head2 Module auxiliary files
177 README files and changelogs for CPAN modules bundled with perl are no
180 =head1 Selected Bug Fixes
182 =head2 C<defined $$x>
184 C<use strict "refs"> was ignoring taking a hard reference in an argument
185 to defined(), as in :
189 if (defined $$x) {...}
191 This now correctly produces the run-time error C<Can't use string as a
192 SCALAR ref while "strict refs" in use>. (However, C<defined @$foo> and
193 C<defined %$foo> are still allowed. Those constructs are discouraged
196 =head2 Calling CORE::require()
198 CORE::require() and CORE::do() were always parsed as require() and do()
199 when they were overriden. This is now fixed.
201 =head2 Subscripts of slices
203 You can now use a non-arrowed form for chained subscripts after a list
206 ({foo => "bar"})[0]{foo}
208 This used to be a syntax error; a C<< -> >> was required.
210 =head2 Remove over-optimisation
212 Perl 5.9.2 introduced a change so that assignments of C<undef> to a
213 scalar, or of an empty list to an array or a hash, were optimised out. As
214 this could cause problems when C<goto> jumps were involved, this change
217 =head2 sprintf() fixes
219 Using the sprintf() function with some formats could lead to a buffer
220 overflow in some specific cases. This has been fixed, along with several
221 other bugs, notably in bound checking.
223 In related fixes, a format string injection vulnerability has been fixed
232 C<FindBin> now works better with directories where access rights are more
233 restrictive than usual.
237 Several memory leaks in ithreads were closed. Also, ithreads were made
238 less memory-intensive.
242 C<PerlIO::scalar> now works better with non-default C<$/> settings.
246 You can now use the C<x> operator to repeat a C<qw//> list. This used
247 to raise a syntax error. For example: C<qw(foo bar) x 3>.
251 The debugger now traces correctly execution in eval("")uated code that
252 contains #line directives.
256 The value of the C<open> pragma is no longer ignored for three-argument
261 C<//g> matches used to loop infinitely on tainted data.
265 =head2 More Unicode Fixes
271 chr() on a negative value now gives C<\x{FFFD}>, the Unicode replacement
272 character, unless when the C<bytes> pragma is in effect, where the low
273 eight bytes of the value are used.
277 =head1 New or Changed Diagnostics
279 =head2 Attempt to set length of freed array
281 This is a new warning, produced in situations like the following one:
283 $r = do {my @a; \$#a};
286 =head2 Search pattern not terminated or ternary operator parsed as search pattern
288 This syntax error indicates that the lexer couldn't find the final
289 delimiter of a C<?PATTERN?> construct. Mentioning the ternary operator in
290 this error message makes syntax diagnostic easier.
292 =head2 "%s" variable %s masks earlier declaration
294 This warning is now emitted in more consistent cases; in short, when one
295 of the declarations involved is a C<my> variable:
297 my $x; my $x; # warns
298 my $x; our $x; # warns
299 our $x; my $x; # warns
301 On the other hand, the following :
305 now gives a C<"our" variable %s redeclared> warning.
307 =head2 readdir()/closedir()/etc. attempted on invalid dirhandle
309 These new warnings are now emitted when a dirhandle is used but is
310 either closed or not really a dirhandle.
312 =head1 Changed Internals
316 A new file, F<mathoms.c>, has been added. It contains functions that are
317 no longer used in the perl core, but that remain available for binary or
318 source compatibility reasons. However, those functions will not be
319 compiled in if you add C<-DNO_MATHOMS> in the compiler flags.
321 The C<AvFLAGS> macro has been removed.
323 =head2 B:: modules inheritance changed
325 The inheritance hierarchy of C<B::> modules has changed; C<B::NV> now
326 inherits from C<B::SV> (it used to inherit from C<B::IV>).
328 =head1 Known Problems
330 =head2 Platform Specific Problems
332 =head1 Reporting Bugs
334 If you find what you think is a bug, you might check the articles
335 recently posted to the comp.lang.perl.misc newsgroup and the perl
336 bug database at http://bugs.perl.org/ . There may also be
337 information at http://www.perl.org/ , the Perl Home Page.
339 If you believe you have an unreported bug, please run the B<perlbug>
340 program included with your release. Be sure to trim your bug down
341 to a tiny but sufficient test case. Your bug report, along with the
342 output of C<perl -V>, will be sent off to perlbug@perl.org to be
343 analysed by the Perl porting team.
347 The F<Changes> file for exhaustive details on what changed.
349 The F<INSTALL> file for how to build Perl.
351 The F<README> file for general stuff.
353 The F<Artistic> and F<Copying> files for copyright information.