Perldelta nits by Jim Cromie
[p5sagit/p5-mst-13.2.git] / pod / perl593delta.pod
CommitLineData
496c75d0 1=head1 NAME
2
3perldelta - what is new for perl v5.9.3
4
5=head1 DESCRIPTION
6
7This document describes differences between the 5.9.2 and the 5.9.3
d7f8936a 8development releases. See L<perl590delta>, L<perl591delta> and
496c75d0 9L<perl592delta> for the differences between 5.8.0 and 5.9.2.
10
11=head1 Incompatible Changes
12
2770530f 13=head2 Parsing of C<-f _>
14
15C<_> is now forced to be a bareword after a filetest operator. This solves
16a number of misparsing issues when a global C<_> subroutine is defined.
17
78ef48ad 18=head2 C<mkdir()>
19
20C<mkdir()> without arguments now defaults to C<$_>.
21
22=head2 Magic goto and eval
23
24The construct C<eval { goto &foo }> is now disallowed. (Note that the
25similar construct, but with C<eval("")> instead, was already forbidden.)
26
27=head2 C<$#> has been removed
28
29The deprecated C<$#> variable (output format for numbers) has been
30removed. A new warning, C<$# is no longer supported>, has been added.
31
32=head2 C<:unique>
33
8f7e634e 34The C<:unique> attribute has been made a no-op, since its current
78ef48ad 35implementation was fundamentally flawed and not threadsafe.
36
e603cea9 37=head2 Scoping of the C<sort> pragma
38
39The C<sort> pragma is now lexically scoped. Its effect used to be global.
40
496c75d0 41=head1 Core Enhancements
42
e603cea9 43=head2 The C<feature> pragma
44
45The C<feature> pragma is used to enable new syntax that would break Perl's
46backward-compatibility with older releases of the language. It's a lexical
47pragma, like C<strict> or C<warnings>.
48
49Currently the following new features are available: C<switch> (adds a
50switch 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).
52Those features are described below.
53
54Note that C<err> low-precedence defined-or operator used to be enabled by
ffabe59c 55default, but as a weak keyword. It's now only recognized when explicitly
e603cea9 56turned on.
57
78ef48ad 58=head2 Switch and Smart Match operator
59
e603cea9 60XXX
61
78ef48ad 62=head2 C<say()>
63
e603cea9 64say() is a new built-in, only avaiable when C<use feature 'say'> is in
65effect, that is similar to print(), but that implicitly appends a newline
66to the printed string. See L<perlfunc/say>.
67
78ef48ad 68=head2 C<CLONE_SKIP()>
69
70Perl has now support for the C<CLONE_SKIP> special subroutine. Like
71C<CLONE>, C<CLONE_SKIP> is called once per package; however, it is called
72just before cloning starts, and in the context of the parent thread. If it
73returns a true value, then no objects of that class will be cloned. See
74L<perlmod> for details.
75
76=head2 C<${^CHILD_ERROR_NATIVE}>
77
78A new internal variable, C<${^CHILD_ERROR_NATIVE}>, gives the native
79status returned by the last pipe close, backtick command, successful call
80to wait() or waitpid(), or from the system() operator. See L<perlrun> for
81details.
82
83=head2 Assertions
84
85The support for assertions, introduced in perl 5.9.0, has been improved.
86The syntax for the C<-A> command-line switch has changed; it now accepts
87an optional module name, defaulting to C<assertions::activate>. See
88L<assertions> and L<perlrun>.
89
90=head2 Unicode Character Database 4.1.0
91
92The copy of the Unicode Character Database included in Perl 5.9 has
93been updated to 4.1.0.
94
8f7e634e 95=head2 C<no VERSION>
96
97You can now use C<no> followed by a version number to specify that you
98want to use a version of perl inferior to the specified one.
99
e603cea9 100=head2 Recursive sort subs
101
102You can now use recursive subroutines with sort().
103
104=head2 Effect of pragmas in eval
105
106The compile-time value of the C<%^H> hint variable can now propagate into
107eval("")uated code. This makes it more useful to implement lexical
108pragmas.
109
110As a side-effect of this, the overloaded-ness of constants now propagates
111into eval("").
112
113=head2 New B<-E> command-line switch
114
115B<-E> is equivalent to B<-e>, but it implicitly enables all
116optional features.
117
496c75d0 118=head1 Modules and Pragmata
119
78ef48ad 120=head2 C<feature>
121
e603cea9 122This new module implements the C<feature> pragma; see above in
123L</"Core Enhancements">.
124
78ef48ad 125=head2 C<assertions::compat>
126
127=head2 C<Math::BigInt::FastCalc>
128
129=head2 C<Compress::Zlib>
130
131=head2 C<IO::Zlib>
132
133=head2 C<Archive::Tar>
134
496c75d0 135=head1 Utility Changes
136
78ef48ad 137=head2 C<ptar>
138
496c75d0 139=head1 Documentation
140
8f7e634e 141=head2 Perl Glossary
142
143The L<perlglossary> manpage is a glossary of terms used in the Perl
144documentation, technical and otherwise.
145
496c75d0 146=head1 Performance Enhancements
147
e603cea9 148=head2 XS-assisted SWASHGET
149
150Some pure-perl code that perl was using to retrieve Unicode properties and
ffabe59c 151transliteration mappings has been reimplemented in XS.
e603cea9 152
153=head2 Constants subroutines
154
155XXX
156
496c75d0 157=head1 Installation and Configuration Improvements
158
78ef48ad 159=head2 New Or Improved Platforms
160
161Perl is being ported to Symbian OS. See L<perlsymbian> for more
162information.
163
e603cea9 164The VMS port has been improved. See L<perlvms>.
165
166DynaLoader::dl_unload_file() now works on Windows.
167
168Portability of Perl on various recent compilers on Windows has been
169improved (Borland C++, Visual C++ 7.0).
170
171=head2 New probes
172
173Perl will detect and use internally futimes(2) if available.
174
78ef48ad 175=head2 Module auxiliary files
176
177README files and changelogs for CPAN modules bundled with perl are no
178longer installed.
179
496c75d0 180=head1 Selected Bug Fixes
181
2e6a7e23 182=head2 C<defined $$x>
183
184C<use strict "refs"> was ignoring taking a hard reference in an argument
185to defined(), as in :
186
187 use strict "refs";
188 my $x = "foo";
189 if (defined $$x) {...}
190
191This now correctly produces the run-time error C<Can't use string as a
192SCALAR ref while "strict refs" in use>. (However, C<defined @$foo> and
193C<defined %$foo> are still allowed. Those constructs are discouraged
194anyway.)
195
e603cea9 196=head2 Calling CORE::require()
197
198CORE::require() and CORE::do() were always parsed as require() and do()
199when they were overriden. This is now fixed.
200
201=head2 Subscripts of slices
202
203You can now use a non-arrowed form for chained subscripts after a list
204slice, like in:
205
206 ({foo => "bar"})[0]{foo}
207
208This used to be a syntax error; a C<< -> >> was required.
209
210=head2 Remove over-optimisation
211
212Perl 5.9.2 introduced a change so that assignments of C<undef> to a
213scalar, or of an empty list to an array or a hash, were optimised out. As
214this could cause problems when C<goto> jumps were involved, this change
215was backed out.
216
217=head2 sprintf() fixes
218
219Using the sprintf() function with some formats could lead to a buffer
220overflow in some specific cases. This has been fixed, along with several
221other bugs, notably in bound checking.
222
223In related fixes, a format string injection vulnerability has been fixed
224in Sys::Syslog.
225
78ef48ad 226=head2 Smaller fixes
227
228=over 4
229
230=item *
231
232C<FindBin> now works better with directories where access rights are more
233restrictive than usual.
234
235=item *
236
e603cea9 237Several memory leaks in ithreads were closed. Also, ithreads were made
238less memory-intensive.
78ef48ad 239
240=item *
241
242C<PerlIO::scalar> now works better with non-default C<$/> settings.
243
244=item *
245
ffabe59c 246You can now use the C<x> operator to repeat a C<qw//> list. This used
247to raise a syntax error. For example: C<qw(foo bar) x 3>.
78ef48ad 248
e603cea9 249=item *
250
251The debugger now traces correctly execution in eval("")uated code that
252contains #line directives.
253
254=item *
255
256The value of the C<open> pragma is no longer ignored for three-argument
257opens.
258
259=item *
260
261C<//g> matches used to loop infinitely on tainted data.
262
78ef48ad 263=back
264
265=head2 More Unicode Fixes
266
267=over 4
268
269=item *
270
271chr() on a negative value now gives C<\x{FFFD}>, the Unicode replacement
272character, unless when the C<bytes> pragma is in effect, where the low
273eight bytes of the value are used.
274
275=back
276
496c75d0 277=head1 New or Changed Diagnostics
278
78ef48ad 279=head2 Attempt to set length of freed array
280
281This is a new warning, produced in situations like the following one:
282
283 $r = do {my @a; \$#a};
284 $$r = 503;
285
286=head2 Search pattern not terminated or ternary operator parsed as search pattern
287
288This syntax error indicates that the lexer couldn't find the final
289delimiter of a C<?PATTERN?> construct. Mentioning the ternary operator in
290this error message makes syntax diagnostic easier.
291
8f7e634e 292=head2 "%s" variable %s masks earlier declaration
293
294This warning is now emitted in more consistent cases; in short, when one
295of the declarations involved is a C<my> variable:
296
297 my $x; my $x; # warns
298 my $x; our $x; # warns
299 our $x; my $x; # warns
300
301On the other hand, the following :
302
303 our $x; our $x;
304
305now gives a C<"our" variable %s redeclared> warning.
306
e603cea9 307=head2 readdir()/closedir()/etc. attempted on invalid dirhandle
308
309These new warnings are now emitted when a dirhandle is used but is
310either closed or not really a dirhandle.
311
496c75d0 312=head1 Changed Internals
313
78ef48ad 314XXX consting
315
e603cea9 316A new file, F<mathoms.c>, has been added. It contains functions that are
317no longer used in the perl core, but that remain available for binary or
318source compatibility reasons. However, those functions will not be
ffabe59c 319compiled in if you add C<-DNO_MATHOMS> in the compiler flags.
78ef48ad 320
321The C<AvFLAGS> macro has been removed.
322
323=head2 B:: modules inheritance changed
324
325The inheritance hierarchy of C<B::> modules has changed; C<B::NV> now
326inherits from C<B::SV> (it used to inherit from C<B::IV>).
327
496c75d0 328=head1 Known Problems
329
330=head2 Platform Specific Problems
331
332=head1 Reporting Bugs
333
334If you find what you think is a bug, you might check the articles
335recently posted to the comp.lang.perl.misc newsgroup and the perl
336bug database at http://bugs.perl.org/ . There may also be
337information at http://www.perl.org/ , the Perl Home Page.
338
339If you believe you have an unreported bug, please run the B<perlbug>
340program included with your release. Be sure to trim your bug down
341to a tiny but sufficient test case. Your bug report, along with the
342output of C<perl -V>, will be sent off to perlbug@perl.org to be
343analysed by the Perl porting team.
344
345=head1 SEE ALSO
346
347The F<Changes> file for exhaustive details on what changed.
348
349The F<INSTALL> file for how to build Perl.
350
351The F<README> file for general stuff.
352
353The F<Artistic> and F<Copying> files for copyright information.
354
355=cut