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 | ||
00785cb7 RS |
21 | =head2 Latest Unicode 6.2 beta is included |
22 | ||
23 | This is supposed to be the final data for 6.2, unless glitches are | |
24 | found. The earlier experimental 6.2 beta data has been reverted, and | |
25 | this used instead. Not all the changes that were proposed for 6.2 and | |
26 | that were in the earlier beta versions are actually going into 6.2. In | |
27 | particular, there are no changes from 6.1 in the General_Category of any | |
28 | characters. 6.2 does revise the C<\X> handling for the REGIONAL | |
29 | INDICATOR characters that were added in Unicode 6.0. Perl now for the | |
30 | first time fully handles this revision. | |
31 | ||
32 | =head2 New DTrace probes | |
33 | ||
34 | The following new DTrace probes have been added: | |
35 | ||
36 | =over 4 | |
37 | ||
38 | =item C<op-entry> | |
39 | ||
40 | =item C<loading-file> | |
41 | ||
42 | =item C<loaded-file> | |
43 | ||
44 | =back | |
45 | ||
46 | =head2 C<${^LAST_FH}> | |
47 | ||
48 | This new variable provides access to the filehandle that was last read. | |
49 | This is the handle used by C<$.> and by C<tell> and C<eof> without | |
50 | arguments. | |
51 | ||
52 | =head2 Looser here-doc parsing | |
53 | ||
54 | Here-doc terminators no longer require a terminating newline character when | |
55 | they occur at the end of a file. This was already the case at the end of a | |
56 | string eval [perl #65838]. | |
57 | ||
58 | =head2 New mechanism for experimental features | |
59 | ||
60 | Newly-added experimental features will now require this incantation: | |
61 | ||
62 | no warnings "experimental:feature_name"; | |
63 | use feature "feature_name"; # would warn without the prev line | |
64 | ||
65 | There is a new warnings category, called "experimental", containing | |
66 | warnings that the L<feature> pragma emits when enabling experimental | |
67 | features. | |
68 | ||
69 | Newly-added experimental features will also be given special warning IDs, | |
70 | which consist of "experimental:" followed by the name of the feature. (The | |
71 | plan is to extend this mechanism eventually to all warnings, to allow them | |
72 | to be enabled or disabled individually, and not just by category.) | |
73 | ||
74 | By saying | |
75 | ||
76 | no warnings "experimental:feature_name"; | |
77 | ||
78 | you are taking responsibility for any breakage that future changes to, or | |
79 | removal of, the feature may cause. | |
80 | ||
81 | =head2 Lexical subroutines | |
82 | ||
83 | This new feature is still considered experimental. To enable it, use the | |
84 | mechanism described above: | |
85 | ||
86 | use 5.018; | |
87 | no warnings "experimental:lexical_subs"; | |
88 | use feature "lexical_subs"; | |
89 | ||
90 | You can now declare subroutines with C<state sub foo>, C<my sub foo>, and | |
91 | C<our sub foo>. (C<state sub> requires that the "state" feature be | |
92 | enabled, unless you write it as C<CORE::state sub foo>.) | |
93 | ||
94 | C<state sub> creates a subroutine visible within the lexical scope in which | |
95 | it is declared. The subroutine is shared between calls to the outer sub. | |
96 | ||
97 | C<my sub> declares a lexical subroutine that is created each time the | |
98 | enclosing block is entered. C<state sub> is generally slightly faster than | |
99 | C<my sub>. | |
100 | ||
101 | C<our sub> declares a lexical alias to the package subroutine of the same | |
102 | name. | |
103 | ||
104 | See L<perlsub/Lexical Subroutines>. | |
105 | ||
106 | ||
94b31d3f RS |
107 | =head2 Computed Labels |
108 | ||
109 | The loop controls C<next>, C<last> and C<redo>, and the special C<dump> | |
110 | operator, now allow arbitrary expressions to be used to compute labels at run | |
111 | time. Previously, any argument that was not a constant was treated as the | |
112 | empty string. | |
113 | ||
0fef449b RS |
114 | =head2 More CORE:: subs |
115 | ||
116 | Several more built-in functions have been added as subroutines to the | |
117 | CORE:: namespace, namely, those non-overridable keywords that can be | |
118 | implemented without custom parsers: C<defined>, C<delete>, C<exists>, | |
119 | C<glob>, C<pos>, C<protoytpe>, C<scalar>, C<split>, C<study>, and C<undef>. | |
120 | ||
121 | As some of these have prototypes, C<prototype('CORE::...')> has been | |
122 | changed to not make a distinction between overridable and non-overridable | |
123 | keywords. This is to make C<prototype('CORE::pos')> consistent with | |
124 | C<prototype(&CORE::pos)>. | |
e5ba1bf1 | 125 | |
37133b20 RS |
126 | =head2 C<kill> with negative signal names |
127 | ||
128 | C<kill> has always allowed a negative signal number, which kills the | |
129 | process group instead of a single process. It has also allowed signal | |
130 | names. But it did not behave consistently, because negative signal names | |
131 | were treated as 0. Now negative signals names like C<-INT> are supported | |
132 | and treated the same way as -2 [perl #112990]. | |
133 | ||
134 | =head2 C<pack> is now constant folded. | |
135 | ||
136 | C<pack> with constant arguments is now constant folded in most cases | |
137 | [perl #113470]. | |
e5ba1bf1 FC |
138 | |
139 | =head1 Security | |
140 | ||
141 | XXX Any security-related notices go here. In particular, any security | |
142 | vulnerabilities closed should be noted here rather than in the | |
143 | L</Selected Bug Fixes> section. | |
144 | ||
145 | [ List each security issue as a =head2 entry ] | |
146 | ||
147 | =head1 Incompatible Changes | |
148 | ||
00785cb7 RS |
149 | =head2 Here-doc parsing |
150 | ||
151 | The body of a here-document inside a quote-like operator now always begins | |
152 | on the line after the "<<foo" marker. Previously, it was documented to | |
153 | begin on the line following the containing quote-like operator, but that | |
154 | was only sometimes the case [perl #114040]. | |
155 | ||
156 | =head2 Stricter parsing of substitution replacement | |
157 | ||
158 | It is no longer possible to abuse the way the parser parses C<s///e> like | |
159 | this: | |
160 | ||
161 | %_=(_,"Just another "); | |
162 | $_="Perl hacker,\n"; | |
163 | s//_}->{_/e;print | |
164 | ||
165 | =head2 Interaction of lexical and default warnings | |
166 | ||
167 | Turning on any lexical warnings used first to disable all default warnings | |
168 | if lexical warnings were not already enabled: | |
169 | ||
170 | $*; # deprecation warning | |
171 | use warnings "void"; | |
172 | $#; # void warning; no deprecation warning | |
173 | ||
174 | Now, the debugging, deprecated, glob, inplace and malloc warnings | |
175 | categories are left on when turning on lexical warnings (unless they are | |
176 | turned off by C<no warnings>, of course). | |
177 | ||
178 | This may cause deprecation warnings to occur in code that used to be free | |
179 | of warnings. | |
180 | ||
181 | Those are the only categories consisting only of default warnings. Default | |
182 | warnings in other categories are still disabled by C<use warnings | |
183 | "category">, as we do not yet have the infrastructure for controlling | |
184 | individual warnings. | |
185 | ||
186 | =head2 C<state sub> and C<our sub> | |
187 | ||
188 | Due to an accident of history, C<state sub> and C<our sub> were equivalent | |
189 | to a plain C<sub>, so one could even create an anonymous sub with | |
190 | C<our sub { ... }>. These are now disallowed outside of the "lexical_subs" | |
191 | feature. Under the "lexical_subs" feature they have new meanings described | |
192 | in L<perlsub/Lexical Subroutines>. | |
193 | ||
194 | =head2 C<gv_fetchmeth_*> and SUPER | |
195 | ||
196 | The various C<gv_fetchmeth_*> XS functions used to treat a package whose | |
197 | named ended with ::SUPER specially. A method lookup on the Foo::SUPER | |
198 | package would be treated as a SUPER method lookup on the Foo package. This | |
199 | is no longer the case. To do a SUPER lookup, pass the Foo stash and the | |
200 | GV_SUPER flag. | |
201 | ||
94b31d3f RS |
202 | =head2 Defined values stored in environment are forced to byte strings |
203 | ||
204 | A value stored in an environment variable has always been stringified. In this | |
205 | release, it is converted to be only a byte string. First, it is forced to be a | |
206 | only a string. Then if the string is utf8 and the equivalent of | |
207 | C<utf8::downgrade()> works, that result is used; otherwise, the equivalent of | |
208 | C<utf8::encode()> is used, and a warning is issued about wide characters | |
209 | (L</Diagnostics>). | |
210 | ||
211 | =head2 C<given> now aliases the global C<$_> | |
212 | ||
213 | Instead of assigning to an implicit lexical C<$_>, C<given> now makes the | |
214 | global C<$_> an alias for its argument, just like C<foreach>. However, it | |
215 | still uses lexical C<$_> if there is lexical C<$_> in scope (again, just like | |
216 | C<foreach>) [perl #114020]. | |
217 | ||
0bba4573 RS |
218 | =head2 qw(...) can no longer be used as parentheses |
219 | ||
220 | C<qw> lists used to fool the parser into thinking they were always | |
221 | surrounded by parentheses. This permitted some surprising constructions | |
222 | such as C<foreach $x qw(a b c) {...}>, which should really be written | |
223 | C<foreach $x (qw(a b c)) {...}>. These would sometimes get the lexer into | |
224 | the wrong state, so they didn't fully work, and the similar C<foreach qw(a | |
225 | b c) {...}> that one might expect to be permitted never worked at all. | |
226 | ||
227 | This side effect of C<qw> has now been abolished. It has been deprecated | |
228 | since Perl 5.13.11. It is now necessary to use real parentheses | |
229 | everywhere that the grammar calls for them. | |
e5ba1bf1 | 230 | |
0bba4573 | 231 | =head2 C<\s> in regular expressions now matches a Vertical Tab |
e5ba1bf1 | 232 | |
0bba4573 | 233 | [ XXX ] |
e5ba1bf1 | 234 | |
0fef449b RS |
235 | =head2 C</(?{})/> and C</(??{})/> have been heavily reworked |
236 | ||
237 | The implementation of this feature has been almost completely rewritten. | |
238 | Although its main intent is to fix bugs, some behaviors, especially | |
239 | related to the scope of lexical variables, will have changed. This is | |
240 | described more fully in the L</Selected Bug Fixes> section. | |
241 | ||
242 | =head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007 | |
243 | ||
244 | Unicode 6.0 reused the name "BELL" for a different code point than it | |
245 | traditionally had meant. Since Perl v5.14, use of this name still | |
246 | referred to U+0007, but would raise a deprecation warning. Now, "BELL" | |
247 | refers to U+1F514, and the name for U+0007 is "ALERT". All the | |
248 | functions in L<charnames> have been correspondingly updated. | |
249 | ||
250 | =head2 Alphanumeric operators must now be separated from the closing | |
251 | delimiter of regular expressions | |
252 | ||
253 | You may no longer write something like: | |
254 | ||
255 | m/a/and 1 | |
256 | ||
257 | Instead you must write | |
258 | ||
259 | m/a/ and 1 | |
260 | ||
261 | with whitespace separating the operator from the closing delimiter of | |
262 | the regular expression. Not having whitespace has resulted in a | |
263 | deprecation warning since Perl v5.14.0. | |
264 | ||
265 | =head2 C<require> dies for unreadable files | |
266 | ||
267 | When C<require> encounters an unreadable file, it now dies. It used to | |
268 | ignore the file and continue searching the directories in @INC | |
269 | [perl #113422]. | |
270 | ||
271 | =head2 Upgrade to the Unicode 6.2 beta | |
272 | ||
273 | Unicode 6.2 is proposing some changes that may very well break some CPAN | |
274 | modules. The timing of this nicely coincides with Perl's being early in the | |
275 | release cycle. This commit takes the current beta 6.2, adds the proposed | |
276 | changes that aren't yet in it, and subtracts the changes that would affect \X | |
277 | processing, as those turn out to have errors, and may have to be rethought. | |
278 | Unicode has been notified of these problems. | |
279 | ||
280 | This will allow us to gather data as to whether or not the proposed changes | |
281 | cause us problems. These will be presented to Unicode to aid in their final | |
282 | decision as to whether or not to go forward with the changes. | |
283 | ||
284 | These changes will be replaced by the final version of Unicode 6.2 before | |
285 | 5.18.0 is released. | |
286 | ||
e5ba1bf1 FC |
287 | =head1 Deprecations |
288 | ||
289 | XXX Any deprecated features, syntax, modules etc. should be listed here. In | |
290 | particular, deprecated modules should be listed here even if they are listed as | |
291 | an updated module in the L</Modules and Pragmata> section. | |
292 | ||
293 | [ List each deprecation as a =head2 entry ] | |
294 | ||
295 | =head1 Performance Enhancements | |
296 | ||
297 | XXX Changes which enhance performance without changing behaviour go here. | |
298 | There may well be none in a stable release. | |
299 | ||
300 | [ List each enhancement as a =item entry ] | |
301 | ||
302 | =over 4 | |
303 | ||
304 | =item * | |
305 | ||
00785cb7 RS |
306 | Speed up in regular expression matching against Unicode properties. The |
307 | largest gain is for C<\X>, the Unicode "extended grapheme cluster". The | |
308 | gain for it is about 35% - 40%. Bracketed character classes, e.g., | |
309 | C<[0-9\x{100}]> containing code points above 255 are also now faster. | |
310 | ||
311 | =item * | |
312 | ||
313 | On platforms supporting it, several former macros are now implemented as static | |
314 | inline functions. This should speed things up slightly on non-GCC platforms. | |
315 | ||
316 | =item * | |
317 | ||
318 | Apply the optimisation of hashes in boolean context, such as in C<if> or C<and>, | |
319 | to constructs in non-void context. | |
320 | ||
321 | =item * | |
322 | ||
323 | Extend the optimisation of hashes in boolean context to C<scalar(%hash)>, | |
324 | C<%hash ? ... : ...>, and C<sub { %hash || ... }>. | |
325 | ||
326 | =item * | |
327 | ||
328 | When making a copy of the string being matched against (so that $1, $& et al | |
329 | continue to show the correct value even if the original string is subsequently | |
330 | modified), only copy that substring of the original string needed for the | |
331 | capture variables, rather than copying the whole string. | |
332 | ||
333 | This is a big win for code like | |
334 | ||
335 | $&; | |
336 | $_ = 'x' x 1_000_000; | |
337 | 1 while /(.)/; | |
338 | ||
339 | Also, when pessimizing if the code contains C<$`>, C<$&> or C<$'>, record the | |
340 | presence of each variable separately, so that the determination of the substring | |
341 | range is based on each variable separately. So performance-wise, | |
342 | ||
343 | $&; /x/ | |
344 | ||
345 | is now roughly equivalent to | |
346 | ||
347 | /(x)/ | |
348 | ||
349 | whereas previously it was like | |
350 | ||
351 | /^(.*)(x)(.*)$/ | |
352 | ||
353 | and | |
354 | ||
355 | $&; $'; /x/ | |
356 | ||
357 | is now roughly equivalent to | |
358 | ||
359 | /(x)(.*)$/ | |
360 | ||
361 | etc. | |
362 | ||
363 | ||
364 | =item * | |
365 | ||
0bba4573 RS |
366 | Filetest ops manage the stack in a fractionally more efficient manner. |
367 | ||
368 | =item * | |
369 | ||
370 | Globs used in a numeric context are now numerified directly in most cases, | |
371 | rather than being numerified via stringification. | |
e5ba1bf1 | 372 | |
0fef449b RS |
373 | =item * |
374 | ||
375 | The C<x> repetition operator is now folded to a single constant at compile | |
376 | time if called in scalar context with constant operands and no parentheses | |
377 | around the left operand. | |
378 | ||
e5ba1bf1 FC |
379 | =back |
380 | ||
381 | =head1 Modules and Pragmata | |
382 | ||
383 | XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/> | |
384 | go here. If Module::CoreList is updated, generate an initial draft of the | |
385 | following sections using F<Porting/corelist-perldelta.pl>, which prints stub | |
386 | entries to STDOUT. Results can be pasted in place of the '=head2' entries | |
387 | below. A paragraph summary for important changes should then be added by hand. | |
388 | In an ideal world, dual-life modules would have a F<Changes> file that could be | |
389 | cribbed. | |
390 | ||
391 | [ Within each section, list entries as a =item entry ] | |
392 | ||
393 | =head2 New Modules and Pragmata | |
394 | ||
395 | =over 4 | |
396 | ||
397 | =item * | |
398 | ||
399 | XXX | |
400 | ||
401 | =back | |
402 | ||
403 | =head2 Updated Modules and Pragmata | |
404 | ||
405 | =over 4 | |
406 | ||
407 | =item * | |
408 | ||
409 | L<XXX> has been upgraded from version A.xx to B.yy. | |
410 | ||
411 | =back | |
412 | ||
413 | =head2 Removed Modules and Pragmata | |
414 | ||
0bba4573 | 415 | =over |
e5ba1bf1 FC |
416 | |
417 | =item * | |
418 | ||
0bba4573 RS |
419 | L<Version::Requirements> has been removed from the core distribution. It is |
420 | available under a different name: L<CPAN::Meta::Requirements>. | |
e5ba1bf1 FC |
421 | |
422 | =back | |
423 | ||
424 | =head1 Documentation | |
425 | ||
426 | XXX Changes to files in F<pod/> go here. Consider grouping entries by | |
427 | file and be sure to link to the appropriate page, e.g. L<perlfunc>. | |
428 | ||
429 | =head2 New Documentation | |
430 | ||
431 | XXX Changes which create B<new> files in F<pod/> go here. | |
432 | ||
433 | =head3 L<XXX> | |
434 | ||
435 | XXX Description of the purpose of the new file here | |
436 | ||
437 | =head2 Changes to Existing Documentation | |
438 | ||
0bba4573 | 439 | =head3 L<perldata> |
e5ba1bf1 | 440 | |
0bba4573 RS |
441 | =over 4 |
442 | ||
443 | =item * | |
444 | ||
445 | Now explicitly documents the behaviour of hash initializer lists that | |
446 | contain duplicate keys. | |
447 | ||
448 | =back | |
449 | ||
450 | =head3 L<perldiag> | |
451 | ||
452 | =over 4 | |
453 | ||
454 | =item * | |
455 | ||
456 | The explanation of symbolic references being prevented by "strict refs" | |
457 | now doesn't assume that the reader knows what symbolic references are. | |
458 | ||
459 | =back | |
460 | ||
461 | =head3 L<perlfunc> | |
e5ba1bf1 FC |
462 | |
463 | =over 4 | |
464 | ||
465 | =item * | |
466 | ||
0bba4573 | 467 | The return value of C<pipe> is now documented. |
e5ba1bf1 | 468 | |
37133b20 RS |
469 | =item * |
470 | ||
471 | Clarified documentation of C<our>. | |
472 | ||
e5ba1bf1 FC |
473 | =back |
474 | ||
0fef449b RS |
475 | =head3 L<perlfaq> |
476 | ||
477 | =over 4 | |
478 | ||
479 | =item * | |
480 | ||
481 | L<perlfaq> has been synchronized with version 5.0150040 from CPAN. | |
482 | ||
483 | =back | |
484 | ||
485 | =head3 L<perlcheat> | |
486 | ||
487 | =over 4 | |
488 | ||
489 | =item * | |
490 | ||
491 | L<perlcheat> has been reorganized, and a few new sections were added. | |
492 | ||
493 | =back | |
494 | ||
94b31d3f RS |
495 | =head3 L<perlop> |
496 | ||
497 | =over 4 | |
498 | ||
499 | =item * | |
500 | ||
501 | Loop control verbs (C<dump>, C<goto>, C<next>, C<last> and C<redo>) have always | |
502 | had the same precedence as assignment operators, but this was not documented | |
503 | until now. | |
504 | ||
505 | =back | |
506 | ||
0bba4573 | 507 | =head3 Diagnostics |
e5ba1bf1 FC |
508 | |
509 | The following additions or changes have been made to diagnostic output, | |
510 | including warnings and fatal error messages. For the complete list of | |
511 | diagnostic messages, see L<perldiag>. | |
512 | ||
513 | XXX New or changed warnings emitted by the core's C<C> code go here. Also | |
514 | include any changes in L<perldiag> that reconcile it to the C<C> code. | |
515 | ||
516 | =head2 New Diagnostics | |
517 | ||
518 | XXX Newly added diagnostic messages go under here, separated into New Errors | |
519 | and New Warnings | |
520 | ||
521 | =head3 New Errors | |
522 | ||
523 | =over 4 | |
524 | ||
525 | =item * | |
526 | ||
94b31d3f RS |
527 | L<Unterminated delimiter for here document|perldiag/"Unterminated delimiter for here document"> |
528 | ||
529 | This message now occurs when a here document label has an initial quotation | |
530 | mark but the final quotation mark is missing. | |
531 | ||
532 | This replaces a bogus and misleading error message about not finding the label | |
533 | itself [perl #114104]. | |
534 | ||
535 | =item * | |
536 | ||
537 | L<panic: child pseudo-process was never scheduled|perldiag/"panic: child pseudo-process was never scheduled"> | |
538 | ||
539 | This error is thrown when a child pseudo-process in the ithreads implementation | |
540 | on Windows was not scheduled within the time period allowed and therefore was | |
541 | not able to initialize properly [perl #88840]. | |
542 | ||
543 | =item * | |
544 | ||
37133b20 RS |
545 | L<Group name must start with a non-digit word character in regex; marked by <-- HERE in mE<sol>%sE<sol>|perldiag/"Group name must start with a non-digit word character in regex; marked by <-- HERE in m/%s/"> |
546 | ||
547 | This error has been added for C<(?&0)>, which is invalid. It used to | |
548 | produce an incomprehensible error message [perl #101666]. | |
549 | ||
550 | =item * | |
551 | ||
552 | L<Can't use an undefined value as a subroutine reference|perldiag/"Can't use an undefined value as %s reference"> | |
553 | ||
554 | Calling an undefined value as a subroutine now produces this error message. | |
555 | It used to, but was accidentally disabled, first in Perl 5.004 for | |
556 | non-magical variables, and then in Perl 5.14 for magical (e.g., tied) | |
557 | variables. It has now been restored. In the mean time, undef was treated | |
558 | as an empty string [perl #113576]. | |
e5ba1bf1 FC |
559 | |
560 | =back | |
561 | ||
562 | =head3 New Warnings | |
563 | ||
564 | =over 4 | |
565 | ||
566 | =item * | |
567 | ||
00785cb7 RS |
568 | L<Experimental "%s" subs not enabled|perldiag/"Experimental "%s" subs not enabled"> |
569 | ||
570 | (F) To use lexical subs, you must first enable them: | |
571 | ||
572 | no warnings 'experimental:lexical_subs'; | |
573 | use feature 'lexical_subs'; | |
574 | my sub foo { ... } | |
575 | ||
576 | =item * | |
577 | ||
578 | L<Subroutine "&%s" is not available|perldiag/"Subroutine "&%s" is not available"> | |
579 | ||
580 | (W closure) During compilation, an inner named subroutine or eval is | |
581 | attempting to capture an outer lexical subroutine that is not currently | |
582 | available. This can happen for one of two reasons. First, the lexical | |
583 | subroutine may be declared in an outer anonymous subroutine that has not | |
584 | yet been created. (Remember that named subs are created at compile time, | |
585 | while anonymous subs are created at run-time.) For example, | |
586 | ||
587 | sub { my sub a {...} sub f { \&a } } | |
588 | ||
589 | At the time that f is created, it can't capture the current the "a" sub, | |
590 | since the anonymous subroutine hasn't been created yet. Conversely, the | |
591 | following won't give a warning since the anonymous subroutine has by now | |
592 | been created and is live: | |
593 | ||
594 | sub { my sub a {...} eval 'sub f { \&a }' }->(); | |
595 | ||
596 | The second situation is caused by an eval accessing a variable that has | |
597 | gone out of scope, for example, | |
598 | ||
599 | sub f { | |
600 | my sub a {...} | |
601 | sub { eval '\&a' } | |
602 | } | |
603 | f()->(); | |
604 | ||
605 | Here, when the '\&a' in the eval is being compiled, f() is not currently | |
606 | being executed, so its &a is not available for capture. | |
607 | ||
608 | =item * | |
609 | ||
610 | L<"%s" subroutine &%s masks earlier declaration in same %s|perldiag/"%s" subroutine &%s masks earlier declaration in same %s> | |
611 | ||
612 | (W misc) A "my" or "state" subroutine has been redeclared in the | |
613 | current scope or statement, effectively eliminating all access to | |
614 | the previous instance. This is almost always a typographical error. | |
615 | Note that the earlier subroutine will still exist until the end of | |
616 | the scope or until all closure references to it are destroyed. | |
617 | ||
618 | =item * | |
619 | ||
620 | L<The %s feature is experimental|perldiag/"The %s feature is experimental"> | |
621 | ||
622 | (S experimental) This warning is emitted if you enable an experimental | |
623 | feature via C<use feature>. Simply suppress the warning if you want | |
624 | to use the feature, but know that in doing so you are taking the risk | |
625 | of using an experimental feature which may change or be removed in a | |
626 | future Perl version: | |
627 | ||
628 | no warnings "experimental:lexical_subs"; | |
629 | use feature "lexical_subs"; | |
630 | ||
631 | =item * | |
632 | ||
633 | L<sleep(%u) too large|perldiag/"sleep(%u) too large"> | |
634 | ||
635 | (W overflow) You called C<sleep> with a number that was larger than it can | |
636 | reliably handle and C<sleep> probably slept for less time than requested. | |
637 | ||
638 | =item * | |
639 | ||
94b31d3f RS |
640 | L<Wide character in setenv|perldiag/"Wide character in %s"> |
641 | ||
642 | Attempts to put wide characters into environment variables via C<%ENV> now | |
643 | provoke this warning. | |
644 | ||
645 | =item * | |
646 | ||
37133b20 RS |
647 | "L<Invalid negative number (%s) in chr|perldiag/"Invalid negative number (%s) in chr">" |
648 | ||
649 | C<chr()> now warns when passed a negative value [perl #83048]. | |
650 | ||
651 | =item * | |
652 | ||
653 | "L<Integer overflow in srand|perldiag/"Integer overflow in srand">" | |
654 | ||
655 | C<srand()> now warns when passed a value that doesn't fit in a C<UV> (since the | |
656 | value will be truncated rather than overflowing) [perl #40605]. | |
657 | ||
658 | =item * | |
659 | ||
660 | "L<-i used with no filenames on the command line, reading from STDIN|perldiag/"-i used with no filenames on the command line, reading from STDIN">" | |
661 | ||
662 | Running perl with the C<-i> flag now warns if no input files are provided on | |
663 | the command line [perl #113410]. | |
e5ba1bf1 FC |
664 | |
665 | =back | |
666 | ||
667 | =head2 Changes to Existing Diagnostics | |
668 | ||
669 | XXX Changes (i.e. rewording) of diagnostic messages go here | |
670 | ||
671 | =over 4 | |
672 | ||
673 | =item * | |
674 | ||
00785cb7 RS |
675 | L<vector argument not supported with alpha versions|perldiag/vector argument not supported with alpha versions> |
676 | ||
677 | This warning was not suppressable, even with C<no warnings>. Now it is | |
678 | suppressible, and has been moved from the "internal" category to the | |
679 | "printf" category. | |
680 | ||
681 | =item * | |
682 | ||
683 | C<< Can't do {n,m} with n > m in regex; marked by <-- HERE in m/%s/ >> | |
684 | ||
685 | This fatal error has been turned into a warning that reads: | |
686 | ||
687 | L<< Quantifier {n,m} with n > m can't match in regex | perldiag/Quantifier {n,m} with n > m can't match in regex >> | |
688 | ||
689 | (W regexp) Minima should be less than or equal to maxima. If you really want | |
690 | your regexp to match something 0 times, just put {0}. | |
691 | ||
692 | =item * | |
693 | ||
0fef449b RS |
694 | The "Runaway prototype" warning that occurs in bizarre cases has been |
695 | removed as being unhelpful and inconsistent. | |
696 | ||
697 | =item * | |
698 | ||
699 | The "Not a format reference" error has been removed, as the only case in | |
700 | which it could be triggered was a bug. | |
701 | ||
702 | =item * | |
703 | ||
704 | The "Unable to create sub named %s" error has been removed for the same | |
705 | reason. | |
e5ba1bf1 | 706 | |
37133b20 RS |
707 | =item * |
708 | ||
709 | The 'Can't use "my %s" in sort comparison' error has been downgraded to a | |
710 | warning, '"my %s" used in sort comparison' (with 'state' instead of 'my' | |
711 | for state variables). In addition, the heuristics for guessing whether | |
712 | lexical $a or $b has been misused have been improved to generate fewer | |
713 | false positives. Lexical $a and $b are no longer disallowed if they are | |
714 | outside the sort block. Also, a named unary or list operator inside the | |
715 | sort block no longer causes the $a or $b to be ignored [perl #86136]. | |
716 | ||
e5ba1bf1 FC |
717 | =back |
718 | ||
719 | =head1 Utility Changes | |
720 | ||
721 | XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here. | |
722 | Most of these are built within the directories F<utils> and F<x2p>. | |
723 | ||
724 | [ List utility changes as a =head3 entry for each utility and =item | |
725 | entries for each change | |
726 | Use L<XXX> with program names to get proper documentation linking. ] | |
727 | ||
728 | =head3 L<XXX> | |
729 | ||
730 | =over 4 | |
731 | ||
732 | =item * | |
733 | ||
734 | XXX | |
735 | ||
736 | =back | |
737 | ||
738 | =head1 Configuration and Compilation | |
739 | ||
740 | XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools | |
741 | go here. Any other changes to the Perl build process should be listed here. | |
742 | However, any platform-specific changes should be listed in the | |
743 | L</Platform Support> section, instead. | |
744 | ||
745 | [ List changes as a =item entry ]. | |
746 | ||
747 | =over 4 | |
748 | ||
749 | =item * | |
750 | ||
00785cb7 RS |
751 | F<Configure> will now correctly detect C<isblank()> when compiling with a C++ |
752 | compiler. | |
753 | ||
754 | =item * | |
755 | ||
94b31d3f RS |
756 | The pager detection in F<Configure> has been improved to allow responses which |
757 | specify options after the program name, e.g. B</usr/bin/less -R>, if the user | |
758 | accepts the default value. This helps B<perldoc> when handling ANSI escapes | |
759 | [perl #72156]. | |
e5ba1bf1 FC |
760 | |
761 | =back | |
762 | ||
763 | =head1 Testing | |
764 | ||
765 | XXX Any significant changes to the testing of a freshly built perl should be | |
766 | listed here. Changes which create B<new> files in F<t/> go here as do any | |
767 | large changes to the testing harness (e.g. when parallel testing was added). | |
768 | Changes to existing files in F<t/> aren't worth summarizing, although the bugs | |
769 | that they represent may be covered elsewhere. | |
770 | ||
771 | [ List each test improvement as a =item entry ] | |
772 | ||
773 | =over 4 | |
774 | ||
775 | =item * | |
776 | ||
0bba4573 RS |
777 | The test suite now has a section for tests that require very large amounts |
778 | of memory. These tests won't run by default; they can be enabled by | |
779 | setting the C<PERL_TEST_MEMORY> environment variable to the number of | |
780 | gibibytes of memory that may be safely used. | |
e5ba1bf1 FC |
781 | |
782 | =back | |
783 | ||
784 | =head1 Platform Support | |
785 | ||
786 | XXX Any changes to platform support should be listed in the sections below. | |
787 | ||
788 | [ Within the sections, list each platform as a =item entry with specific | |
789 | changes as paragraphs below it. ] | |
790 | ||
791 | =head2 New Platforms | |
792 | ||
793 | XXX List any platforms that this version of perl compiles on, that previous | |
794 | versions did not. These will either be enabled by new files in the F<hints/> | |
795 | directories, or new subdirectories and F<README> files at the top level of the | |
796 | source tree. | |
797 | ||
798 | =over 4 | |
799 | ||
800 | =item XXX-some-platform | |
801 | ||
802 | XXX | |
803 | ||
804 | =back | |
805 | ||
806 | =head2 Discontinued Platforms | |
807 | ||
e5ba1bf1 FC |
808 | =over 4 |
809 | ||
94b31d3f | 810 | =item UTS Global |
e5ba1bf1 | 811 | |
94b31d3f RS |
812 | Support code relating to UTS global has been removed. UTS was a mainframe |
813 | version of System V created by Amdahl, subsequently sold to UTS Global. The | |
814 | port has not been touched since before Perl 5.8.0, and UTS Global is now | |
815 | defunct. | |
e5ba1bf1 | 816 | |
00785cb7 RS |
817 | =item VM/ESA |
818 | ||
819 | Support for VM/ESA has been removed. The port was tested on 2.3.0, which | |
820 | IBM ended service on in March 2002. 2.4.0 ended service in June 2003, and | |
821 | was superseded by Z/VM. The current version of Z/VM is V6.2.0, and scheduled | |
822 | for end of service on 2015/04/30. | |
823 | ||
e5ba1bf1 FC |
824 | =back |
825 | ||
826 | =head2 Platform-Specific Notes | |
827 | ||
828 | XXX List any changes for specific platforms. This could include configuration | |
829 | and compilation changes or changes in portability/compatibility. However, | |
830 | changes within modules for platforms should generally be listed in the | |
831 | L</Modules and Pragmata> section. | |
832 | ||
833 | =over 4 | |
834 | ||
0bba4573 | 835 | =item clang++ |
e5ba1bf1 | 836 | |
0bba4573 RS |
837 | There is now a workaround for a compiler bug that prevented compiling |
838 | with clang++ since Perl 5.15.7 [perl #112786]. | |
839 | ||
840 | =item C++ | |
841 | ||
842 | When compiling the Perl core as C++ (which is only semi-supported), the | |
843 | mathom functions are now compiled as C<extern "C">, to ensure proper | |
844 | binary compatibility. (However, binary compatibility isn't generally | |
845 | guaranteed anyway in the situations where this would matter.) | |
846 | ||
00785cb7 RS |
847 | =item Win32 |
848 | ||
849 | Fixed a problem where perl could crash while cleaning up threads (including the | |
850 | main thread) in threaded debugging builds on Win32 and possibly other platforms | |
851 | [perl #114496]. | |
852 | ||
853 | A rare race condition that would lead to L<sleep|perlfunc/sleep> taking more | |
854 | time than requested, and possibly even hanging, has been fixed [perl #33096]. | |
855 | ||
856 | =item Solaris | |
857 | ||
858 | In Configure, avoid running sed commands with flags not supported on Solaris. | |
859 | ||
860 | =item Darwin | |
861 | ||
862 | Stop hardcoding an alignment on 8 byte boundaries to fix builds using | |
863 | -Dusemorebits. | |
864 | ||
865 | =item VMS | |
866 | ||
867 | Fix linking on builds configured with -Dusemymalloc=y. | |
868 | ||
0bba4573 RS |
869 | =item VMS |
870 | ||
871 | It should now be possible to compile Perl as C++ on VMS. | |
e5ba1bf1 | 872 | |
0fef449b RS |
873 | =item Win32 |
874 | ||
875 | C<link> on Win32 now attempts to set C<$!> to more appropriate values | |
876 | based on the Win32 API error code. [perl #112272] | |
877 | ||
878 | Perl no longer mangles the environment block, e.g. when launching a new | |
879 | sub-process, when the environment contains non-ASCII characters. Known | |
880 | problems still remain, however, when the environment contains characters | |
881 | outside of the current ANSI codepage (e.g. see the item about Unicode in | |
882 | C<%ENV> in L<http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod>). | |
883 | [perl #113536] | |
884 | ||
37133b20 RS |
885 | =item Win32 |
886 | ||
887 | Building perl with some Windows compilers used to fail due to a problem | |
888 | with miniperl's C<glob> operator (which uses the C<perlglob> program) | |
889 | deleting the PATH environment variable [perl #113798]. | |
890 | ||
94b31d3f RS |
891 | =item Win32 |
892 | ||
893 | A new makefile option, USE_64_BIT_INT, has been added to the Windows makefiles. | |
894 | Set this to "define" when building a 32-bit perl if you want it to use 64-bit | |
895 | integers. | |
896 | ||
897 | Machine code size reductions, already made to the DLLs of XS modules in Perl | |
898 | 5.17.2, have now been extended to the perl DLL itself. | |
899 | ||
900 | Building with VC++ 6.0 was inadvertently broken in Perl 5.17.2 but has now been | |
901 | fixed again. | |
902 | ||
0fef449b RS |
903 | =item VMS |
904 | ||
905 | All C header files from the top-level directory of the distribution are now | |
906 | installed on VMS, providing consistency with a long-standing practice on other | |
907 | platforms. Previously only a subset were installed, which broke non-core | |
908 | extension builds for extensions that depended on the missing include files. | |
909 | ||
37133b20 RS |
910 | =item VMS |
911 | ||
912 | Quotes are now removed from the command verb (but not the parameters) for | |
913 | commands spawned via C<system>, backticks, or a piped C<open>. Previously, | |
914 | quotes on the verb were passed through to DCL, which would fail to recognize | |
915 | the command. Also, if the verb is actually a path to an image or command | |
916 | procedure on an ODS-5 volume, quoting it now allows the path to contain spaces. | |
917 | ||
94b31d3f RS |
918 | =item VMS |
919 | ||
920 | The B<a2p> build has been fixed for the HP C++ compiler on OpenVMS. | |
921 | ||
37133b20 RS |
922 | =item AIX |
923 | ||
924 | Configure now always adds C<-qlanglvl=extc99> to the CC flags on AIX when | |
925 | using xlC. This will make it easier to compile a number of XS-based modules | |
926 | that assume C99 [perl #113778]. | |
927 | ||
e5ba1bf1 FC |
928 | =back |
929 | ||
930 | =head1 Internal Changes | |
931 | ||
0bba4573 | 932 | =over |
e5ba1bf1 | 933 | |
0bba4573 | 934 | =item * |
e5ba1bf1 | 935 | |
00785cb7 RS |
936 | The APIs for accessing lexical pads have changed considerably. |
937 | ||
938 | C<PADLIST>s are now longer C<AV>s, but their own type instead. C<PADLIST>s now | |
939 | contain a C<PAD> and a C<PADNAMELIST> of C<PADNAME>s, rather than C<AV>s for the | |
940 | pad and the list of pad names. C<PAD>s, C<PADNAMELIST>s, and C<PADNAME>s are to | |
941 | be accessed as such through the newly added pad API instead of the plain C<AV> | |
942 | and C<SV> APIs. See L<perlapi> for details. | |
943 | ||
944 | =item * | |
945 | ||
946 | In the regex API, the numbered capture callbacks are passed an index | |
947 | indicating what match variable is being accessed. There are special | |
948 | index values for the C<$`, $&, $&> variables. Previously the same three | |
949 | values were used to retrieve C<${^PREMATCH}, ${^MATCH}, ${^POSTMATCH}> | |
950 | too, but these have now been assigned three separate values. See | |
951 | L<perlreapi/Numbered capture callbacks>. | |
952 | ||
953 | =item * | |
954 | ||
955 | C<PL_sawampersand> was previously a boolean indicating that any of | |
956 | C<$`, $&, $&> had been seen; it now contains three one-bit flags | |
957 | indicating the presence of each of the variables individually. | |
958 | ||
959 | ||
960 | =item * | |
961 | ||
0bba4573 RS |
962 | The C<CV *> typemap entry now supports C<&{}> overloading and typeglobs, |
963 | just like C<&{...}> [perl #96872]. | |
e5ba1bf1 FC |
964 | |
965 | =item * | |
966 | ||
0bba4573 RS |
967 | The C<SVf_AMAGIC> flag to indicate overloading is now on the stash, not the |
968 | object. It is now set automatically whenever a method or @ISA changes, so | |
969 | its meaning has changed, too. It now means "potentially overloaded". When | |
970 | the overload table is calculated, the flag is automatically turned off if | |
971 | there is no overloading, so there should be no noticeable slowdown. | |
972 | ||
973 | The staleness of the overload tables is now checked when overload methods | |
974 | are invoked, rather than during C<bless>. | |
975 | ||
976 | "A" magic is gone. The changes to the handling of the C<SVf_AMAGIC> flag | |
977 | eliminate the need for it. | |
978 | ||
979 | C<PL_amagic_generation> has been removed as no longer necessary. For XS | |
980 | modules, it is now a macro alias to C<PL_na>. | |
981 | ||
982 | The fallback overload setting is now stored in a stash entry separate from | |
983 | overloadedness itself. | |
984 | ||
985 | =item * | |
986 | ||
987 | The character-processing code has been cleaned up in places. The changes | |
988 | should be operationally invisible. | |
e5ba1bf1 | 989 | |
0fef449b RS |
990 | =item * |
991 | ||
992 | The C<study> function was made a no-op in 5.16. It was simply disabled via | |
993 | a C<return> statement; the code was left in place. Now the code supporting | |
994 | what C<study> used to do has been removed. | |
995 | ||
996 | =item * | |
997 | ||
998 | Under threaded perls, there is no longer a separate PV allocated for every | |
999 | COP to store its package name (C<< cop->stashpv >>). Instead, there is an | |
1000 | offset (C<< cop->stashoff >>) into the new C<PL_stashpad> array, which | |
1001 | holds stash pointers. | |
1002 | ||
1003 | =item * | |
1004 | ||
1005 | In the pluggable regex API, the C<regexp_engine> struct has acquired a new | |
1006 | field C<op_comp>, which is currently just for perl's internal use, and | |
1007 | should be initialised to NULL by other regex plugin modules. | |
1008 | ||
1009 | =item * | |
1010 | ||
1011 | A new function C<alloccoptash> has been added to the API, but is considered | |
1012 | experimental. See L<perlapi>. | |
1013 | ||
37133b20 RS |
1014 | =item * |
1015 | ||
1016 | Perl used to implement get magic in a way that would sometimes hide bugs in | |
1017 | code could call mg_get() too many times on magical values. This hiding of | |
1018 | errors no longer occurs, so long-standing bugs may become visible now. If | |
1019 | you see magic-related errors in XS code, check to make sure it, together | |
1020 | with the Perl API functions it uses, calls mg_get() only once on SvGMAGICAL() | |
1021 | values. | |
1022 | ||
1023 | =item * | |
1024 | ||
1025 | OP allocation for CVs now uses a slab allocator. This simplifies | |
1026 | memory management for OPs allocated to a CV, so cleaning up after a | |
1027 | compilation error is simpler and safer [perl #111462][perl #112312]. | |
1028 | ||
1029 | =item * | |
1030 | ||
1031 | PERL_DEBUG_READONLY_OPS has been rewritten to work with the new slab | |
1032 | allocator, allowing it to catch more violations than before. | |
1033 | ||
1034 | =item * | |
1035 | ||
1036 | The old slab allocator for ops, which was only enabled for PERL_IMPLICIT_SYS | |
1037 | and PERL_DEBUG_READONLY_OPS, has been retired. | |
1038 | ||
e5ba1bf1 FC |
1039 | =back |
1040 | ||
1041 | =head1 Selected Bug Fixes | |
1042 | ||
94b31d3f RS |
1043 | =over 4 |
1044 | ||
1045 | =item * | |
e5ba1bf1 | 1046 | |
00785cb7 RS |
1047 | The error "Can't localize through a reference" had disappeared in 5.16.0 |
1048 | when C<local %$ref> appeared on the last line of an lvalue subroutine. | |
1049 | This error disappeared for C<\local %$ref> in perl 5.8.1. It has now | |
1050 | been restored. | |
1051 | ||
1052 | =item * | |
1053 | ||
1054 | The parsing of here-docs has been improved significantly, fixing several | |
1055 | parsing bugs and crashes and one memory leak, and correcting wrong | |
1056 | subsequent line numbers under certain conditions. | |
1057 | ||
1058 | =item * | |
1059 | ||
1060 | Inside an eval, the error message for an unterminated here-doc no longer | |
1061 | has a newline in the middle of it [perl #70836]. | |
1062 | ||
1063 | =item * | |
1064 | ||
1065 | A substitution inside a substitution pattern (C<s/${s|||}//>) no longer | |
1066 | confuses the parser. | |
1067 | ||
1068 | =item * | |
1069 | ||
1070 | It may be an odd place to allow comments, but C<s//"" # hello/e> has | |
1071 | always worked, I<unless> there happens to be a null character before the | |
1072 | first #. Now it works even in the presence of nulls. | |
1073 | ||
1074 | =item * | |
1075 | ||
1076 | An invalid range in C<tr///> or C<y///> no longer results in a memory leak. | |
1077 | ||
1078 | =item * | |
1079 | ||
1080 | String eval no longer treats a semicolon-delimited quote-like operator at | |
1081 | the very end (C<eval 'q;;'>) as a syntax error. | |
1082 | ||
1083 | =item * | |
1084 | ||
1085 | C<< warn {$_ => 1} + 1 >> is no longer a syntax error. The parser used to | |
1086 | get confused with certain list operators followed by an anonymous hash and | |
1087 | then an infix operator that shares its form with a unary operator. | |
1088 | ||
1089 | =item * | |
1090 | ||
1091 | C<(caller $n)[6]> (which gives the text of the eval) used to return the | |
1092 | actual parser buffer. Modifying it could result in crashes. Now it always | |
1093 | returns a copy. The string returned no longer has "\n;" tacked on to the | |
1094 | end. The returned text also includes here-doc bodies, which used to be | |
1095 | omitted. | |
1096 | ||
1097 | =item * | |
1098 | ||
1099 | Reset the utf8 position cache when accessing magical variables to avoid the | |
1100 | string buffer and the utf8 position cache getting out of sync | |
1101 | [perl #114410]. | |
1102 | ||
1103 | =item * | |
1104 | ||
1105 | Various cases of get magic being called twice for magical utf8 strings have been | |
1106 | fixed. | |
1107 | ||
1108 | =item * | |
1109 | ||
1110 | This code (when not in the presence of C<$&> etc) | |
1111 | ||
1112 | $_ = 'x' x 1_000_000; | |
1113 | 1 while /(.)/; | |
1114 | ||
1115 | used to skip the buffer copy for performance reasons, but suffered from C<$1> | |
1116 | etc changing if the original string changed. That's now been fixed. | |
1117 | ||
1118 | =item * | |
1119 | ||
1120 | Perl doesn't use PerlIO anymore to report out of memory messages, as PerlIO | |
1121 | might attempt to allocate more memory. | |
1122 | ||
1123 | =item * | |
1124 | ||
1125 | In a regular expression, if something is quantified with C<{n,m}> | |
1126 | where C<S<n E<gt> m>>, it can't possibly match. Previously this was a fatal error, | |
1127 | but now is merely a warning (and that something won't match). [perl #82954]. | |
1128 | ||
1129 | =item * | |
1130 | ||
1131 | It used to be possible for formats defined in subroutines that have | |
1132 | subsequently been undefined and redefined to close over variables in the | |
1133 | wrong pad (the newly-defined enclosing sub), resulting in crashes or | |
1134 | "Bizarre copy" errors. | |
1135 | ||
1136 | =item * | |
1137 | ||
1138 | Redefinition of XSUBs at run time could produce warnings with the wrong | |
1139 | line number. | |
1140 | ||
1141 | =item * | |
1142 | ||
1143 | The %vd sprintf format does not support version objects for alpha versions. | |
1144 | It used to output the format itself (%vd) when passed an alpha version, and | |
1145 | also emit an "Invalid conversion in printf" warning. It no longer does, | |
1146 | but produces the empty string in the output. It also no longer leaks | |
1147 | memory in this case. | |
1148 | ||
1149 | =item * | |
1150 | ||
1151 | A bug fix in an earlier 5.17.x release caused C<no a a 3> (a syntax error) | |
1152 | to result in a bad read or assertion failure, because an op was being freed | |
1153 | twice. | |
1154 | ||
1155 | =item * | |
1156 | ||
1157 | C<< $obj->SUPER::method >> calls in the main package could fail if the | |
1158 | SUPER package had already been accessed by other means. | |
1159 | ||
1160 | =item * | |
1161 | ||
1162 | Stash aliasing (C<*foo:: = *bar::>) no longer causes SUPER calls to ignore | |
1163 | changes to methods or @ISA or use the wrong package. | |
1164 | ||
1165 | =item * | |
1166 | ||
1167 | Method calls on packages whose names end in ::SUPER are no longer treated | |
1168 | as SUPER method calls, resulting in failure to find the method. | |
1169 | Furthermore, defining subroutines in such packages no longer causes them to | |
1170 | be found by SUPER method calls on the containing package [perl #114924]. | |
1171 | ||
1172 | ||
1173 | =item * | |
1174 | ||
94b31d3f RS |
1175 | C<\w> now matches the code points U+200C (ZERO WIDTH NON-JOINER) and U+200D |
1176 | (ZERO WIDTH JOINER). C<\W> no longer matches these. This change is because | |
1177 | Unicode corrected their definition of what C<\w> should match. | |
e5ba1bf1 | 1178 | |
94b31d3f RS |
1179 | =item * |
1180 | ||
1181 | C<dump LABEL> no longer leaks its label. | |
1182 | ||
1183 | =item * | |
1184 | ||
1185 | Constant folding no longer changes the behaviour of functions like C<stat()> | |
1186 | and C<truncate()> that can take either filenames or handles. | |
1187 | C<stat 1 ? foo : bar> nows treats its argument as a file name (since it is an | |
1188 | arbitrary expression), rather than the handle "foo". | |
1189 | ||
1190 | =item * | |
1191 | ||
1192 | C<truncate FOO, $len> no longer falls back to treating "FOO" as a file name if | |
1193 | the filehandle has been deleted. This was broken in Perl 5.16.0. | |
1194 | ||
1195 | =item * | |
1196 | ||
1197 | Subroutine redefinitions after sub-to-glob and glob-to-glob assignments no | |
1198 | longer cause double frees or panic messages. | |
1199 | ||
1200 | =item * | |
1201 | ||
1202 | C<s///> now turns vstrings into plain strings when performing a substitution, | |
1203 | even if the resulting string is the same (C<s/a/a/>). | |
1204 | ||
1205 | =item * | |
1206 | ||
1207 | Prototype mismatch warnings no longer erroneously treat constant subs as having | |
1208 | no prototype when they actually have "". | |
1209 | ||
1210 | =item * | |
1211 | ||
1212 | Constant subroutines and forward declarations no longer prevent prototype | |
1213 | mismatch warnings from omitting the sub name. | |
1214 | ||
1215 | =item * | |
1216 | ||
1217 | C<undef> on a subroutine now clears call checkers. | |
1218 | ||
1219 | =item * | |
1220 | ||
1221 | The C<ref> operator started leaking memory on blessed objects in Perl 5.16.0. | |
1222 | This has been fixed [perl #114340]. | |
1223 | ||
1224 | =item * | |
1225 | ||
1226 | C<use> no longer tries to parse its arguments as a statement, making | |
1227 | C<use constant { () };> a syntax error [perl #114222]. | |
1228 | ||
1229 | =item * | |
1230 | ||
1231 | On debugging builds, "uninitialized" warnings inside formats no longer cause | |
1232 | assertion failures. | |
1233 | ||
1234 | =item * | |
1235 | ||
1236 | On debugging builds, subroutines nested inside formats no longer cause | |
1237 | assertion failures [perl #78550]. | |
1238 | ||
1239 | =item * | |
1240 | ||
1241 | Formats and C<use> statements are now permitted inside formats. | |
1242 | ||
1243 | =item * | |
1244 | ||
1245 | C<print $x> and C<sub { print $x }-E<gt>()> now always produce the same output. | |
1246 | It was possible for the latter to refuse to close over $x if the variable was | |
1247 | not active; e.g., if it was defined outside a currently-running named | |
1248 | subroutine. | |
1249 | ||
1250 | =item * | |
1251 | ||
1252 | Similarly, C<print $x> and C<print eval '$x'> now produce the same output. | |
1253 | This also allows "my $x if 0" variables to be seen in the debugger [perl | |
1254 | #114018]. | |
1255 | ||
1256 | =item * | |
1257 | ||
1258 | Formats called recursively no longer stomp on their own lexical variables, but | |
1259 | each recursive call has its own set of lexicals. | |
1260 | ||
1261 | =item * | |
1262 | ||
1263 | Attempting to free an active format or the handle associated with it no longer | |
1264 | results in a crash. | |
1265 | ||
1266 | =item * | |
1267 | ||
1268 | Format parsing no longer gets confused by braces, semicolons and low-precedence | |
1269 | operators. It used to be possible to use braces as format delimiters (instead | |
1270 | of C<=> and C<.>), but only sometimes. Semicolons and low-precedence operators | |
1271 | in format argument lines no longer confuse the parser into ignoring the line's | |
1272 | return value. In format argument lines, braces can now be used for anonymous | |
1273 | hashes, instead of being treated always as C<do> blocks. | |
1274 | ||
1275 | =item * | |
1276 | ||
1277 | Formats can now be nested inside code blocks in regular expressions and other | |
1278 | quoted constructs (C</(?{...})/> and C<qq/${...}/>) [perl #114040]. | |
1279 | ||
1280 | =item * | |
1281 | ||
1282 | Formats are no longer created after compilation errors. | |
1283 | ||
1284 | =item * | |
1285 | ||
1286 | Some format syntax errors started causing crashes in Perl 5.17.2, but have now | |
1287 | been fixed. | |
1288 | ||
1289 | =item * | |
1290 | ||
1291 | Under debugging builds, the B<-DA> command line option started crashing in Perl | |
1292 | 5.16.0. It has been fixed [perl #114368]. | |
1293 | ||
1294 | =item * | |
1295 | ||
1296 | Scope::Escape compatibility, which was broken in Perl 5.17.2, has been restored | |
1297 | [perl #113872]. | |
1298 | ||
1299 | =item * | |
1300 | ||
1301 | A potential deadlock scenario involving the premature termination of a pseudo- | |
1302 | forked child in a Windows build with ithreads enabled has been fixed. This | |
1303 | resolves the common problem of the F<t/op/fork.t> test hanging on Windows [perl | |
1304 | #88840]. | |
1305 | ||
1306 | =item * | |
1307 | ||
1308 | The microperl build, broken since Perl 5.15.7, has now been restored. | |
1309 | ||
1310 | =item * | |
1311 | ||
1312 | The code which generates errors from C<require()> could potentially read one or | |
1313 | two bytes before the start of the filename for filenames less than three bytes | |
1314 | long and ending C</\.p?\z/>. This has now been fixed. Note that it could | |
1315 | never have happened with module names given to C<use()> or C<require()> anyway. | |
1316 | ||
1317 | =item * | |
1318 | ||
1319 | The handling of pathnames of modules given to C<require()> has been made | |
1320 | thread-safe on VMS. | |
1321 | ||
1322 | =item * | |
1323 | ||
1324 | The C<re_compile()> API function, the entry point for perl's regex compiler, | |
1325 | was accidentally changed in Perl 5.17.1 to operate on the current engine. This | |
1326 | has now been restored to its former core-engine-specific state [perl #114302]. | |
1327 | ||
1328 | =item * | |
1329 | ||
1330 | Perl 5.17.1 introduced a memory leak into the re-use of run-time regexes where | |
1331 | the pattern hasn't changed (i.e. C</$unchanging/>). This has now been fixed. | |
1332 | ||
1333 | =item * | |
1334 | ||
1335 | A bug in the compilation of a C</(?{})/> expression which affected the TryCatch | |
1336 | test suite has been fixed [perl #114242]. | |
1337 | ||
1338 | =item * | |
1339 | ||
1340 | Formats no longer leak. They started leaking in Perl 5.17.2. | |
1341 | ||
1342 | =item * | |
1343 | ||
1344 | Pod can now be nested in code inside a quoted construct outside of a string | |
1345 | eval. This used to work only within string evals [perl #114040]. | |
e5ba1bf1 FC |
1346 | |
1347 | =item * | |
1348 | ||
0bba4573 RS |
1349 | C<goto ''> now looks for an empty label, producing the "goto must have |
1350 | label" error message, instead of exiting the program [perl #111794]. | |
e5ba1bf1 | 1351 | |
0bba4573 | 1352 | =item * |
e5ba1bf1 | 1353 | |
0bba4573 RS |
1354 | C<goto "\0"> now dies with "Can't find label" instead of "goto must have |
1355 | label". | |
e5ba1bf1 | 1356 | |
0bba4573 | 1357 | =item * |
e5ba1bf1 | 1358 | |
0bba4573 RS |
1359 | The C function C<hv_store> used to result in crashes when used on C<%^H> |
1360 | [perl #111000]. | |
e5ba1bf1 | 1361 | |
0bba4573 RS |
1362 | =item * |
1363 | ||
1364 | A call checker attached to a closure prototype via C<cv_set_call_checker> | |
1365 | is now copied to closures cloned from it. So C<cv_set_call_checker> now | |
1366 | works inside an attribute handler for a closure. | |
e5ba1bf1 FC |
1367 | |
1368 | =item * | |
1369 | ||
0bba4573 RS |
1370 | Writing to C<$^N> used to have no effect. Now it croaks with "Modification |
1371 | of a read-only value" by default, but that can be overridden by a custom | |
1372 | regular expression engine, as with C<$1> [perl #112184]. | |
1373 | ||
23dd6e2e FC |
1374 | =item * |
1375 | ||
0bba4573 RS |
1376 | C<undef> on a control character glob (C<undef *^H>) no longer emits an |
1377 | erroneous warning about ambiguity [perl #112456]. | |
23dd6e2e | 1378 | |
0bba4573 RS |
1379 | =item * |
1380 | ||
1381 | For efficiency's sake, many operators and built-in functions return the | |
1382 | same scalar each time. Lvalue subroutines and subroutines in the CORE:: | |
1383 | namespace were allowing this implementation detail to leak through. | |
1384 | C<print &CORE::uc("a"), &CORE::uc("b")> used to print "BB". The same thing | |
1385 | would happen with an lvalue subroutine returning the return value of C<uc>. | |
1386 | Now the value is copied in such cases. | |
23dd6e2e FC |
1387 | |
1388 | =item * | |
1389 | ||
0bba4573 RS |
1390 | C<method {}> syntax with an empty block or a block returning an empty list |
1391 | used to crash or use some random value left on the stack as its invocant. | |
1392 | Now it produces an error. | |
b92848b5 | 1393 | |
0f023b5a FC |
1394 | =item * |
1395 | ||
0bba4573 | 1396 | C<vec> now works with extremely large offsets (E<gt>2 GB) [perl #111730]. |
0f023b5a FC |
1397 | |
1398 | =item * | |
1399 | ||
0bba4573 RS |
1400 | Changes to overload settings now take effect immediately, as do changes to |
1401 | inheritance that affect overloading. They used to take effect only after | |
1402 | C<bless>. | |
1403 | ||
1404 | Objects that were created before a class had any overloading used to remain | |
1405 | non-overloaded even if the class gained overloading through C<use overload> | |
1406 | or @ISA changes, and even after C<bless>. This has been fixed | |
1407 | [perl #112708]. | |
c53e3a75 FC |
1408 | |
1409 | =item * | |
1410 | ||
0bba4573 | 1411 | Classes with overloading can now inherit fallback values. |
c53e3a75 FC |
1412 | |
1413 | =item * | |
1414 | ||
0bba4573 RS |
1415 | Overloading was not respecting a fallback value of 0 if there were |
1416 | overloaded objects on both sides of an assignment operator like C<+=> | |
1417 | [perl #111856]. | |
0f023b5a FC |
1418 | |
1419 | =item * | |
1420 | ||
0bba4573 RS |
1421 | C<pos> now croaks with hash and array arguments, instead of producing |
1422 | erroneous warnings. | |
0f023b5a FC |
1423 | |
1424 | =item * | |
1425 | ||
0bba4573 RS |
1426 | C<while(each %h)> now implies C<while(defined($_ = each %h))>, like |
1427 | C<readline> and C<readdir>. | |
0f023b5a | 1428 | |
0bba4573 RS |
1429 | =item * |
1430 | ||
1431 | Subs in the CORE:: namespace no longer crash after C<undef *_> when called | |
1432 | with no argument list (C<&CORE::time> with no parentheses). | |
1433 | ||
1434 | =item * | |
1435 | ||
1436 | Unicode 6.1 published an incorrect alias for one of the | |
1437 | Canonical_Combining_Class property's values (which range between 0 and | |
1438 | 254). The alias C<CCC133> should have been C<CCC132>. Perl now | |
1439 | overrides the data file furnished by Unicode to give the correct value. | |
1440 | ||
1441 | =item * | |
1442 | ||
1443 | C<unpack> no longer produces the "'/' must follow a numeric type in unpack" | |
1444 | error when it is the data that are at fault [perl #60204]. | |
1445 | ||
1446 | =item * | |
1447 | ||
1448 | C<join> and C<"@array"> now call FETCH only once on a tied C<$"> | |
1449 | [perl #8931]. | |
1450 | ||
1451 | =item * | |
1452 | ||
1453 | Some subroutine calls generated by compiling core ops affected by a | |
1454 | C<CORE::GLOBAL> override had op checking performed twice. The checking | |
1455 | is always idempotent for pure Perl code, but the double checking can | |
1456 | matter when custom call checkers are involved. | |
1457 | ||
1458 | =item * | |
1459 | ||
1460 | A race condition used to exist around fork that could cause a signal sent to | |
1461 | the parent to be handled by both parent and child. Signals are now blocked | |
1462 | briefly around fork to prevent this from happening [perl #82580]. | |
e5ba1bf1 | 1463 | |
0fef449b RS |
1464 | =item * |
1465 | ||
1466 | The implementation of code blocks in regular expressions, such as C<(?{})> | |
1467 | and C<(??{})>, has been heavily reworked to eliminate a whole slew of bugs. | |
1468 | The main user-visible changes are: | |
1469 | ||
1470 | =over 4 | |
1471 | ||
1472 | =item * | |
1473 | ||
1474 | Code blocks within patterns are now parsed in the same pass as the | |
1475 | surrounding code; in particular it is no longer necessary to have balanced | |
1476 | braces: this now works: | |
1477 | ||
1478 | /(?{ $x='{' })/ | |
1479 | ||
1480 | This means that this error message is longer generated: | |
1481 | ||
1482 | Sequence (?{...}) not terminated or not {}-balanced in regex | |
1483 | ||
1484 | but a new error may be seen: | |
1485 | ||
1486 | Sequence (?{...}) not terminated with ')' | |
1487 | ||
1488 | In addition, literal code blocks within run-time patterns are only | |
1489 | compiled once, at perl compile-time: | |
1490 | ||
1491 | for my $p (...) { | |
1492 | # this 'FOO' block of code is compiled once, | |
1493 | # at the same time as the surrounding 'for' loop | |
1494 | /$p{(?{FOO;})/; | |
1495 | } | |
1496 | ||
1497 | =item * | |
1498 | ||
1499 | Lexical variables are now sane as regards scope, recursion and closure | |
1500 | behavior. In particular, C</A(?{B})C/> behaves (from a closure viewpoint) | |
1501 | exactly like C</A/ && do { B } && /C/>, while C<qr/A(?{B})C/> is like | |
1502 | C<sub {/A/ && do { B } && /C/}>. So this code now works how you might | |
1503 | expect, creating three regexes that match 0, 1, and 2: | |
1504 | ||
1505 | for my $i (0..2) { | |
1506 | push @r, qr/^(??{$i})$/; | |
1507 | } | |
1508 | "1" =~ $r[1]; # matches | |
1509 | ||
1510 | =item * | |
1511 | ||
1512 | The C<use re 'eval'> pragma is now only required for code blocks defined | |
1513 | at runtime; in particular in the following, the text of the C<$r> pattern is | |
1514 | still interpolated into the new pattern and recompiled, but the individual | |
1515 | compiled code-blocks within C<$r> are reused rather than being recompiled, | |
1516 | and C<use re 'eval'> isn't needed any more: | |
1517 | ||
1518 | my $r = qr/abc(?{....})def/; | |
1519 | /xyz$r/; | |
1520 | ||
1521 | =item * | |
1522 | ||
1523 | Flow control operators no longer crash. Each code block runs in a new | |
1524 | dynamic scope, so C<next> etc. will not see | |
1525 | any enclosing loops. C<return> returns a value | |
1526 | from the code block, not from any enclosing subroutine. | |
1527 | ||
1528 | =item * | |
1529 | ||
1530 | Perl normally caches the compilation of run-time patterns, and doesn't | |
1531 | recompile if the pattern hasn't changed, but this is now disabled if | |
1532 | required for the correct behavior of closures. For example: | |
1533 | ||
1534 | my $code = '(??{$x})'; | |
1535 | for my $x (1..3) { | |
1536 | # recompile to see fresh value of $x each time | |
1537 | $x =~ /$code/; | |
1538 | } | |
1539 | ||
0fef449b RS |
1540 | =item * |
1541 | ||
1542 | The C</msix> and C<(?msix)> etc. flags are now propagated into the return | |
1543 | value from C<(??{})>; this now works: | |
1544 | ||
1545 | "AB" =~ /a(??{'b'})/i; | |
1546 | ||
1547 | =item * | |
1548 | ||
1549 | Warnings and errors will appear to come from the surrounding code (or for | |
1550 | run-time code blocks, from an eval) rather than from an C<re_eval>: | |
1551 | ||
1552 | use re 'eval'; $c = '(?{ warn "foo" })'; /$c/; | |
1553 | /(?{ warn "foo" })/; | |
1554 | ||
1555 | formerly gave: | |
1556 | ||
1557 | foo at (re_eval 1) line 1. | |
1558 | foo at (re_eval 2) line 1. | |
1559 | ||
1560 | and now gives: | |
1561 | ||
1562 | foo at (eval 1) line 1. | |
1563 | foo at /some/prog line 2. | |
1564 | ||
1565 | =back | |
1566 | ||
1567 | =item * | |
1568 | ||
1569 | Perl now works as well as can be expected on all releases of Unicode so | |
1570 | far. In v5.16, it worked on Unicodes 6.0 and 6.1, but there were | |
1571 | various bugs for earlier releases; the older the release the more | |
1572 | problems. | |
1573 | ||
1574 | =item * | |
1575 | ||
1576 | C<vec> no longer produces "uninitialized" warnings in lvalue context | |
1577 | [perl #9423]. | |
1578 | ||
1579 | =item * | |
1580 | ||
1581 | An optimization involving fixed strings in regular expressions could cause | |
1582 | a severe performance penalty in edge cases. This has been fixed | |
1583 | [perl #76546]. | |
1584 | ||
1585 | =item * | |
1586 | ||
1587 | In certain cases, including empty subpatterns within a regular expression (such | |
1588 | as C<(?:)> or C<(?:|)>) could disable some optimizations. This has been fixed. | |
1589 | ||
1590 | =item * | |
1591 | ||
1592 | The "Can't find an opnumber" message that C<prototype> produces when passed | |
1593 | a string like "CORE::nonexistent_keyword" now passes UTF-8 and embedded | |
1594 | NULs through unchanged [perl #97478]. | |
1595 | ||
1596 | =item * | |
1597 | ||
1598 | C<prototype> now treats magical variables like C<$1> the same way as | |
1599 | non-magical variables when checking for the CORE:: prefix, instead of | |
1600 | treating them as subroutine names. | |
1601 | ||
1602 | =item * | |
1603 | ||
1604 | Under threaded perls, a runtime code block in a regular expression could | |
1605 | corrupt the package name stored in the op tree, resulting in bad reads | |
1606 | in C<caller>, and possibly crashes [perl #113060]. | |
1607 | ||
1608 | =item * | |
1609 | ||
1610 | Referencing a closure prototype (C<\&{$_[1]}> in an attribute handler for a | |
1611 | closure) no longer results in a copy of the subroutine (or assertion | |
1612 | failures on debugging builds). | |
1613 | ||
1614 | =item * | |
1615 | ||
1616 | C<eval '__PACKAGE__'> now returns the right answer on threaded builds if | |
1617 | the current package has been assigned over (as in | |
1618 | C<*ThisPackage:: = *ThatPackage::>) [perl #78742]. | |
1619 | ||
1620 | =item * | |
1621 | ||
1622 | If a package is deleted by code that it calls, it is possible for C<caller> | |
1623 | to see a stack frame belonging to that deleted package. C<caller> could | |
1624 | crash if the stash's memory address was reused for a scalar and a | |
1625 | substitution was performed on the same scalar [perl #113486]. | |
1626 | ||
1627 | =item * | |
1628 | ||
1629 | C<UNIVERSAL::can> no longer treats its first argument differently | |
1630 | depending on whether it is a string or number internally. | |
1631 | ||
1632 | =item * | |
1633 | ||
1634 | C<open> with C<< <& >> for the mode checks to see whether the third argument is | |
1635 | a number, in determining whether to treat it as a file descriptor or a handle | |
1636 | name. Magical variables like C<$1> were always failing the numeric check and | |
1637 | being treated as handle names. | |
1638 | ||
1639 | =item * | |
1640 | ||
1641 | C<warn>'s handling of magical variables (C<$1>, ties) has undergone several | |
1642 | fixes. C<FETCH> is only called once now on a tied argument or a tied C<$@> | |
1643 | [perl #97480]. Tied variables returning objects that stringify as "" are | |
1644 | no longer ignored. A tied C<$@> that happened to return a reference the | |
1645 | I<previous> time it was used is no longer ignored. | |
1646 | ||
1647 | =item * | |
1648 | ||
1649 | C<warn ""> now treats C<$@> with a number in it the same way, regardless of | |
1650 | whether it happened via C<$@=3> or C<$@="3">. It used to ignore the | |
1651 | former. Now it appends "\t...caught", as it has always done with | |
1652 | C<$@="3">. | |
1653 | ||
1654 | =item * | |
1655 | ||
1656 | Numeric operators on magical variables (e.g., S<C<$1 + 1>>) used to use | |
1657 | floating point operations even where integer operations were more appropriate, | |
1658 | resulting in loss of accuracy on 64-bit platforms [perl #109542]. | |
1659 | ||
1660 | =item * | |
1661 | ||
1662 | Unary negation no longer treats a string as a number if the string happened | |
1663 | to be used as a number at some point. So, if C<$x> contains the string "dogs", | |
1664 | C<-$x> returns "-dogs" even if C<$y=0+$x> has happened at some point. | |
1665 | ||
1666 | =item * | |
1667 | ||
1668 | In Perl 5.14, C<-'-10'> was fixed to return "10", not "+10". But magical | |
1669 | variables (C<$1>, ties) were not fixed till now [perl #57706]. | |
1670 | ||
1671 | =item * | |
1672 | ||
1673 | Unary negation now treats strings consistently, regardless of the internal | |
1674 | C<UTF8> flag. | |
1675 | ||
1676 | =item * | |
1677 | ||
1678 | A regression introduced in Perl v5.16.0 involving | |
1679 | C<tr/I<SEARCHLIST>/I<REPLACEMENTLIST>/> has been fixed. Only the first | |
1680 | instance is supposed to be meaningful if a character appears more than | |
1681 | once in C<I<SEARCHLIST>>. Under some circumstances, the final instance | |
1682 | was overriding all earlier ones. [perl #113584] | |
1683 | ||
1684 | =item * | |
1685 | ||
1686 | Regular expressions like C<qr/\87/> previously silently inserted a NUL | |
1687 | character, thus matching as if it had been written C<qr/\00087/>. Now it | |
1688 | matches as if it had been written as C<qr/87/>, with a message that the | |
1689 | sequence C<"\8"> is unrecognized. | |
1690 | ||
1691 | =item * | |
1692 | ||
1693 | C<__SUB__> now works in special blocks (C<BEGIN>, C<END>, etc.). | |
1694 | ||
1695 | =item * | |
1696 | ||
1697 | Thread creation on Windows could theoretically result in a crash if done | |
1698 | inside a C<BEGIN> block. It still does not work properly, but it no longer | |
1699 | crashes [perl #111610]. | |
1700 | ||
1701 | =item * | |
1702 | ||
1703 | C<\&{''}> (with the empty string) now autovivifies a stub like any other | |
1704 | sub name, and no longer produces the "Unable to create sub" error | |
1705 | [perl #94476]. | |
1706 | ||
37133b20 RS |
1707 | =item * |
1708 | ||
1709 | A regression introduced in v5.14.0 has been fixed, in which some calls | |
1710 | to the C<re> module would clobber C<$_> [perl #113750]. | |
1711 | ||
1712 | =item * | |
1713 | ||
1714 | C<do FILE> now always either sets or clears C<$@>, even when the file can't be | |
1715 | read. This ensures that testing C<$@> first (as recommended by the | |
1716 | documentation) always returns the correct result. | |
1717 | ||
1718 | =item * | |
1719 | ||
1720 | The array iterator used for the C<each @array> construct is now correctly | |
1721 | reset when C<@array> is cleared (RT #75596). This happens for example when the | |
1722 | array is globally assigned to, as in C<@array = (...)>, but not when its | |
1723 | B<values> are assigned to. In terms of the XS API, it means that C<av_clear()> | |
1724 | will now reset the iterator. | |
1725 | ||
1726 | This mirrors the behaviour of the hash iterator when the hash is cleared. | |
1727 | ||
1728 | =item * | |
1729 | ||
1730 | C<< $class->can >>, C<< $class->isa >>, and C<< $class->DOES >> now return | |
1731 | correct results, regardless of whether that package referred to by C<$class> | |
1732 | exists [perl #47113]. | |
1733 | ||
1734 | =item * | |
1735 | ||
1736 | Arriving signals no longer clear C<$@> [perl #45173]. | |
1737 | ||
1738 | =item * | |
1739 | ||
1740 | Allow C<my ()> declarations with an empty variable list [perl #113554]. | |
1741 | ||
1742 | =item * | |
1743 | ||
1744 | During parsing, subs declared after errors no longer leave stubs | |
1745 | [perl #113712]. | |
1746 | ||
1747 | =item * | |
1748 | ||
1749 | Closures containing no string evals no longer hang on to their containing | |
1750 | subroutines, allowing variables closed over by outer subroutines to be | |
1751 | freed when the outer sub is freed, even if the inner sub still exists | |
1752 | [perl #89544]. | |
1753 | ||
1754 | =item * | |
1755 | ||
1756 | Duplication of in-memory filehandles by opening with a "<&=" or ">&=" mode | |
1757 | stopped working properly in 5.16.0. It was causing the new handle to | |
1758 | reference a different scalar variable. This has been fixed [perl #113764]. | |
1759 | ||
1760 | =item * | |
1761 | ||
1762 | C<qr//> expressions no longer crash with custom regular expression engines | |
1763 | that do not set C<offs> at regular expression compilation time | |
1764 | [perl #112962]. | |
1765 | ||
1766 | =item * | |
1767 | ||
1768 | C<delete local> no longer crashes with certain magical arrays and hashes | |
1769 | [perl #112966]. | |
1770 | ||
1771 | =item * | |
1772 | ||
1773 | C<local> on elements of certain magical arrays and hashes used not to | |
1774 | arrange to have the element deleted on scope exit, even if the element did | |
1775 | not exist before C<local>. | |
1776 | ||
1777 | =item * | |
1778 | ||
1779 | C<scalar(write)> no longer returns multiple items [perl #73690]. | |
1780 | ||
1781 | =item * | |
1782 | ||
1783 | String to floating point conversions no longer misparse certain strings under | |
1784 | C<use locale> [perl #109318]. | |
1785 | ||
1786 | =item * | |
1787 | ||
1788 | C<@INC> filters that die no longer leak memory [perl #92252]. | |
1789 | ||
1790 | =item * | |
1791 | ||
1792 | The implementations of overloaded operations are now called in the correct | |
1793 | context. This allows, among other things, being able to properly override | |
1794 | C<< <> >> [perl #47119]. | |
1795 | ||
1796 | =item * | |
1797 | ||
1798 | Specifying only the C<fallback> key when calling C<use overload> now behaves | |
1799 | properly [perl #113010]. | |
1800 | ||
1801 | =item * | |
1802 | ||
1803 | C<< sub foo { my $a = 0; while ($a) { ... } } >> and | |
1804 | C<< sub foo { while (0) { ... } } >> now return the same thing [perl #73618]. | |
1805 | ||
1806 | =item * | |
1807 | ||
1808 | Fixed the debugger C<l> and C<M> commands, and other debugger | |
1809 | functionality which was broken in 5.17.0 [perl #113918]. | |
1810 | ||
1811 | =item * | |
1812 | ||
1813 | String negation now behaves the same under C<use integer;> as it does | |
1814 | without [perl #113012]. | |
1815 | ||
1816 | =item * | |
1817 | ||
1818 | C<chr> now returns the Unicode replacement character (U+FFFD) for -1, | |
1819 | regardless of the internal representation. -1 used to wrap if the argument | |
1820 | was tied or a string internally. | |
1821 | ||
1822 | =item * | |
1823 | ||
1824 | Using a C<format> after its enclosing sub was freed could crash as of | |
1825 | perl 5.12.0, if the format referenced lexical variables from the outer sub. | |
1826 | ||
1827 | =item * | |
1828 | ||
1829 | Using a C<format> after its enclosing sub was undefined could crash as of | |
1830 | perl 5.10.0, if the format referenced lexical variables from the outer sub. | |
1831 | ||
1832 | =item * | |
1833 | ||
1834 | Using a C<format> defined inside a closures, which format references | |
1835 | lexical variables from outside, never really worked unless the C<write> | |
1836 | call was directly inside the closure. In 5.10.0 it even started crashing. | |
1837 | Now the copy of that closure nearest the top of the call stack is used to | |
1838 | find those variables. | |
1839 | ||
1840 | =item * | |
1841 | ||
1842 | Formats that close over variables in special blocks no longer crash if a | |
1843 | stub exists with the same name as the special block before the special | |
1844 | block is compiled. | |
1845 | ||
1846 | =item * | |
1847 | ||
1848 | The parser no longer gets confused, treating C<eval foo ()> as a syntax | |
1849 | error if preceded by C<print;> [perl #16249]. | |
1850 | ||
1851 | =item * | |
1852 | ||
1853 | The return value of C<syscall> is no longer truncated on 64-bit platforms | |
1854 | [perl #113980]. | |
1855 | ||
1856 | =item * | |
1857 | ||
1858 | Constant folding no longer causes C<print 1 ? FOO : BAR> to print to the | |
1859 | FOO handle [perl #78064]. | |
1860 | ||
1861 | =item * | |
1862 | ||
1863 | C<do subname> now calls the named subroutine and uses the file name it | |
1864 | returns, instead of opening a file named "subname". | |
1865 | ||
1866 | =item * | |
1867 | ||
1868 | Subroutines looked up by rv2cv check hooks (registered by XS modules) are | |
1869 | now taken into consideration when determining whether C<foo bar> should be | |
1870 | the sub call C<foo(bar)> or the method call C<< "bar"->foo >>. | |
1871 | ||
1872 | =item * | |
1873 | ||
1874 | C<CORE::foo::bar> is no longer treated specially, allowing global overrides | |
1875 | to be called directly via C<CORE::GLOBAL::uc(...)> [perl #113016]. | |
1876 | ||
1877 | =item * | |
1878 | ||
1879 | Calling an undefined sub whose typeglob has been undefined now produces the | |
1880 | customary "Undefined subroutine called" error, instead of "Not a CODE | |
1881 | reference". | |
1882 | ||
1883 | =item * | |
1884 | ||
1885 | Two bugs involving @ISA have been fixed. C<*ISA = *glob_without_array> and | |
1886 | C<undef *ISA; @{*ISA}> would prevent future modifications to @ISA from | |
1887 | updating the internal caches used to look up methods. The | |
1888 | *glob_without_array case was a regression from Perl 5.12. | |
1889 | ||
1890 | =item * | |
1891 | ||
1892 | Regular expression optimisations sometimes caused C<$> with C</m> to | |
1893 | produce failed or incorrect matches [perl #114068]. | |
1894 | ||
1895 | =item * | |
1896 | ||
1897 | C<__SUB__> now works in a C<sort> block when the enclosing subroutine is | |
1898 | predeclared with C<sub foo;> syntax [perl #113710]. | |
1899 | ||
1900 | =item * | |
1901 | ||
1902 | Unicode properties only apply to Unicode code points, which leads to | |
1903 | some subtleties when regular expressions are matched against | |
1904 | above-Unicode code points. There is a warning generated to draw your | |
1905 | attention to this. However, this warning was being generated | |
1906 | inappropriately in some cases, such as when a program was being parsed. | |
1907 | Non-Unicode matches such as C<\w> and C<[:word;]> should not generate the | |
1908 | warning, as their definitions don't limit them to apply to only Unicode | |
1909 | code points. Now the message is only generated when matching against | |
1910 | C<\p{}> and C<\P{}>. There remains a bug, [perl #114148], for the very | |
1911 | few properties in Unicode that match just a single code point. The | |
1912 | warning is not generated if they are matched against an above-Unicode | |
1913 | code point. | |
1914 | ||
e5ba1bf1 FC |
1915 | =back |
1916 | ||
0bba4573 | 1917 | =head1 Known Problems |
e5ba1bf1 | 1918 | |
0bba4573 RS |
1919 | XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any |
1920 | tests that had to be C<TODO>ed for the release would be noted here. Unfixed | |
1921 | platform specific bugs also go here. | |
1922 | ||
1923 | [ List each fix as a =item entry ] | |
1924 | ||
1925 | =over 4 | |
1926 | ||
1927 | =item * | |
1928 | ||
1929 | XXX | |
1930 | ||
1931 | =back | |
e5ba1bf1 FC |
1932 | |
1933 | =head1 Acknowledgements | |
1934 | ||
1935 | XXX Generate this with: | |
1936 | ||
de3d8d88 | 1937 | perl Porting/acknowledgements.pl v5.17.12..HEAD |
e5ba1bf1 FC |
1938 | |
1939 | =head1 Reporting Bugs | |
1940 | ||
1941 | If you find what you think is a bug, you might check the articles recently | |
1942 | posted to the comp.lang.perl.misc newsgroup and the perl bug database at | |
1943 | http://rt.perl.org/perlbug/ . There may also be information at | |
1944 | http://www.perl.org/ , the Perl Home Page. | |
1945 | ||
1946 | If you believe you have an unreported bug, please run the L<perlbug> program | |
1947 | included with your release. Be sure to trim your bug down to a tiny but | |
1948 | sufficient test case. Your bug report, along with the output of C<perl -V>, | |
1949 | will be sent off to perlbug@perl.org to be analysed by the Perl porting team. | |
1950 | ||
1951 | If the bug you are reporting has security implications, which make it | |
1952 | inappropriate to send to a publicly archived mailing list, then please send it | |
1953 | to perl5-security-report@perl.org. This points to a closed subscription | |
1954 | unarchived mailing list, which includes all the core committers, who will be | |
1955 | able to help assess the impact of issues, figure out a resolution, and help | |
1956 | co-ordinate the release of patches to mitigate or fix the problem across all | |
1957 | platforms on which Perl is supported. Please only use this address for | |
1958 | security issues in the Perl core, not for modules independently distributed on | |
1959 | CPAN. | |
1960 | ||
1961 | =head1 SEE ALSO | |
1962 | ||
1963 | The F<Changes> file for an explanation of how to view exhaustive details on | |
1964 | what changed. | |
1965 | ||
1966 | The F<INSTALL> file for how to build Perl. | |
1967 | ||
1968 | The F<README> file for general stuff. | |
1969 | ||
1970 | The F<Artistic> and F<Copying> files for copyright information. | |
1971 | ||
1972 | =cut |