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