Make dump and -u croak on Win32 and Cygwin to avoid confusion
[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
ebab5fdd 102You can now use recursive subroutines with sort(), thanks to Robin Houston.
e603cea9 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
ebab5fdd 118=head2 C<chdir>, C<chmod> and C<chown> on filehandles
119
120C<chdir>, C<chmod> and C<chown> can now work on filehandles as well as
121filenames, if the system supports respectively C<fchdir>, C<fchmod> and
122C<fchown>, thanks to a patch provided by Gisle Aas.
123
496c75d0 124=head1 Modules and Pragmata
125
78ef48ad 126=head2 C<feature>
127
e603cea9 128This new module implements the C<feature> pragma; see above in
129L</"Core Enhancements">.
130
78ef48ad 131=head2 C<assertions::compat>
132
133=head2 C<Math::BigInt::FastCalc>
134
135=head2 C<Compress::Zlib>
136
137=head2 C<IO::Zlib>
138
139=head2 C<Archive::Tar>
140
496c75d0 141=head1 Utility Changes
142
78ef48ad 143=head2 C<ptar>
144
496c75d0 145=head1 Documentation
146
8f7e634e 147=head2 Perl Glossary
148
149The L<perlglossary> manpage is a glossary of terms used in the Perl
150documentation, technical and otherwise.
151
496c75d0 152=head1 Performance Enhancements
153
e603cea9 154=head2 XS-assisted SWASHGET
155
156Some pure-perl code that perl was using to retrieve Unicode properties and
ffabe59c 157transliteration mappings has been reimplemented in XS.
e603cea9 158
159=head2 Constants subroutines
160
161XXX
162
ebab5fdd 163=head2 C<PERL_DONT_CREATE_GVSV>
164
165The new compilation flag C<PERL_DONT_CREATE_GVSV>, introduced as an option
166in perl 5.8.8, is turned on by default in perl 5.9.3. It prevents perl
167from creating an empty scalar with every new typeglob. See L<perl588delta>
168for details.
169
170=head2 Weak references are cheaper
171
172Weak reference creation is now I<O(1)> rather than I<O(n)>, courtesy of
173Nicholas Clark. Weak reference deletion remains I<O(n)>, but if deletion only
174happens at program exit, it may be skipped completely.
175
176=head2 sort() enhancements
177
178Salvador FandiƱo provided improvements to reduce the memory usage of C<sort>
179and to speed up some cases.
180
496c75d0 181=head1 Installation and Configuration Improvements
182
78ef48ad 183=head2 New Or Improved Platforms
184
185Perl is being ported to Symbian OS. See L<perlsymbian> for more
186information.
187
e603cea9 188The VMS port has been improved. See L<perlvms>.
189
190DynaLoader::dl_unload_file() now works on Windows.
191
192Portability of Perl on various recent compilers on Windows has been
193improved (Borland C++, Visual C++ 7.0).
194
195=head2 New probes
196
197Perl will detect and use internally futimes(2) if available.
198
78ef48ad 199=head2 Module auxiliary files
200
201README files and changelogs for CPAN modules bundled with perl are no
202longer installed.
203
496c75d0 204=head1 Selected Bug Fixes
205
2e6a7e23 206=head2 C<defined $$x>
207
208C<use strict "refs"> was ignoring taking a hard reference in an argument
209to defined(), as in :
210
211 use strict "refs";
212 my $x = "foo";
213 if (defined $$x) {...}
214
215This now correctly produces the run-time error C<Can't use string as a
216SCALAR ref while "strict refs" in use>. (However, C<defined @$foo> and
217C<defined %$foo> are still allowed. Those constructs are discouraged
218anyway.)
219
e603cea9 220=head2 Calling CORE::require()
221
222CORE::require() and CORE::do() were always parsed as require() and do()
223when they were overriden. This is now fixed.
224
225=head2 Subscripts of slices
226
227You can now use a non-arrowed form for chained subscripts after a list
228slice, like in:
229
230 ({foo => "bar"})[0]{foo}
231
232This used to be a syntax error; a C<< -> >> was required.
233
234=head2 Remove over-optimisation
235
236Perl 5.9.2 introduced a change so that assignments of C<undef> to a
237scalar, or of an empty list to an array or a hash, were optimised out. As
238this could cause problems when C<goto> jumps were involved, this change
239was backed out.
240
241=head2 sprintf() fixes
242
243Using the sprintf() function with some formats could lead to a buffer
244overflow in some specific cases. This has been fixed, along with several
245other bugs, notably in bound checking.
246
247In related fixes, a format string injection vulnerability has been fixed
248in Sys::Syslog.
249
78ef48ad 250=head2 Smaller fixes
251
252=over 4
253
254=item *
255
256C<FindBin> now works better with directories where access rights are more
257restrictive than usual.
258
259=item *
260
e603cea9 261Several memory leaks in ithreads were closed. Also, ithreads were made
262less memory-intensive.
78ef48ad 263
264=item *
265
ebab5fdd 266Trailing spaces are now trimmed from C<$!> and C<$^E>.
267
268=item *
269
270Operations that require perl to read a process' list of groups, such as reads
271of C<$(> and C<$)>, now dynamically allocate memory rather than using a
272fixed sized array. The fixed size array could cause C stack exhaustion on
273systems configured to use large numbers of groups.
274
275=item *
276
78ef48ad 277C<PerlIO::scalar> now works better with non-default C<$/> settings.
278
279=item *
280
ffabe59c 281You can now use the C<x> operator to repeat a C<qw//> list. This used
282to raise a syntax error. For example: C<qw(foo bar) x 3>.
78ef48ad 283
e603cea9 284=item *
285
286The debugger now traces correctly execution in eval("")uated code that
287contains #line directives.
288
289=item *
290
291The value of the C<open> pragma is no longer ignored for three-argument
292opens.
293
294=item *
295
ebab5fdd 296Perl will now use the C library calls C<unsetenv> and C<clearenv> if present
297to delete keys from C<%ENV> and delete C<%ENV> entirely, thanks to a patch
298from Alan Burlison.
e603cea9 299
78ef48ad 300=back
301
302=head2 More Unicode Fixes
303
304=over 4
305
306=item *
307
308chr() on a negative value now gives C<\x{FFFD}>, the Unicode replacement
309character, unless when the C<bytes> pragma is in effect, where the low
310eight bytes of the value are used.
311
ebab5fdd 312=item *
313
314Some case insensitive matches between UTF-8 encoded data and 8 bit regexps,
315and vice versa, could give malformed character warnings. These have been
316fixed by Dave Mitchell and Yves Orton.
317
318=item *
319
320C<lcfirst> and C<ucfirst> could corrupt the string for certain cases where
321the length UTF-8 encoding of the string in lower case, upper case or title
322case differed. This was fixed by Nicholas Clark.
323
78ef48ad 324=back
325
496c75d0 326=head1 New or Changed Diagnostics
327
78ef48ad 328=head2 Attempt to set length of freed array
329
330This is a new warning, produced in situations like the following one:
331
332 $r = do {my @a; \$#a};
333 $$r = 503;
334
335=head2 Search pattern not terminated or ternary operator parsed as search pattern
336
337This syntax error indicates that the lexer couldn't find the final
338delimiter of a C<?PATTERN?> construct. Mentioning the ternary operator in
339this error message makes syntax diagnostic easier.
340
8f7e634e 341=head2 "%s" variable %s masks earlier declaration
342
343This warning is now emitted in more consistent cases; in short, when one
344of the declarations involved is a C<my> variable:
345
346 my $x; my $x; # warns
347 my $x; our $x; # warns
348 our $x; my $x; # warns
349
350On the other hand, the following :
351
352 our $x; our $x;
353
354now gives a C<"our" variable %s redeclared> warning.
355
e603cea9 356=head2 readdir()/closedir()/etc. attempted on invalid dirhandle
357
358These new warnings are now emitted when a dirhandle is used but is
359either closed or not really a dirhandle.
360
496c75d0 361=head1 Changed Internals
362
78ef48ad 363XXX consting
364
e603cea9 365A new file, F<mathoms.c>, has been added. It contains functions that are
366no longer used in the perl core, but that remain available for binary or
367source compatibility reasons. However, those functions will not be
ffabe59c 368compiled in if you add C<-DNO_MATHOMS> in the compiler flags.
78ef48ad 369
370The C<AvFLAGS> macro has been removed.
371
ebab5fdd 372The C<av_*()> functions, used to manipulate arrays, no longer accept null
373C<AV*> parameters.
374
78ef48ad 375=head2 B:: modules inheritance changed
376
377The inheritance hierarchy of C<B::> modules has changed; C<B::NV> now
378inherits from C<B::SV> (it used to inherit from C<B::IV>).
379
496c75d0 380=head1 Known Problems
381
382=head2 Platform Specific Problems
383
384=head1 Reporting Bugs
385
386If you find what you think is a bug, you might check the articles
387recently posted to the comp.lang.perl.misc newsgroup and the perl
388bug database at http://bugs.perl.org/ . There may also be
389information at http://www.perl.org/ , the Perl Home Page.
390
391If you believe you have an unreported bug, please run the B<perlbug>
392program included with your release. Be sure to trim your bug down
393to a tiny but sufficient test case. Your bug report, along with the
394output of C<perl -V>, will be sent off to perlbug@perl.org to be
395analysed by the Perl porting team.
396
397=head1 SEE ALSO
398
399The F<Changes> file for exhaustive details on what changed.
400
401The F<INSTALL> file for how to build Perl.
402
403The F<README> file for general stuff.
404
405The F<Artistic> and F<Copying> files for copyright information.
406
407=cut