6e8e5c0a43cee14f62c59e0209fe8ec7f26fdc87
[p5sagit/p5-mst-13.2.git] / pod / perl593delta.pod
1 =head1 NAME
2
3 perldelta - what is new for perl v5.9.3
4
5 =head1 DESCRIPTION
6
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.
10
11 =head1 Incompatible Changes
12
13 =head2 Parsing of C<-f _>
14
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.
17
18 =head2 C<mkdir()>
19
20 C<mkdir()> without arguments now defaults to C<$_>.
21
22 =head2 Magic goto and eval
23
24 The construct C<eval { goto &foo }> is now disallowed. (Note that the
25 similar construct, but with C<eval("")> instead, was already forbidden.)
26
27 =head2 C<$#> has been removed
28
29 The deprecated C<$#> variable (output format for numbers) has been
30 removed. A new warning, C<$# is no longer supported>, has been added.
31
32 =head2 C<:unique>
33
34 The C<:unique> attribute has been made a no-op, since its current
35 implementation was fundamentally flawed and not threadsafe.
36
37 =head2 Scoping of the C<sort> pragma
38
39 The C<sort> pragma is now lexically scoped. Its effect used to be global.
40
41 =head1 Core Enhancements
42
43 =head2 The C<feature> pragma
44
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>.
48
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.
53
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 explicitely
56 turned on.
57
58 =head2 Switch and Smart Match operator
59
60 XXX
61
62 =head2 C<say()>
63
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>.
67
68 =head2 C<CLONE_SKIP()>
69
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.
75
76 =head2 C<${^CHILD_ERROR_NATIVE}>
77
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
81 details.
82
83 =head2 Assertions
84
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>.
89
90 =head2 Unicode Character Database 4.1.0
91
92 The copy of the Unicode Character Database included in Perl 5.9 has
93 been updated to 4.1.0.
94
95 =head2 C<no VERSION>
96
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.
99
100 =head2 Recursive sort subs
101
102 You can now use recursive subroutines with sort().
103
104 =head2 Effect of pragmas in eval
105
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
108 pragmas.
109
110 As a side-effect of this, the overloaded-ness of constants now propagates
111 into eval("").
112
113 =head2 New B<-E> command-line switch
114
115 B<-E> is equivalent to B<-e>, but it implicitly enables all
116 optional features.
117
118 =head1 Modules and Pragmata
119
120 =head2 C<feature>
121
122 This new module implements the C<feature> pragma; see above in
123 L</"Core Enhancements">.
124
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
135 =head1 Utility Changes
136
137 =head2 C<ptar>
138
139 =head1 Documentation
140
141 =head2 Perl Glossary
142
143 The L<perlglossary> manpage is a glossary of terms used in the Perl
144 documentation, technical and otherwise.
145
146 =head1 Performance Enhancements
147
148 =head2 XS-assisted SWASHGET
149
150 Some pure-perl code that perl was using to retrieve Unicode properties and
151 transliteration mappings has been retrieved in XS.
152
153 =head2 Constants subroutines
154
155 XXX
156
157 =head1 Installation and Configuration Improvements
158
159 =head2 New Or Improved Platforms
160
161 Perl is being ported to Symbian OS. See L<perlsymbian> for more
162 information.
163
164 The VMS port has been improved. See L<perlvms>.
165
166 DynaLoader::dl_unload_file() now works on Windows.
167
168 Portability of Perl on various recent compilers on Windows has been
169 improved (Borland C++, Visual C++ 7.0).
170
171 =head2 New probes
172
173 Perl will detect and use internally futimes(2) if available.
174
175 =head2 Module auxiliary files
176
177 README files and changelogs for CPAN modules bundled with perl are no
178 longer installed.
179
180 =head1 Selected Bug Fixes
181
182 =head2 C<defined $$x>
183
184 C<use strict "refs"> was ignoring taking a hard reference in an argument
185 to defined(), as in :
186
187     use strict "refs";
188     my $x = "foo";
189     if (defined $$x) {...}
190
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
194 anyway.)
195
196 =head2 Calling CORE::require()
197
198 CORE::require() and CORE::do() were always parsed as require() and do()
199 when they were overriden. This is now fixed.
200
201 =head2 Subscripts of slices
202
203 You can now use a non-arrowed form for chained subscripts after a list
204 slice, like in:
205
206     ({foo => "bar"})[0]{foo}
207
208 This used to be a syntax error; a C<< -> >> was required.
209
210 =head2 Remove over-optimisation
211
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
215 was backed out.
216
217 =head2 sprintf() fixes
218
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.
222
223 In related fixes, a format string injection vulnerability has been fixed
224 in Sys::Syslog.
225
226 =head2 Smaller fixes
227
228 =over 4
229
230 =item *
231
232 C<FindBin> now works better with directories where access rights are more
233 restrictive than usual.
234
235 =item *
236
237 Several memory leaks in ithreads were closed. Also, ithreads were made
238 less memory-intensive.
239
240 =item *
241
242 C<PerlIO::scalar> now works better with non-default C<$/> settings.
243
244 =item *
245
246 You can now use the C<x> operator to demultiply a C<qw//> list. This used
247 to raise a syntax error.
248
249 =item *
250
251 The debugger now traces correctly execution in eval("")uated code that
252 contains #line directives.
253
254 =item *
255
256 The value of the C<open> pragma is no longer ignored for three-argument
257 opens.
258
259 =item *
260
261 C<//g> matches used to loop infinitely on tainted data.
262
263 =back
264
265 =head2 More Unicode Fixes
266
267 =over 4
268
269 =item *
270
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.
274
275 =back
276
277 =head1 New or Changed Diagnostics
278
279 =head2 Attempt to set length of freed array
280
281 This 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
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.
291
292 =head2 "%s" variable %s masks earlier declaration
293
294 This warning is now emitted in more consistent cases; in short, when one
295 of 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
301 On the other hand, the following :
302
303     our $x; our $x;
304
305 now gives a C<"our" variable %s redeclared> warning.
306
307 =head2 readdir()/closedir()/etc. attempted on invalid dirhandle
308
309 These new warnings are now emitted when a dirhandle is used but is
310 either closed or not really a dirhandle.
311
312 =head1 Changed Internals
313
314 XXX consting
315
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_MATHOM> in the compiler flags.
320
321 The C<AvFLAGS> macro has been removed.
322
323 =head2 B:: modules inheritance changed
324
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>).
327
328 =head1 Known Problems
329
330 =head2 Platform Specific Problems
331
332 =head1 Reporting Bugs
333
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.
338
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.
344
345 =head1 SEE ALSO
346
347 The F<Changes> file for exhaustive details on what changed.
348
349 The F<INSTALL> file for how to build Perl.
350
351 The F<README> file for general stuff.
352
353 The F<Artistic> and F<Copying> files for copyright information.
354
355 =cut