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