Commit | Line | Data |
---|---|---|
e5ba1bf1 FC |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
0bba4573 | 5 | perl5180delta - what is new for perl v5.18.0 |
e5ba1bf1 FC |
6 | |
7 | =head1 DESCRIPTION | |
8 | ||
0bba4573 | 9 | This document describes differences between the 5.16.0 release and the 5.18.0 |
e5ba1bf1 FC |
10 | release. |
11 | ||
0bba4573 RS |
12 | If you are upgrading from an earlier release such as 5.14.0, first read |
13 | L<perl5140delta>, which describes differences between 5.12.0 and 5.14.0. | |
e5ba1bf1 FC |
14 | |
15 | =head1 Notice | |
16 | ||
17 | XXX Any important notices here | |
18 | ||
19 | =head1 Core Enhancements | |
20 | ||
0fef449b RS |
21 | =head2 More CORE:: subs |
22 | ||
23 | Several more built-in functions have been added as subroutines to the | |
24 | CORE:: namespace, namely, those non-overridable keywords that can be | |
25 | implemented without custom parsers: C<defined>, C<delete>, C<exists>, | |
26 | C<glob>, C<pos>, C<protoytpe>, C<scalar>, C<split>, C<study>, and C<undef>. | |
27 | ||
28 | As some of these have prototypes, C<prototype('CORE::...')> has been | |
29 | changed to not make a distinction between overridable and non-overridable | |
30 | keywords. This is to make C<prototype('CORE::pos')> consistent with | |
31 | C<prototype(&CORE::pos)>. | |
e5ba1bf1 | 32 | |
e5ba1bf1 FC |
33 | |
34 | =head1 Security | |
35 | ||
36 | XXX Any security-related notices go here. In particular, any security | |
37 | vulnerabilities closed should be noted here rather than in the | |
38 | L</Selected Bug Fixes> section. | |
39 | ||
40 | [ List each security issue as a =head2 entry ] | |
41 | ||
42 | =head1 Incompatible Changes | |
43 | ||
0bba4573 RS |
44 | =head2 qw(...) can no longer be used as parentheses |
45 | ||
46 | C<qw> lists used to fool the parser into thinking they were always | |
47 | surrounded by parentheses. This permitted some surprising constructions | |
48 | such as C<foreach $x qw(a b c) {...}>, which should really be written | |
49 | C<foreach $x (qw(a b c)) {...}>. These would sometimes get the lexer into | |
50 | the wrong state, so they didn't fully work, and the similar C<foreach qw(a | |
51 | b c) {...}> that one might expect to be permitted never worked at all. | |
52 | ||
53 | This side effect of C<qw> has now been abolished. It has been deprecated | |
54 | since Perl 5.13.11. It is now necessary to use real parentheses | |
55 | everywhere that the grammar calls for them. | |
e5ba1bf1 | 56 | |
0bba4573 | 57 | =head2 C<\s> in regular expressions now matches a Vertical Tab |
e5ba1bf1 | 58 | |
0bba4573 | 59 | [ XXX ] |
e5ba1bf1 | 60 | |
0fef449b RS |
61 | =head2 C</(?{})/> and C</(??{})/> have been heavily reworked |
62 | ||
63 | The implementation of this feature has been almost completely rewritten. | |
64 | Although its main intent is to fix bugs, some behaviors, especially | |
65 | related to the scope of lexical variables, will have changed. This is | |
66 | described more fully in the L</Selected Bug Fixes> section. | |
67 | ||
68 | =head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007 | |
69 | ||
70 | Unicode 6.0 reused the name "BELL" for a different code point than it | |
71 | traditionally had meant. Since Perl v5.14, use of this name still | |
72 | referred to U+0007, but would raise a deprecation warning. Now, "BELL" | |
73 | refers to U+1F514, and the name for U+0007 is "ALERT". All the | |
74 | functions in L<charnames> have been correspondingly updated. | |
75 | ||
76 | =head2 Alphanumeric operators must now be separated from the closing | |
77 | delimiter of regular expressions | |
78 | ||
79 | You may no longer write something like: | |
80 | ||
81 | m/a/and 1 | |
82 | ||
83 | Instead you must write | |
84 | ||
85 | m/a/ and 1 | |
86 | ||
87 | with whitespace separating the operator from the closing delimiter of | |
88 | the regular expression. Not having whitespace has resulted in a | |
89 | deprecation warning since Perl v5.14.0. | |
90 | ||
91 | =head2 C<require> dies for unreadable files | |
92 | ||
93 | When C<require> encounters an unreadable file, it now dies. It used to | |
94 | ignore the file and continue searching the directories in @INC | |
95 | [perl #113422]. | |
96 | ||
97 | =head2 Upgrade to the Unicode 6.2 beta | |
98 | ||
99 | Unicode 6.2 is proposing some changes that may very well break some CPAN | |
100 | modules. The timing of this nicely coincides with Perl's being early in the | |
101 | release cycle. This commit takes the current beta 6.2, adds the proposed | |
102 | changes that aren't yet in it, and subtracts the changes that would affect \X | |
103 | processing, as those turn out to have errors, and may have to be rethought. | |
104 | Unicode has been notified of these problems. | |
105 | ||
106 | This will allow us to gather data as to whether or not the proposed changes | |
107 | cause us problems. These will be presented to Unicode to aid in their final | |
108 | decision as to whether or not to go forward with the changes. | |
109 | ||
110 | These changes will be replaced by the final version of Unicode 6.2 before | |
111 | 5.18.0 is released. | |
112 | ||
e5ba1bf1 FC |
113 | =head1 Deprecations |
114 | ||
115 | XXX Any deprecated features, syntax, modules etc. should be listed here. In | |
116 | particular, deprecated modules should be listed here even if they are listed as | |
117 | an updated module in the L</Modules and Pragmata> section. | |
118 | ||
119 | [ List each deprecation as a =head2 entry ] | |
120 | ||
121 | =head1 Performance Enhancements | |
122 | ||
123 | XXX Changes which enhance performance without changing behaviour go here. | |
124 | There may well be none in a stable release. | |
125 | ||
126 | [ List each enhancement as a =item entry ] | |
127 | ||
128 | =over 4 | |
129 | ||
130 | =item * | |
131 | ||
0bba4573 RS |
132 | Filetest ops manage the stack in a fractionally more efficient manner. |
133 | ||
134 | =item * | |
135 | ||
136 | Globs used in a numeric context are now numerified directly in most cases, | |
137 | rather than being numerified via stringification. | |
e5ba1bf1 | 138 | |
0fef449b RS |
139 | =item * |
140 | ||
141 | The C<x> repetition operator is now folded to a single constant at compile | |
142 | time if called in scalar context with constant operands and no parentheses | |
143 | around the left operand. | |
144 | ||
e5ba1bf1 FC |
145 | =back |
146 | ||
147 | =head1 Modules and Pragmata | |
148 | ||
149 | XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/> | |
150 | go here. If Module::CoreList is updated, generate an initial draft of the | |
151 | following sections using F<Porting/corelist-perldelta.pl>, which prints stub | |
152 | entries to STDOUT. Results can be pasted in place of the '=head2' entries | |
153 | below. A paragraph summary for important changes should then be added by hand. | |
154 | In an ideal world, dual-life modules would have a F<Changes> file that could be | |
155 | cribbed. | |
156 | ||
157 | [ Within each section, list entries as a =item entry ] | |
158 | ||
159 | =head2 New Modules and Pragmata | |
160 | ||
161 | =over 4 | |
162 | ||
163 | =item * | |
164 | ||
165 | XXX | |
166 | ||
167 | =back | |
168 | ||
169 | =head2 Updated Modules and Pragmata | |
170 | ||
171 | =over 4 | |
172 | ||
173 | =item * | |
174 | ||
175 | L<XXX> has been upgraded from version A.xx to B.yy. | |
176 | ||
177 | =back | |
178 | ||
179 | =head2 Removed Modules and Pragmata | |
180 | ||
0bba4573 | 181 | =over |
e5ba1bf1 FC |
182 | |
183 | =item * | |
184 | ||
0bba4573 RS |
185 | L<Version::Requirements> has been removed from the core distribution. It is |
186 | available under a different name: L<CPAN::Meta::Requirements>. | |
e5ba1bf1 FC |
187 | |
188 | =back | |
189 | ||
190 | =head1 Documentation | |
191 | ||
192 | XXX Changes to files in F<pod/> go here. Consider grouping entries by | |
193 | file and be sure to link to the appropriate page, e.g. L<perlfunc>. | |
194 | ||
195 | =head2 New Documentation | |
196 | ||
197 | XXX Changes which create B<new> files in F<pod/> go here. | |
198 | ||
199 | =head3 L<XXX> | |
200 | ||
201 | XXX Description of the purpose of the new file here | |
202 | ||
203 | =head2 Changes to Existing Documentation | |
204 | ||
0bba4573 | 205 | =head3 L<perldata> |
e5ba1bf1 | 206 | |
0bba4573 RS |
207 | =over 4 |
208 | ||
209 | =item * | |
210 | ||
211 | Now explicitly documents the behaviour of hash initializer lists that | |
212 | contain duplicate keys. | |
213 | ||
214 | =back | |
215 | ||
216 | =head3 L<perldiag> | |
217 | ||
218 | =over 4 | |
219 | ||
220 | =item * | |
221 | ||
222 | The explanation of symbolic references being prevented by "strict refs" | |
223 | now doesn't assume that the reader knows what symbolic references are. | |
224 | ||
225 | =back | |
226 | ||
227 | =head3 L<perlfunc> | |
e5ba1bf1 FC |
228 | |
229 | =over 4 | |
230 | ||
231 | =item * | |
232 | ||
0bba4573 | 233 | The return value of C<pipe> is now documented. |
e5ba1bf1 FC |
234 | |
235 | =back | |
236 | ||
0fef449b RS |
237 | =head3 L<perlfaq> |
238 | ||
239 | =over 4 | |
240 | ||
241 | =item * | |
242 | ||
243 | L<perlfaq> has been synchronized with version 5.0150040 from CPAN. | |
244 | ||
245 | =back | |
246 | ||
247 | =head3 L<perlcheat> | |
248 | ||
249 | =over 4 | |
250 | ||
251 | =item * | |
252 | ||
253 | L<perlcheat> has been reorganized, and a few new sections were added. | |
254 | ||
255 | =back | |
256 | ||
0bba4573 | 257 | =head3 Diagnostics |
e5ba1bf1 FC |
258 | |
259 | The following additions or changes have been made to diagnostic output, | |
260 | including warnings and fatal error messages. For the complete list of | |
261 | diagnostic messages, see L<perldiag>. | |
262 | ||
263 | XXX New or changed warnings emitted by the core's C<C> code go here. Also | |
264 | include any changes in L<perldiag> that reconcile it to the C<C> code. | |
265 | ||
266 | =head2 New Diagnostics | |
267 | ||
268 | XXX Newly added diagnostic messages go under here, separated into New Errors | |
269 | and New Warnings | |
270 | ||
271 | =head3 New Errors | |
272 | ||
273 | =over 4 | |
274 | ||
275 | =item * | |
276 | ||
277 | XXX L<message|perldiag/"message"> | |
278 | ||
279 | =back | |
280 | ||
281 | =head3 New Warnings | |
282 | ||
283 | =over 4 | |
284 | ||
285 | =item * | |
286 | ||
287 | XXX L<message|perldiag/"message"> | |
288 | ||
289 | =back | |
290 | ||
291 | =head2 Changes to Existing Diagnostics | |
292 | ||
293 | XXX Changes (i.e. rewording) of diagnostic messages go here | |
294 | ||
295 | =over 4 | |
296 | ||
297 | =item * | |
298 | ||
0fef449b RS |
299 | The "Runaway prototype" warning that occurs in bizarre cases has been |
300 | removed as being unhelpful and inconsistent. | |
301 | ||
302 | =item * | |
303 | ||
304 | The "Not a format reference" error has been removed, as the only case in | |
305 | which it could be triggered was a bug. | |
306 | ||
307 | =item * | |
308 | ||
309 | The "Unable to create sub named %s" error has been removed for the same | |
310 | reason. | |
e5ba1bf1 FC |
311 | |
312 | =back | |
313 | ||
314 | =head1 Utility Changes | |
315 | ||
316 | XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here. | |
317 | Most of these are built within the directories F<utils> and F<x2p>. | |
318 | ||
319 | [ List utility changes as a =head3 entry for each utility and =item | |
320 | entries for each change | |
321 | Use L<XXX> with program names to get proper documentation linking. ] | |
322 | ||
323 | =head3 L<XXX> | |
324 | ||
325 | =over 4 | |
326 | ||
327 | =item * | |
328 | ||
329 | XXX | |
330 | ||
331 | =back | |
332 | ||
333 | =head1 Configuration and Compilation | |
334 | ||
335 | XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools | |
336 | go here. Any other changes to the Perl build process should be listed here. | |
337 | However, any platform-specific changes should be listed in the | |
338 | L</Platform Support> section, instead. | |
339 | ||
340 | [ List changes as a =item entry ]. | |
341 | ||
342 | =over 4 | |
343 | ||
344 | =item * | |
345 | ||
346 | XXX | |
347 | ||
348 | =back | |
349 | ||
350 | =head1 Testing | |
351 | ||
352 | XXX Any significant changes to the testing of a freshly built perl should be | |
353 | listed here. Changes which create B<new> files in F<t/> go here as do any | |
354 | large changes to the testing harness (e.g. when parallel testing was added). | |
355 | Changes to existing files in F<t/> aren't worth summarizing, although the bugs | |
356 | that they represent may be covered elsewhere. | |
357 | ||
358 | [ List each test improvement as a =item entry ] | |
359 | ||
360 | =over 4 | |
361 | ||
362 | =item * | |
363 | ||
0bba4573 RS |
364 | The test suite now has a section for tests that require very large amounts |
365 | of memory. These tests won't run by default; they can be enabled by | |
366 | setting the C<PERL_TEST_MEMORY> environment variable to the number of | |
367 | gibibytes of memory that may be safely used. | |
e5ba1bf1 FC |
368 | |
369 | =back | |
370 | ||
371 | =head1 Platform Support | |
372 | ||
373 | XXX Any changes to platform support should be listed in the sections below. | |
374 | ||
375 | [ Within the sections, list each platform as a =item entry with specific | |
376 | changes as paragraphs below it. ] | |
377 | ||
378 | =head2 New Platforms | |
379 | ||
380 | XXX List any platforms that this version of perl compiles on, that previous | |
381 | versions did not. These will either be enabled by new files in the F<hints/> | |
382 | directories, or new subdirectories and F<README> files at the top level of the | |
383 | source tree. | |
384 | ||
385 | =over 4 | |
386 | ||
387 | =item XXX-some-platform | |
388 | ||
389 | XXX | |
390 | ||
391 | =back | |
392 | ||
393 | =head2 Discontinued Platforms | |
394 | ||
395 | XXX List any platforms that this version of perl no longer compiles on. | |
396 | ||
397 | =over 4 | |
398 | ||
399 | =item XXX-some-platform | |
400 | ||
401 | XXX | |
402 | ||
403 | =back | |
404 | ||
405 | =head2 Platform-Specific Notes | |
406 | ||
407 | XXX List any changes for specific platforms. This could include configuration | |
408 | and compilation changes or changes in portability/compatibility. However, | |
409 | changes within modules for platforms should generally be listed in the | |
410 | L</Modules and Pragmata> section. | |
411 | ||
412 | =over 4 | |
413 | ||
0bba4573 | 414 | =item clang++ |
e5ba1bf1 | 415 | |
0bba4573 RS |
416 | There is now a workaround for a compiler bug that prevented compiling |
417 | with clang++ since Perl 5.15.7 [perl #112786]. | |
418 | ||
419 | =item C++ | |
420 | ||
421 | When compiling the Perl core as C++ (which is only semi-supported), the | |
422 | mathom functions are now compiled as C<extern "C">, to ensure proper | |
423 | binary compatibility. (However, binary compatibility isn't generally | |
424 | guaranteed anyway in the situations where this would matter.) | |
425 | ||
426 | =item VMS | |
427 | ||
428 | It should now be possible to compile Perl as C++ on VMS. | |
e5ba1bf1 | 429 | |
0fef449b RS |
430 | =item Win32 |
431 | ||
432 | C<link> on Win32 now attempts to set C<$!> to more appropriate values | |
433 | based on the Win32 API error code. [perl #112272] | |
434 | ||
435 | Perl no longer mangles the environment block, e.g. when launching a new | |
436 | sub-process, when the environment contains non-ASCII characters. Known | |
437 | problems still remain, however, when the environment contains characters | |
438 | outside of the current ANSI codepage (e.g. see the item about Unicode in | |
439 | C<%ENV> in L<http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod>). | |
440 | [perl #113536] | |
441 | ||
442 | =item VMS | |
443 | ||
444 | All C header files from the top-level directory of the distribution are now | |
445 | installed on VMS, providing consistency with a long-standing practice on other | |
446 | platforms. Previously only a subset were installed, which broke non-core | |
447 | extension builds for extensions that depended on the missing include files. | |
448 | ||
e5ba1bf1 FC |
449 | =back |
450 | ||
451 | =head1 Internal Changes | |
452 | ||
0bba4573 | 453 | =over |
e5ba1bf1 | 454 | |
0bba4573 | 455 | =item * |
e5ba1bf1 | 456 | |
0bba4573 RS |
457 | The C<CV *> typemap entry now supports C<&{}> overloading and typeglobs, |
458 | just like C<&{...}> [perl #96872]. | |
e5ba1bf1 FC |
459 | |
460 | =item * | |
461 | ||
0bba4573 RS |
462 | The C<SVf_AMAGIC> flag to indicate overloading is now on the stash, not the |
463 | object. It is now set automatically whenever a method or @ISA changes, so | |
464 | its meaning has changed, too. It now means "potentially overloaded". When | |
465 | the overload table is calculated, the flag is automatically turned off if | |
466 | there is no overloading, so there should be no noticeable slowdown. | |
467 | ||
468 | The staleness of the overload tables is now checked when overload methods | |
469 | are invoked, rather than during C<bless>. | |
470 | ||
471 | "A" magic is gone. The changes to the handling of the C<SVf_AMAGIC> flag | |
472 | eliminate the need for it. | |
473 | ||
474 | C<PL_amagic_generation> has been removed as no longer necessary. For XS | |
475 | modules, it is now a macro alias to C<PL_na>. | |
476 | ||
477 | The fallback overload setting is now stored in a stash entry separate from | |
478 | overloadedness itself. | |
479 | ||
480 | =item * | |
481 | ||
482 | The character-processing code has been cleaned up in places. The changes | |
483 | should be operationally invisible. | |
e5ba1bf1 | 484 | |
0fef449b RS |
485 | =item * |
486 | ||
487 | The C<study> function was made a no-op in 5.16. It was simply disabled via | |
488 | a C<return> statement; the code was left in place. Now the code supporting | |
489 | what C<study> used to do has been removed. | |
490 | ||
491 | =item * | |
492 | ||
493 | Under threaded perls, there is no longer a separate PV allocated for every | |
494 | COP to store its package name (C<< cop->stashpv >>). Instead, there is an | |
495 | offset (C<< cop->stashoff >>) into the new C<PL_stashpad> array, which | |
496 | holds stash pointers. | |
497 | ||
498 | =item * | |
499 | ||
500 | In the pluggable regex API, the C<regexp_engine> struct has acquired a new | |
501 | field C<op_comp>, which is currently just for perl's internal use, and | |
502 | should be initialised to NULL by other regex plugin modules. | |
503 | ||
504 | =item * | |
505 | ||
506 | A new function C<alloccoptash> has been added to the API, but is considered | |
507 | experimental. See L<perlapi>. | |
508 | ||
e5ba1bf1 FC |
509 | =back |
510 | ||
511 | =head1 Selected Bug Fixes | |
512 | ||
513 | XXX Important bug fixes in the core language are summarized here. Bug fixes in | |
514 | files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>. | |
515 | ||
516 | [ List each fix as a =item entry ] | |
517 | ||
518 | =over 4 | |
519 | ||
520 | =item * | |
521 | ||
0bba4573 RS |
522 | C<goto ''> now looks for an empty label, producing the "goto must have |
523 | label" error message, instead of exiting the program [perl #111794]. | |
e5ba1bf1 | 524 | |
0bba4573 | 525 | =item * |
e5ba1bf1 | 526 | |
0bba4573 RS |
527 | C<goto "\0"> now dies with "Can't find label" instead of "goto must have |
528 | label". | |
e5ba1bf1 | 529 | |
0bba4573 | 530 | =item * |
e5ba1bf1 | 531 | |
0bba4573 RS |
532 | The C function C<hv_store> used to result in crashes when used on C<%^H> |
533 | [perl #111000]. | |
e5ba1bf1 | 534 | |
0bba4573 RS |
535 | =item * |
536 | ||
537 | A call checker attached to a closure prototype via C<cv_set_call_checker> | |
538 | is now copied to closures cloned from it. So C<cv_set_call_checker> now | |
539 | works inside an attribute handler for a closure. | |
e5ba1bf1 FC |
540 | |
541 | =item * | |
542 | ||
0bba4573 RS |
543 | Writing to C<$^N> used to have no effect. Now it croaks with "Modification |
544 | of a read-only value" by default, but that can be overridden by a custom | |
545 | regular expression engine, as with C<$1> [perl #112184]. | |
546 | ||
23dd6e2e FC |
547 | =item * |
548 | ||
0bba4573 RS |
549 | C<undef> on a control character glob (C<undef *^H>) no longer emits an |
550 | erroneous warning about ambiguity [perl #112456]. | |
23dd6e2e | 551 | |
0bba4573 RS |
552 | =item * |
553 | ||
554 | For efficiency's sake, many operators and built-in functions return the | |
555 | same scalar each time. Lvalue subroutines and subroutines in the CORE:: | |
556 | namespace were allowing this implementation detail to leak through. | |
557 | C<print &CORE::uc("a"), &CORE::uc("b")> used to print "BB". The same thing | |
558 | would happen with an lvalue subroutine returning the return value of C<uc>. | |
559 | Now the value is copied in such cases. | |
23dd6e2e FC |
560 | |
561 | =item * | |
562 | ||
0bba4573 RS |
563 | C<method {}> syntax with an empty block or a block returning an empty list |
564 | used to crash or use some random value left on the stack as its invocant. | |
565 | Now it produces an error. | |
b92848b5 | 566 | |
0f023b5a FC |
567 | =item * |
568 | ||
0bba4573 | 569 | C<vec> now works with extremely large offsets (E<gt>2 GB) [perl #111730]. |
0f023b5a FC |
570 | |
571 | =item * | |
572 | ||
0bba4573 RS |
573 | Changes to overload settings now take effect immediately, as do changes to |
574 | inheritance that affect overloading. They used to take effect only after | |
575 | C<bless>. | |
576 | ||
577 | Objects that were created before a class had any overloading used to remain | |
578 | non-overloaded even if the class gained overloading through C<use overload> | |
579 | or @ISA changes, and even after C<bless>. This has been fixed | |
580 | [perl #112708]. | |
c53e3a75 FC |
581 | |
582 | =item * | |
583 | ||
0bba4573 | 584 | Classes with overloading can now inherit fallback values. |
c53e3a75 FC |
585 | |
586 | =item * | |
587 | ||
0bba4573 RS |
588 | Overloading was not respecting a fallback value of 0 if there were |
589 | overloaded objects on both sides of an assignment operator like C<+=> | |
590 | [perl #111856]. | |
0f023b5a FC |
591 | |
592 | =item * | |
593 | ||
0bba4573 RS |
594 | C<pos> now croaks with hash and array arguments, instead of producing |
595 | erroneous warnings. | |
0f023b5a FC |
596 | |
597 | =item * | |
598 | ||
0bba4573 RS |
599 | C<while(each %h)> now implies C<while(defined($_ = each %h))>, like |
600 | C<readline> and C<readdir>. | |
0f023b5a | 601 | |
0bba4573 RS |
602 | =item * |
603 | ||
604 | Subs in the CORE:: namespace no longer crash after C<undef *_> when called | |
605 | with no argument list (C<&CORE::time> with no parentheses). | |
606 | ||
607 | =item * | |
608 | ||
609 | Unicode 6.1 published an incorrect alias for one of the | |
610 | Canonical_Combining_Class property's values (which range between 0 and | |
611 | 254). The alias C<CCC133> should have been C<CCC132>. Perl now | |
612 | overrides the data file furnished by Unicode to give the correct value. | |
613 | ||
614 | =item * | |
615 | ||
616 | C<unpack> no longer produces the "'/' must follow a numeric type in unpack" | |
617 | error when it is the data that are at fault [perl #60204]. | |
618 | ||
619 | =item * | |
620 | ||
621 | C<join> and C<"@array"> now call FETCH only once on a tied C<$"> | |
622 | [perl #8931]. | |
623 | ||
624 | =item * | |
625 | ||
626 | Some subroutine calls generated by compiling core ops affected by a | |
627 | C<CORE::GLOBAL> override had op checking performed twice. The checking | |
628 | is always idempotent for pure Perl code, but the double checking can | |
629 | matter when custom call checkers are involved. | |
630 | ||
631 | =item * | |
632 | ||
633 | A race condition used to exist around fork that could cause a signal sent to | |
634 | the parent to be handled by both parent and child. Signals are now blocked | |
635 | briefly around fork to prevent this from happening [perl #82580]. | |
e5ba1bf1 | 636 | |
0fef449b RS |
637 | =item * |
638 | ||
639 | The implementation of code blocks in regular expressions, such as C<(?{})> | |
640 | and C<(??{})>, has been heavily reworked to eliminate a whole slew of bugs. | |
641 | The main user-visible changes are: | |
642 | ||
643 | =over 4 | |
644 | ||
645 | =item * | |
646 | ||
647 | Code blocks within patterns are now parsed in the same pass as the | |
648 | surrounding code; in particular it is no longer necessary to have balanced | |
649 | braces: this now works: | |
650 | ||
651 | /(?{ $x='{' })/ | |
652 | ||
653 | This means that this error message is longer generated: | |
654 | ||
655 | Sequence (?{...}) not terminated or not {}-balanced in regex | |
656 | ||
657 | but a new error may be seen: | |
658 | ||
659 | Sequence (?{...}) not terminated with ')' | |
660 | ||
661 | In addition, literal code blocks within run-time patterns are only | |
662 | compiled once, at perl compile-time: | |
663 | ||
664 | for my $p (...) { | |
665 | # this 'FOO' block of code is compiled once, | |
666 | # at the same time as the surrounding 'for' loop | |
667 | /$p{(?{FOO;})/; | |
668 | } | |
669 | ||
670 | =item * | |
671 | ||
672 | Lexical variables are now sane as regards scope, recursion and closure | |
673 | behavior. In particular, C</A(?{B})C/> behaves (from a closure viewpoint) | |
674 | exactly like C</A/ && do { B } && /C/>, while C<qr/A(?{B})C/> is like | |
675 | C<sub {/A/ && do { B } && /C/}>. So this code now works how you might | |
676 | expect, creating three regexes that match 0, 1, and 2: | |
677 | ||
678 | for my $i (0..2) { | |
679 | push @r, qr/^(??{$i})$/; | |
680 | } | |
681 | "1" =~ $r[1]; # matches | |
682 | ||
683 | =item * | |
684 | ||
685 | The C<use re 'eval'> pragma is now only required for code blocks defined | |
686 | at runtime; in particular in the following, the text of the C<$r> pattern is | |
687 | still interpolated into the new pattern and recompiled, but the individual | |
688 | compiled code-blocks within C<$r> are reused rather than being recompiled, | |
689 | and C<use re 'eval'> isn't needed any more: | |
690 | ||
691 | my $r = qr/abc(?{....})def/; | |
692 | /xyz$r/; | |
693 | ||
694 | =item * | |
695 | ||
696 | Flow control operators no longer crash. Each code block runs in a new | |
697 | dynamic scope, so C<next> etc. will not see | |
698 | any enclosing loops. C<return> returns a value | |
699 | from the code block, not from any enclosing subroutine. | |
700 | ||
701 | =item * | |
702 | ||
703 | Perl normally caches the compilation of run-time patterns, and doesn't | |
704 | recompile if the pattern hasn't changed, but this is now disabled if | |
705 | required for the correct behavior of closures. For example: | |
706 | ||
707 | my $code = '(??{$x})'; | |
708 | for my $x (1..3) { | |
709 | # recompile to see fresh value of $x each time | |
710 | $x =~ /$code/; | |
711 | } | |
712 | ||
713 | ||
714 | =item * | |
715 | ||
716 | The C</msix> and C<(?msix)> etc. flags are now propagated into the return | |
717 | value from C<(??{})>; this now works: | |
718 | ||
719 | "AB" =~ /a(??{'b'})/i; | |
720 | ||
721 | =item * | |
722 | ||
723 | Warnings and errors will appear to come from the surrounding code (or for | |
724 | run-time code blocks, from an eval) rather than from an C<re_eval>: | |
725 | ||
726 | use re 'eval'; $c = '(?{ warn "foo" })'; /$c/; | |
727 | /(?{ warn "foo" })/; | |
728 | ||
729 | formerly gave: | |
730 | ||
731 | foo at (re_eval 1) line 1. | |
732 | foo at (re_eval 2) line 1. | |
733 | ||
734 | and now gives: | |
735 | ||
736 | foo at (eval 1) line 1. | |
737 | foo at /some/prog line 2. | |
738 | ||
739 | =back | |
740 | ||
741 | =item * | |
742 | ||
743 | Perl now works as well as can be expected on all releases of Unicode so | |
744 | far. In v5.16, it worked on Unicodes 6.0 and 6.1, but there were | |
745 | various bugs for earlier releases; the older the release the more | |
746 | problems. | |
747 | ||
748 | =item * | |
749 | ||
750 | C<vec> no longer produces "uninitialized" warnings in lvalue context | |
751 | [perl #9423]. | |
752 | ||
753 | =item * | |
754 | ||
755 | An optimization involving fixed strings in regular expressions could cause | |
756 | a severe performance penalty in edge cases. This has been fixed | |
757 | [perl #76546]. | |
758 | ||
759 | =item * | |
760 | ||
761 | In certain cases, including empty subpatterns within a regular expression (such | |
762 | as C<(?:)> or C<(?:|)>) could disable some optimizations. This has been fixed. | |
763 | ||
764 | =item * | |
765 | ||
766 | The "Can't find an opnumber" message that C<prototype> produces when passed | |
767 | a string like "CORE::nonexistent_keyword" now passes UTF-8 and embedded | |
768 | NULs through unchanged [perl #97478]. | |
769 | ||
770 | =item * | |
771 | ||
772 | C<prototype> now treats magical variables like C<$1> the same way as | |
773 | non-magical variables when checking for the CORE:: prefix, instead of | |
774 | treating them as subroutine names. | |
775 | ||
776 | =item * | |
777 | ||
778 | Under threaded perls, a runtime code block in a regular expression could | |
779 | corrupt the package name stored in the op tree, resulting in bad reads | |
780 | in C<caller>, and possibly crashes [perl #113060]. | |
781 | ||
782 | =item * | |
783 | ||
784 | Referencing a closure prototype (C<\&{$_[1]}> in an attribute handler for a | |
785 | closure) no longer results in a copy of the subroutine (or assertion | |
786 | failures on debugging builds). | |
787 | ||
788 | =item * | |
789 | ||
790 | C<eval '__PACKAGE__'> now returns the right answer on threaded builds if | |
791 | the current package has been assigned over (as in | |
792 | C<*ThisPackage:: = *ThatPackage::>) [perl #78742]. | |
793 | ||
794 | =item * | |
795 | ||
796 | If a package is deleted by code that it calls, it is possible for C<caller> | |
797 | to see a stack frame belonging to that deleted package. C<caller> could | |
798 | crash if the stash's memory address was reused for a scalar and a | |
799 | substitution was performed on the same scalar [perl #113486]. | |
800 | ||
801 | =item * | |
802 | ||
803 | C<UNIVERSAL::can> no longer treats its first argument differently | |
804 | depending on whether it is a string or number internally. | |
805 | ||
806 | =item * | |
807 | ||
808 | C<open> with C<< <& >> for the mode checks to see whether the third argument is | |
809 | a number, in determining whether to treat it as a file descriptor or a handle | |
810 | name. Magical variables like C<$1> were always failing the numeric check and | |
811 | being treated as handle names. | |
812 | ||
813 | =item * | |
814 | ||
815 | C<warn>'s handling of magical variables (C<$1>, ties) has undergone several | |
816 | fixes. C<FETCH> is only called once now on a tied argument or a tied C<$@> | |
817 | [perl #97480]. Tied variables returning objects that stringify as "" are | |
818 | no longer ignored. A tied C<$@> that happened to return a reference the | |
819 | I<previous> time it was used is no longer ignored. | |
820 | ||
821 | =item * | |
822 | ||
823 | C<warn ""> now treats C<$@> with a number in it the same way, regardless of | |
824 | whether it happened via C<$@=3> or C<$@="3">. It used to ignore the | |
825 | former. Now it appends "\t...caught", as it has always done with | |
826 | C<$@="3">. | |
827 | ||
828 | =item * | |
829 | ||
830 | Numeric operators on magical variables (e.g., S<C<$1 + 1>>) used to use | |
831 | floating point operations even where integer operations were more appropriate, | |
832 | resulting in loss of accuracy on 64-bit platforms [perl #109542]. | |
833 | ||
834 | =item * | |
835 | ||
836 | Unary negation no longer treats a string as a number if the string happened | |
837 | to be used as a number at some point. So, if C<$x> contains the string "dogs", | |
838 | C<-$x> returns "-dogs" even if C<$y=0+$x> has happened at some point. | |
839 | ||
840 | =item * | |
841 | ||
842 | In Perl 5.14, C<-'-10'> was fixed to return "10", not "+10". But magical | |
843 | variables (C<$1>, ties) were not fixed till now [perl #57706]. | |
844 | ||
845 | =item * | |
846 | ||
847 | Unary negation now treats strings consistently, regardless of the internal | |
848 | C<UTF8> flag. | |
849 | ||
850 | =item * | |
851 | ||
852 | A regression introduced in Perl v5.16.0 involving | |
853 | C<tr/I<SEARCHLIST>/I<REPLACEMENTLIST>/> has been fixed. Only the first | |
854 | instance is supposed to be meaningful if a character appears more than | |
855 | once in C<I<SEARCHLIST>>. Under some circumstances, the final instance | |
856 | was overriding all earlier ones. [perl #113584] | |
857 | ||
858 | =item * | |
859 | ||
860 | Regular expressions like C<qr/\87/> previously silently inserted a NUL | |
861 | character, thus matching as if it had been written C<qr/\00087/>. Now it | |
862 | matches as if it had been written as C<qr/87/>, with a message that the | |
863 | sequence C<"\8"> is unrecognized. | |
864 | ||
865 | =item * | |
866 | ||
867 | C<__SUB__> now works in special blocks (C<BEGIN>, C<END>, etc.). | |
868 | ||
869 | =item * | |
870 | ||
871 | Thread creation on Windows could theoretically result in a crash if done | |
872 | inside a C<BEGIN> block. It still does not work properly, but it no longer | |
873 | crashes [perl #111610]. | |
874 | ||
875 | =item * | |
876 | ||
877 | C<\&{''}> (with the empty string) now autovivifies a stub like any other | |
878 | sub name, and no longer produces the "Unable to create sub" error | |
879 | [perl #94476]. | |
880 | ||
e5ba1bf1 FC |
881 | =back |
882 | ||
0bba4573 | 883 | =head1 Known Problems |
e5ba1bf1 | 884 | |
0bba4573 RS |
885 | XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any |
886 | tests that had to be C<TODO>ed for the release would be noted here. Unfixed | |
887 | platform specific bugs also go here. | |
888 | ||
889 | [ List each fix as a =item entry ] | |
890 | ||
891 | =over 4 | |
892 | ||
893 | =item * | |
894 | ||
895 | XXX | |
896 | ||
897 | =back | |
e5ba1bf1 FC |
898 | |
899 | =head1 Acknowledgements | |
900 | ||
901 | XXX Generate this with: | |
902 | ||
de3d8d88 | 903 | perl Porting/acknowledgements.pl v5.17.12..HEAD |
e5ba1bf1 FC |
904 | |
905 | =head1 Reporting Bugs | |
906 | ||
907 | If you find what you think is a bug, you might check the articles recently | |
908 | posted to the comp.lang.perl.misc newsgroup and the perl bug database at | |
909 | http://rt.perl.org/perlbug/ . There may also be information at | |
910 | http://www.perl.org/ , the Perl Home Page. | |
911 | ||
912 | If you believe you have an unreported bug, please run the L<perlbug> program | |
913 | included with your release. Be sure to trim your bug down to a tiny but | |
914 | sufficient test case. Your bug report, along with the output of C<perl -V>, | |
915 | will be sent off to perlbug@perl.org to be analysed by the Perl porting team. | |
916 | ||
917 | If the bug you are reporting has security implications, which make it | |
918 | inappropriate to send to a publicly archived mailing list, then please send it | |
919 | to perl5-security-report@perl.org. This points to a closed subscription | |
920 | unarchived mailing list, which includes all the core committers, who will be | |
921 | able to help assess the impact of issues, figure out a resolution, and help | |
922 | co-ordinate the release of patches to mitigate or fix the problem across all | |
923 | platforms on which Perl is supported. Please only use this address for | |
924 | security issues in the Perl core, not for modules independently distributed on | |
925 | CPAN. | |
926 | ||
927 | =head1 SEE ALSO | |
928 | ||
929 | The F<Changes> file for an explanation of how to view exhaustive details on | |
930 | what changed. | |
931 | ||
932 | The F<INSTALL> file for how to build Perl. | |
933 | ||
934 | The F<README> file for general stuff. | |
935 | ||
936 | The F<Artistic> and F<Copying> files for copyright information. | |
937 | ||
938 | =cut |