This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: 342c852 changed $re::VERSION
[perl5.git] / pod / perl51311delta.pod
CommitLineData
c71a852f
FR
1=encoding utf8
2
3=head1 NAME
4
5perl51311delta - what is new for perl v5.13.11
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.13.10 release and
10the 5.13.11 release.
11
12If you are upgrading from an earlier release such as 5.13.9, first read
13L<perl5139delta>, which describes differences between 5.13.9 and
145.13.10.
15
16=head1 Security
17
18=head2 User-defined regular expression properties
19
20Perl no longer allows a tainted regular expression to invoke a user-defined
21property via C<\p{...}> syntax. It simply dies instead [perl #82616].
22
23=head1 Incompatible Changes
24
25=head2 local($_) will strip all magic from $_
26
27local() on scalar variables will give them a new value, but keep all
28their magic intact. This has proven to be problematic for the default
29scalar variable $_, where L<perlsub> recommends that any subroutine
30that assigns to $_ should localize it first. This would throw an
31exception if $_ is aliased to a read-only variable, and could have
32various unintentional side-effects in general.
33
34Therefore, as an exception to the general rule, local($_) will not
35only assign a new value to $_, but also remove all existing magic from
36it as well.
37
38=head2 Passing references to warn()
39
40An earlier Perl 5.13.x release changed C<warn($ref)> to leave the reference
41unchanged, allowing C<$SIG{__WARN__}> handlers to access the original
42reference. But this stopped warnings that were references from having the
43file and line number appended even when there was no C<$SIG{__WARN__}>
44handler in place.
45
46Now C<warn> checks for the presence of such a handler and, if there is
47none, proceeds to stringify the reference and append the file and line
48number. This allows simple uses of C<warn> for debugging to continue to
49work as they did before.
50
51=head2 fork() emulation will not wait for signalled children
52
53On Windows parent processes would not terminate until all forked
54childred had terminated first. However, C<kill('KILL', ...)> is
55inherently unstable on pseudo-processes, and C<kill('TERM', ...)>
56might not get delivered if the child if blocked in a system call.
57
58To avoid the deadlock and still provide a safe mechanism to terminate
59the hosting process, Perl will now no longer wait for children that
60have been sent a SIGTERM signal. It is up to the parent process to
61waitpid() for these children if child clean-up processing must be
62allowed to finish. However, it is also the responsibility of the
63parent then to avoid the deadlock by making sure the child process
64can't be blocked on I/O either.
65
66See L<perlfork> for more information about the fork() emulation on
67Windows.
68
69=head2 Perl source code is read in text mode on Windows
70
71Perl scripts used to be read in binary mode on Windows for the benefit
72of the ByteLoader module (which is no longer part of core Perl). This
73had the side effect of breaking various operations on the DATA filehandle,
74including seek()/tell(), and even simply reading from DATA after file handles
75have been flushed by a call to system(), backticks, fork() etc.
76
77The default build options for Windows have been changed to read Perl source
78code on Windows in text mode now. Hopefully ByteLoader will be updated on
79CPAN to automatically handle this situation.
80
81=head1 Performance Enhancements
82
83=over 4
84
85=item *
86
87An earlier optimisation to speed up C<my @array = ...> and
88C<my %hash = ...> assignments caused a bug and was disabled in Perl 5.12.0.
89
90Now we have found another way to speed up these assignments [perl #82110].
91
92=back
93
94=head1 Modules and Pragmata
95
96=head2 Updated Modules and Pragmata
97
98=over 4
99
100=item *
101
102C<attributes> has been upgraded from version 0.13 to 0.14.
103
104=item *
105
106C<base> has been upgraded from version 2.15 to 2.16.
107
108=item *
109
110C<CPAN> has been upgraded from version 1.94_65 to 1.9600.
111
112=item *
113
114C<CPANPLUS> has been upgraded from version 0.9101 to 0.9103
115
116=item *
117
118C<CPANPLUS::Dist::Build> has been upgraded from version 0.52 to 0.54
119
120=item *
121
122C<Cwd> has been downgraded from version 3.37 to 3.36.
123
124An optimisation that recent core changes have rendered unnecessary has been
125reverted.
126
127=item *
128
129C<Devel::DProf> has been upgraded from version 20110225.01 to 20110228.00.
130
131=item *
132
133C<Digest::SHA> has been upgraded from version 5.50 to 5.61
134
135New SHA-512/224 and SHA-512/256 transforms ref. NIST Draft FIPS 180-4 (February 2011)
136
137=item *
138
139C<ExtUtils::Command> has been upgraded from version 1.16 to 1.17.
140
141=item *
142
143C<File::Copy> has been downgraded from version 2.22 to 2.21.
144
145An optimisation that recent core changes have rendered unnecessary has been
146reverted.
147
148=item *
149
150C<File::Glob> has been upgraded from version 1.11 to 1.12.
151
152=item *
153
154C<GDBM_File> has been upgraded from version 1.13 to 1.14.
155
156=item *
157
158C<Hash::Util> has been upgraded from version 0.10 to 0.11.
159
160=item *
161
162C<Hash::Util::FieldHash> has been upgraded from version 1.08 to 1.09.
163
164=item *
165
166C<HTTP::Tiny> has been upgraded from version 0.010 to 0.011.
167
168=item *
169
170C<I18N::Langinfo> has been upgraded from version 0.07 to 0.08.
171
172=item *
173
174C<IO> has been upgraded from version 1.25_03 to 1.25_04.
175
176=item *
177
178C<JSON::PP> has been upgraded from version 2.27103 to 2.27105
179
180=item *
181
182C<Locale::Codes> has been upgraded from version 3.15 to 3.16
183
184=item *
185
186C<Math::BigInt> has been upgraded from version 1.992 to 1.994
187
188=item *
189
190C<Math::BigInt::FastCalc> has been upgraded from version 0.24_02 to 0.28
191
192=item *
193
194C<Module::Build> has been upgraded from version 0.37_05 to 0.3800
195
196=item *
197
198C<Module::CoreList> has been upgraded from version 2.45 to 2.46.
199
200=item *
201
202C<mro> has been upgraded from version 1.06 to 1.07.
203
204=item *
205
206C<NDBM_File> has been upgraded from version 1.11 to 1.12.
207
208=item *
209
210C<parent> has been upgraded from version 0.224 to 0.225
211
212=item *
213
214C<Pod::Simple> has been upgraded from version 3.15 to 3.16
215
216=item *
217
218C<Storable> has been upgraded from version 2.26 to 2.27.
219
220=item *
221
222C<Sys::Hostname> has been upgraded from version 1.15 to 1.16.
223
224=item *
225
226C<Test::Harness> has been upgraded from version 3.22 to 3.23
227
228=item *
229
230C<Test::Simple> has been upgraded from version 0.97_01 to 0.98
231
232=item *
233
234C<Tie::Hash::NamedCapture> has been upgraded from version 0.07 to 0.08.
235
236Some of the Perl code has been converted to XS for efficency's sake.
237
238=item *
239
240C<Tie::RefHash> has been upgraded from version 1.38 to 1.39.
241
242=item *
243
244C<Unicode::Collate> has been upgraded from version 0.72 to 0.73
245
246DUCET has been updated for Unicode 6.0.0 as Collate/allkeys.txt and
247the default UCA_Version is 22.
248
249=item *
250
251C<Unicode::UCD> has been upgraded from version 0.31 to 0.32.
252This includes a number of bug fixes:
253
254=over 4
255
256=item charinfo()
257
258=over 4
259
260=item *
261
262It is now updated to Unicode Version 6 with Corrigendum #8, except,
263as with Perl 5.14, the code point at U+1F514 has no name.
264
265=item *
266
267The Hangul syllable code points have the correct names, and their
268decompositions are always output without requiring L<Lingua::KO::Hangul::Util>
269to be installed.
270
271=item *
272
273The CJK (Chinese-Japanese-Korean) code points U+2A700 - U+2B734
274and U+2B740 - 2B81D are now properly handled.
275
276=item *
277
278The numeric values are now output for those CJK code points that have them.
279
280=item *
281
282The names that are output for code points with multiple aliases are now the
283corrected ones.
284
285=back
286
287=item charscript()
288
289This now correctly returns "Unknown" instead of C<undef> for the script
290of a code point that hasn't been assigned another one.
291
292=item charblock()
293
294This now correctly returns "No_Block" instead of C<undef> for the block
295of a code point that hasn't been assigned to another one.
296
297=back
298
299=item *
300
301C<XS::Typemap> has been upgraded from version 0.04 to 0.05.
302
303=back
304
305=head1 Documentation
306
307=head2 Changes to Existing Documentation
308
309=head3 L<perlfunc>
310
311=over 4
312
313=item *
314
315Clarified the order in which to check C<$@> and C<$!> after C<do FILE>.
316(RT #80626)
317
318=back
319
320=head1 Diagnostics
321
322The following additions or changes have been made to diagnostic output,
323including warnings and fatal error messages. For the complete list of
324diagnostic messages, see L<perldiag>.
325
326=head2 New Diagnostics
327
328=over 4
329
330=item *
331
332Regexp modifier "/%c" may not appear twice
333
334(F syntax) The regular expression pattern had one of the mutually exclusive
335modifiers repeated. Remove all but one of the occurrences.
336
337=item *
338
339Regexp modifiers "/%c" and "/%c" are mutually exclusive
340
341(F syntax) The regular expression pattern had more than one of the mutually
342exclusive modifiers. Retain only the modifier that is supposed to be there.
343
344=item *
345
346Insecure user-defined property %s
347
348(F) Perl detected tainted data when trying to compile a regular
349expression that contains a call to a user-defined character property
350function, i.e. C<\p{IsFoo}> or C<\p{InFoo}>.
351See L<perlunicode/User-Defined Character Properties> and L<perlsec>.
352
353=back
354
355=head1 Testing
356
357Many of the tests have been refactored to use testing libraries more
358consistently. In some cases test files were created or deleted:
359
360=over 4
361
362=item *
363
364The tests for C<split /\s/> and Unicode have been moved from
365F<t/op/split.t> to the new F<t/op/split_unicode.t>.
366
367=item *
368
369F<t/re/re.t> has been moved to F<ext/re/t/re_funcs_u.t>.
370
371=item *
372
373The tests for [perl #72922] have been moved from F<t/re/qr.t> to the new
374F<t/re/qr-72922.t>.
375
376=item *
377
378F<t/re/reg_unsafe.t> has been deleted and its only test moved to
379F<t/re/pat_advanced.t>.
380
381=back
382
383=head1 Selected Bug Fixes
384
385=over 4
386
387=item *
388
389A fix for a bug in C<length(undef)> in 5.13.4 introduced a regression that
390meant C<print length undef> did not warn when warnings were enabled. It now
391correctly warns [perl #85508].
392
393=item *
394
395The C<(?|...)> regular expression construct no longer crashes if the final
396branch has more sets of capturing parentheses than any other branch. This
397was fixed in Perl 5.10.1 for the case of a single branch, but that fix did
398not take multiple branches into account [perl #84746].
399
400=item *
401
402Accessing an element of a package array with a hard-coded number (as
403opposed to an arbitrary expression) would crash if the array did not exist.
404Usually the array would be autovivified during compilation, but typeglob
405manipulation could remove it, as in these two cases which used to crash:
406
407 *d = *a; print $d[0];
408 undef *d; print $d[0];
409
410=item *
411
412C<#line> directives in string evals were not properly updating the arrays
413of lines of code (C<< @{"_<..."} >>) that the debugger (or any debugging or
414profiling module) uses. In threaded builds, they were not being updated at
415all. In non-threaded builds, the line number was ignored, so any change to
416the existing line number would cause the lines to be misnumbered
417[perl #79442].
418
419=item *
420
421C<$AUTOLOAD> used to remain tainted forever if it ever became tainted. Now
422it is correctly untainted if an autoloaded method is called and the method
423name was not tainted.
424
425=item *
426
427A bug has been fixed in the implementation of C<{...}> quantifiers in
428regular expressions that prevented the code block in
429C</((\w+)(?{ print $2 })){2}/> from seeing the C<$2> sometimes
430[perl #84294].
431
432=item *
433
434C<sprintf> now dies when passed a tainted scalar for the format. It did
435already die for arbitrary expressions, but not for simple scalars
436[perl #82250].
437
438=item *
439
440DESTROY methods of objects implementing ties are no longer able to crash by
441accessing the tied variable through a weak reference [perl #86328].
442
443=item *
444
445On Windows, calling kill(9, $child) on a pseudo-process created by the fork()
446emulation is inherently unstable. It can also be responsible for overriding
447the parent process exit code with a value of '9' if the parent terminates
448right after killing the child. This condition will now happen a lot less
449often than before.
450
451See also L</"fork() emulation will not wait for signalled children"> for a
452better way to terminate child processes that avoids deadlocks altogether.
453
454=item *
455
456Ensure that the C<exists &Errno::EFOO> idiom continues to work as documented.
457
458A change post-5.12 caused the documented idiom not to work if Errno was loaded
459after the C<exists> code had been compiled, as the compiler implicitly creates
460typeglobs in the Errno symbol table when it builds the optree for the C<exists
461code>.
462
463=back
464
465=head1 Acknowledgements
466
467Perl 5.13.11 represents approximately one month of development since Perl
4685.13.10 and contains approximately 80,000 lines of changes across 549 files from
46931 authors and committers:
470
471Alastair Douglas, Arvan, Boris Ratner, brian d foy, Chris 'BinGOs' Williams,
472Craig A. Berry, David Golden, David Leadbeater, David Mitchell, Father
473Chrysostomos, Florian Ragwitz, Jan Dubois, Karl Williamson, Kevin Ryde, Leon
474Brocard, Leon Timmermans, Michael Stevens, Michael Witten, Moritz Lenz, Nicholas
475Clark, Paul Johnson, Peter John Acklam, Reini Urban, Robin Barker, Steve Hay,
476Sullivan Beck, Tony Cook, Vadim Konovalov, Yves Orton, Zefram and Ævar Arnfjörð
477Bjarmason
478
479=head1 Reporting Bugs
480
481If you find what you think is a bug, you might check the articles
482recently posted to the comp.lang.perl.misc newsgroup and the perl
483bug database at http://rt.perl.org/perlbug/ . There may also be
484information at http://www.perl.org/ , the Perl Home Page.
485
486If you believe you have an unreported bug, please run the L<perlbug>
487program included with your release. Be sure to trim your bug down
488to a tiny but sufficient test case. Your bug report, along with the
489output of C<perl -V>, will be sent off to perlbug@perl.org to be
490analysed by the Perl porting team.
491
492If the bug you are reporting has security implications, which make it
493inappropriate to send to a publicly archived mailing list, then please send
494it to perl5-security-report@perl.org. This points to a closed subscription
495unarchived mailing list, which includes all the core committers, who be able
496to help assess the impact of issues, figure out a resolution, and help
497co-ordinate the release of patches to mitigate or fix the problem across all
498platforms on which Perl is supported. Please only use this address for
499security issues in the Perl core, not for modules independently
500distributed on CPAN.
501
502=head1 SEE ALSO
503
504The F<Changes> file for an explanation of how to view exhaustive details
505on what changed.
506
507The F<INSTALL> file for how to build Perl.
508
509The F<README> file for general stuff.
510
511The F<Artistic> and F<Copying> files for copyright information.
512
513=cut