Commit | Line | Data |
---|---|---|
44691e6f AB |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
86372193 A |
5 | [ this is a template for a new perldelta file. Any text flagged as XXX needs |
6 | to be processed before release. ] | |
7 | ||
8 | perldelta - what is new for perl v5.21.6 | |
c68523cb | 9 | |
238894db | 10 | =head1 DESCRIPTION |
c68523cb | 11 | |
86372193 | 12 | This document describes differences between the 5.21.5 release and the 5.21.6 |
238894db | 13 | release. |
c68523cb | 14 | |
86372193 A |
15 | If you are upgrading from an earlier release such as 5.21.4, first read |
16 | L<perl5215delta>, which describes differences between 5.21.4 and 5.21.5. | |
8435afd1 | 17 | |
86372193 | 18 | =head1 Notice |
5cfa0642 | 19 | |
86372193 | 20 | XXX Any important notices here |
4cad5dc8 | 21 | |
86372193 | 22 | =head1 Core Enhancements |
4cad5dc8 | 23 | |
86372193 A |
24 | XXX New core language features go here. Summarize user-visible core language |
25 | enhancements. Particularly prominent performance optimisations could go | |
26 | here, but most should go in the L</Performance Enhancements> section. | |
a5591204 | 27 | |
86372193 | 28 | [ List each enhancement as a =head2 entry ] |
a5591204 | 29 | |
518159a1 TC |
30 | =head2 List form of pipe open implemented for Win32 |
31 | ||
32 | The list form of pipe: | |
33 | ||
34 | open my $fh, "-|", "program", @arguments; | |
35 | ||
36 | is now implemented on Win32. It has the same limitations as C<system | |
37 | LIST> on Win32, since the Win32 API doesn't accept program arguments | |
38 | as a list. | |
39 | ||
fe609065 FC |
40 | =head2 Assignment to list repetition |
41 | ||
42 | C<(...) x ...> can now be used within a list that is assigned to, as long | |
43 | as the left-hand side is a valid lvalue. This allows C<(undef,undef,$foo) | |
44 | = that_function()> to be written as C<((undef)x2, $foo) = that_function()>. | |
45 | ||
295f7815 FC |
46 | =head2 C<close> now sets C<$!> |
47 | ||
48 | When an I/O error occurs, the fact that there has been an error is recorded | |
49 | in the handle. C<close> returns false for such a handle. Previously, the | |
50 | value of C<$!> would be untouched by C<close>, so the common convention of | |
51 | writing C<close $fh or die $!> did not work reliably. Now the handle | |
52 | records the value of C<$!>, too, and C<close> restores it. | |
53 | ||
86372193 | 54 | =head1 Security |
a5591204 | 55 | |
86372193 A |
56 | XXX Any security-related notices go here. In particular, any security |
57 | vulnerabilities closed should be noted here rather than in the | |
58 | L</Selected Bug Fixes> section. | |
a5591204 | 59 | |
86372193 | 60 | [ List each security issue as a =head2 entry ] |
a5591204 | 61 | |
86372193 | 62 | =head1 Incompatible Changes |
a5591204 | 63 | |
86372193 | 64 | XXX For a release on a stable branch, this section aspires to be: |
a5591204 | 65 | |
86372193 A |
66 | There are no changes intentionally incompatible with 5.XXX.XXX |
67 | If any exist, they are bugs, and we request that you submit a | |
68 | report. See L</Reporting Bugs> below. | |
b15c1b56 | 69 | |
86372193 | 70 | [ List each incompatible change as a =head2 entry ] |
b15c1b56 | 71 | |
86372193 | 72 | =head1 Deprecations |
bb8c7e27 | 73 | |
86372193 | 74 | XXX Any deprecated features, syntax, modules etc. should be listed here. |
bb8c7e27 | 75 | |
86372193 | 76 | =head2 Module removals |
bb8c7e27 | 77 | |
86372193 | 78 | XXX Remove this section if inapplicable. |
9a88d663 | 79 | |
86372193 A |
80 | The following modules will be removed from the core distribution in a |
81 | future release, and will at that time need to be installed from CPAN. | |
82 | Distributions on CPAN which require these modules will need to list them as | |
83 | prerequisites. | |
9a88d663 | 84 | |
86372193 A |
85 | The core versions of these modules will now issue C<"deprecated">-category |
86 | warnings to alert you to this fact. To silence these deprecation warnings, | |
87 | install the modules in question from CPAN. | |
5cfa0642 | 88 | |
86372193 A |
89 | Note that these are (with rare exceptions) fine modules that you are encouraged |
90 | to continue to use. Their disinclusion from core primarily hinges on their | |
91 | necessity to bootstrapping a fully functional, CPAN-capable Perl installation, | |
92 | not usually on concerns over their design. | |
ba474e87 | 93 | |
86372193 | 94 | =over |
8435afd1 | 95 | |
86372193 | 96 | =item XXX |
d0ab07ee | 97 | |
86372193 A |
98 | XXX Note that deprecated modules should be listed here even if they are listed |
99 | as an updated module in the L</Modules and Pragmata> section. | |
cc4d09e1 | 100 | |
86372193 | 101 | =back |
cc4d09e1 | 102 | |
86372193 | 103 | [ List each other deprecation as a =head2 entry ] |
8435afd1 | 104 | |
4475d0d2 KW |
105 | =head2 Use of non-graphic characters in single-character variable names |
106 | ||
107 | The syntax for single-character variable names is more lenient than | |
108 | for longer variable names, allowing the one-character name to be a | |
109 | punctuation character or even invisible (a non-graphic). Perl v5.20 | |
110 | deprecated the ASCII-range controls as such a name. Now, all | |
111 | non-graphic characters that formerly were allowed are deprecated. | |
112 | The practical effect of this occurs only when not under C<S<"use | |
113 | utf8">>, and affects just the C1 controls (code points 0x80 through | |
114 | 0xFF), NO-BREAK SPACE, and SOFT HYPHEN. | |
115 | ||
9f122eef FC |
116 | =head2 Inlining of C<sub () { $var }> with observable side-effects |
117 | ||
118 | In many cases Perl makes sub () { $var } into an inlinable constant | |
119 | subroutine, capturing the value of $var at the time the C<sub> expression | |
120 | is evaluated. This can break the closure behaviour in those cases where | |
121 | $var is subsequently modified. The subroutine won't return the new value. | |
122 | ||
123 | This usage is now deprecated in those cases where the variable could be | |
124 | modified elsewhere. Perl detects those cases and emits a deprecation | |
125 | warning. Such code will likely change in the future and stop producing a | |
126 | constant. | |
127 | ||
128 | If your variable is only modified in the place where it is declared, then | |
129 | Perl will continue to make the sub inlinable with no warnings. | |
130 | ||
131 | sub make_constant { | |
132 | my $var = shift; | |
133 | return sub () { $var }; # fine | |
134 | } | |
135 | ||
136 | sub make_constant_deprecated { | |
137 | my $var; | |
138 | $var = shift; | |
139 | return sub () { $bar }; # deprecated | |
140 | } | |
141 | ||
142 | sub make_constant_deprecated2 { | |
143 | my $var = shift; | |
144 | log_that_value($var); # could modify $var | |
145 | return sub () { $bar }; # deprecated | |
146 | } | |
147 | ||
148 | In the second example above, detecting that $var is assigned to only once | |
149 | is too hard to detect. That it happens in a spot other than the C<my> | |
150 | declaration is enough for Perl to find it suspicious. | |
151 | ||
152 | This deprecation warning happens only for a simple variable for the body of | |
153 | the sub. (A C<BEGIN> block or C<use> statement inside the sub is ignored, | |
154 | because it does not become part of the sub's body.) For more complex | |
155 | cases, such as C<sub () { do_something() if 0; $var }> the behaviour has | |
156 | changed such that inlining does not happen if the variable is modifiable | |
157 | elsewhere. Such cases should be rare. | |
158 | ||
8c8d6154 | 159 | =head1 Performance Enhancements |
5cfa0642 | 160 | |
86372193 A |
161 | XXX Changes which enhance performance without changing behaviour go here. |
162 | There may well be none in a stable release. | |
5cfa0642 | 163 | |
86372193 | 164 | [ List each enhancement as a =item entry ] |
8435afd1 | 165 | |
86372193 | 166 | =over 4 |
5cfa0642 | 167 | |
5b306eef DD |
168 | =item * |
169 | ||
25a8e2be FC |
170 | C<(...)x1>, C<("constant")x0> and C<($scalar)x0> are now optimised in list |
171 | context. If the right-hand argument is a constant 1, the repetition | |
172 | operator disappears. If the right-hand argument is a constant 0, the whole | |
173 | expressions is optimised to the empty list, so long as the left-hand | |
174 | argument is a simple scalar or constant. C<(foo())x0> is not optimised. | |
5b306eef | 175 | |
ef7051ba FC |
176 | =item * |
177 | ||
178 | C<substr> assignment is now optimised into 4-argument C<substr> at the end | |
179 | of a subroutine (or as the argument to C<return>). Previously, this | |
180 | optimisation only happened in void context. | |
181 | ||
b450ee68 FC |
182 | =item * |
183 | ||
184 | Assignment to lexical variables is often optimised away. For instance, in | |
185 | C<$lexical = chr $foo>, the C<chr> operator writes directly to the lexical | |
186 | variable instead of returning a value that gets copied. This optimisation | |
187 | has been extended to C<split>, C<x> and C<vec> on the right-hand side. It | |
188 | has also been made to work with state variable initialization. | |
189 | ||
1e461e16 FC |
190 | =item * |
191 | ||
192 | In "\L...", "\Q...", etc., the extra "stringify" op is now optimised away, | |
193 | making these just as fast as C<lcfirst>, C<quotemeta>, etc. | |
194 | ||
aa95859b FC |
195 | =item * |
196 | ||
197 | Assignment to an empty list is now sometimes faster. In particular, it | |
198 | never calls C<FETCH> on tied arguments on the right-hand side, whereas it | |
199 | used to sometimes. | |
200 | ||
86372193 | 201 | =back |
357205d5 | 202 | |
86372193 | 203 | =head1 Modules and Pragmata |
357205d5 | 204 | |
86372193 A |
205 | XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/> |
206 | go here. If Module::CoreList is updated, generate an initial draft of the | |
207 | following sections using F<Porting/corelist-perldelta.pl>. A paragraph summary | |
208 | for important changes should then be added by hand. In an ideal world, | |
209 | dual-life modules would have a F<Changes> file that could be cribbed. | |
f704f251 | 210 | |
86372193 | 211 | [ Within each section, list entries as a =item entry ] |
f704f251 | 212 | |
86372193 | 213 | =head2 New Modules and Pragmata |
0cb3abac | 214 | |
86372193 | 215 | =over 4 |
0cb3abac | 216 | |
deec1830 FC |
217 | =item * |
218 | ||
86372193 | 219 | XXX |
deec1830 | 220 | |
8c8d6154 | 221 | =back |
d0ab07ee | 222 | |
8c8d6154 | 223 | =head2 Updated Modules and Pragmata |
d99849ae | 224 | |
39c4a6cf | 225 | =over 4 |
d99849ae | 226 | |
ff433f2d PM |
227 | =item * |
228 | ||
15d464c4 FC |
229 | L<B::Deparse> has been upgraded from version 1.29 to 1.30. |
230 | ||
231 | It now deparses C<+sub : attr { ... }> correctly at the start of a | |
232 | statement. Without the initial C<+>, C<sub> would be a statement label. | |
233 | ||
16752205 FC |
234 | C<BEGIN> blocks are now emitted in the right place most of the time, but |
235 | the change unfortunately introduced a regression, in that C<BEGIN> blocks | |
236 | occurring just before the end of the enclosing block may appear below it | |
237 | instead. So this change may need to be reverted if it cannot be fixed | |
238 | before Perl 5.22. [perl #77452] | |
239 | ||
80b0bb91 FC |
240 | B::Deparse no longer puts erroneous C<local> here and there, such as for |
241 | C<LIST = tr/a//d>. [perl #119815] | |
242 | ||
15d464c4 FC |
243 | =item * |
244 | ||
d8fc3586 FC |
245 | L<B::Op_private> has been upgraded from version 5.021005 to 5.021006. |
246 | ||
247 | It now includes a hash named C<%ops_using>, list all op types that use a | |
248 | particular private flag. | |
249 | ||
250 | =item * | |
251 | ||
f4e81f96 | 252 | L<DynaLoader> has been upgraded from version 1.27 to 1.28. |
cbfcbc14 | 253 | |
bb6a367a DD |
254 | =item * |
255 | ||
f4e81f96 FC |
256 | L<IO::Socket> has been upgraded from version 1.37 to 1.38. |
257 | ||
258 | Document the limitations of the isconnected() method. [perl #123096] | |
bb6a367a | 259 | |
86372193 | 260 | =back |
f348c3d8 | 261 | |
86372193 | 262 | =head2 Removed Modules and Pragmata |
f348c3d8 | 263 | |
86372193 | 264 | =over 4 |
f348c3d8 A |
265 | |
266 | =item * | |
267 | ||
86372193 | 268 | XXX |
f348c3d8 | 269 | |
86372193 | 270 | =back |
7635ad4d | 271 | |
86372193 | 272 | =head1 Documentation |
7635ad4d | 273 | |
86372193 A |
274 | XXX Changes to files in F<pod/> go here. Consider grouping entries by |
275 | file and be sure to link to the appropriate page, e.g. L<perlfunc>. | |
7635ad4d | 276 | |
86372193 | 277 | =head2 New Documentation |
f348c3d8 | 278 | |
86372193 | 279 | XXX Changes which create B<new> files in F<pod/> go here. |
f348c3d8 | 280 | |
86372193 | 281 | =head3 L<XXX> |
f4eedc6b | 282 | |
86372193 | 283 | XXX Description of the purpose of the new file here |
f4eedc6b | 284 | |
86372193 | 285 | =head2 Changes to Existing Documentation |
f4eedc6b | 286 | |
86372193 A |
287 | XXX Changes which significantly change existing files in F<pod/> go here. |
288 | However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics> | |
289 | section. | |
f348c3d8 | 290 | |
42327f06 | 291 | =head3 L<perldata/Identifier parsing> |
f348c3d8 | 292 | |
86372193 | 293 | =over 4 |
f348c3d8 A |
294 | |
295 | =item * | |
296 | ||
42327f06 KW |
297 | The syntax of single-character variable names has been brought |
298 | up-to-date and more fully explained. | |
f348c3d8 | 299 | |
86372193 | 300 | =back |
f348c3d8 | 301 | |
86372193 | 302 | =head1 Diagnostics |
f348c3d8 | 303 | |
86372193 A |
304 | The following additions or changes have been made to diagnostic output, |
305 | including warnings and fatal error messages. For the complete list of | |
306 | diagnostic messages, see L<perldiag>. | |
f348c3d8 | 307 | |
86372193 A |
308 | XXX New or changed warnings emitted by the core's C<C> code go here. Also |
309 | include any changes in L<perldiag> that reconcile it to the C<C> code. | |
f348c3d8 | 310 | |
86372193 | 311 | =head2 New Diagnostics |
f348c3d8 | 312 | |
86372193 A |
313 | XXX Newly added diagnostic messages go under here, separated into New Errors |
314 | and New Warnings | |
f348c3d8 | 315 | |
86372193 | 316 | =head3 New Errors |
84d03adf | 317 | |
86372193 | 318 | =over 4 |
ff433f2d | 319 | |
4cd408ba TC |
320 | =item * |
321 | ||
86372193 | 322 | XXX L<message|perldiag/"message"> |
f348c3d8 | 323 | |
86372193 | 324 | =back |
f348c3d8 | 325 | |
86372193 | 326 | =head3 New Warnings |
f4eedc6b | 327 | |
86372193 | 328 | =over 4 |
f4eedc6b DD |
329 | |
330 | =item * | |
331 | ||
4475d0d2 | 332 | L<Use of literal non-graphic characters in variable names is deprecated|perldiag/"Use of literal non-graphic characters in variable names is deprecated"> |
f348c3d8 | 333 | |
ab0b796c KW |
334 | =item * |
335 | ||
8c6180a9 KW |
336 | A new C<locale> warning category has been created, with the following warning |
337 | messages currently in it: | |
338 | ||
339 | =over 4 | |
340 | ||
341 | =item * | |
342 | ||
343 | L<Locale '%s' may not work well.%s|perldiag/Locale '%s' may not work well.%s> | |
344 | ||
345 | =item * | |
346 | ||
ab0b796c KW |
347 | L<Can't do %s("%s") on non-UTF-8 locale; resolved to "%s".|perldiag/Can't do %s("%s") on non-UTF-8 locale; resolved to "%s".> |
348 | ||
86372193 | 349 | =back |
0561e60b | 350 | |
dd200dff FC |
351 | =item * |
352 | ||
353 | L<Warning: unable to close filehandle %s properly: %s|perldiag/"Warning: unable to close filehandle %s properly: %s"> | |
354 | ||
73e793fc FC |
355 | =item * |
356 | ||
357 | The following two warnings for C<tr///> used to be skipped if the | |
358 | transliteration contained wide characters, but now they occur regardless of | |
359 | whether there are wide characters or not: | |
360 | ||
361 | L<Useless use of E<sol>d modifier in transliteration operator|perldiag/"Useless use of /d modifier in transliteration operator"> | |
362 | ||
363 | L<Replacement list is longer than search list|perldiag/Replacement list is longer than search list> | |
364 | ||
8c6180a9 KW |
365 | =back |
366 | ||
86372193 | 367 | =head2 Changes to Existing Diagnostics |
0561e60b | 368 | |
86372193 | 369 | XXX Changes (i.e. rewording) of diagnostic messages go here |
0561e60b | 370 | |
86372193 | 371 | =over 4 |
4cd408ba | 372 | |
f348c3d8 A |
373 | =item * |
374 | ||
cb3bb329 | 375 | L<Quantifier unexpected on zero-length expression in regex mE<sol>%sE<sol>|perldiag/"Quantifier unexpected on zero-length expression in regex m/%s/">. |
4a328228 FC |
376 | |
377 | This message has had the S<"<-- HERE"> marker removed, as it was always | |
378 | placed at the end of the regular expression, regardless of where the | |
379 | problem actually occurred. [perl #122680] | |
4cd408ba | 380 | |
86372193 | 381 | =back |
40a81b59 | 382 | |
86372193 | 383 | =head1 Utility Changes |
f348c3d8 | 384 | |
86372193 A |
385 | XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here. |
386 | Most of these are built within the directory F<utils>. | |
f348c3d8 | 387 | |
86372193 A |
388 | [ List utility changes as a =head2 entry for each utility and =item |
389 | entries for each change | |
390 | Use L<XXX> with program names to get proper documentation linking. ] | |
f348c3d8 | 391 | |
86372193 | 392 | =head2 L<XXX> |
f348c3d8 | 393 | |
86372193 | 394 | =over 4 |
f348c3d8 A |
395 | |
396 | =item * | |
397 | ||
86372193 | 398 | XXX |
40a81b59 | 399 | |
13900f93 | 400 | =back |
aac7f82f | 401 | |
86372193 | 402 | =head1 Configuration and Compilation |
2a395b86 | 403 | |
86372193 A |
404 | XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools |
405 | go here. Any other changes to the Perl build process should be listed here. | |
406 | However, any platform-specific changes should be listed in the | |
407 | L</Platform Support> section, instead. | |
8435afd1 | 408 | |
86372193 | 409 | [ List changes as a =item entry ]. |
8435afd1 SH |
410 | |
411 | =over 4 | |
2a395b86 | 412 | |
12d22d1f JK |
413 | =item * |
414 | ||
c517e197 | 415 | F<Configure> with C<-Dmksymlinks> should now be faster. [perl #122002] |
12d22d1f | 416 | |
2a395b86 PM |
417 | =back |
418 | ||
86372193 | 419 | =head1 Testing |
2a395b86 | 420 | |
86372193 A |
421 | XXX Any significant changes to the testing of a freshly built perl should be |
422 | listed here. Changes which create B<new> files in F<t/> go here as do any | |
423 | large changes to the testing harness (e.g. when parallel testing was added). | |
424 | Changes to existing files in F<t/> aren't worth summarizing, although the bugs | |
425 | that they represent may be covered elsewhere. | |
2a395b86 | 426 | |
86372193 | 427 | [ List each test improvement as a =item entry ] |
5cfa0642 | 428 | |
8c8d6154 | 429 | =over 4 |
2a395b86 PM |
430 | |
431 | =item * | |
432 | ||
86372193 | 433 | XXX |
bb8c7e27 | 434 | |
86372193 | 435 | =back |
bb8c7e27 | 436 | |
86372193 | 437 | =head1 Platform Support |
bb8c7e27 | 438 | |
86372193 | 439 | XXX Any changes to platform support should be listed in the sections below. |
bb8c7e27 | 440 | |
86372193 A |
441 | [ Within the sections, list each platform as a =item entry with specific |
442 | changes as paragraphs below it. ] | |
2a395b86 | 443 | |
86372193 | 444 | =head2 New Platforms |
6d9b7c7c | 445 | |
86372193 A |
446 | XXX List any platforms that this version of perl compiles on, that previous |
447 | versions did not. These will either be enabled by new files in the F<hints/> | |
448 | directories, or new subdirectories and F<README> files at the top level of the | |
449 | source tree. | |
363d3025 | 450 | |
8c8d6154 | 451 | =over 4 |
334464b3 | 452 | |
86372193 | 453 | =item XXX-some-platform |
334464b3 | 454 | |
86372193 | 455 | XXX |
ef5a9509 | 456 | |
363d3025 FC |
457 | =back |
458 | ||
86372193 A |
459 | =head2 Discontinued Platforms |
460 | ||
461 | XXX List any platforms that this version of perl no longer compiles on. | |
d72cd2eb | 462 | |
0346c3a9 | 463 | =over 4 |
375f5f06 | 464 | |
86372193 | 465 | =item XXX-some-platform |
2884baee | 466 | |
86372193 | 467 | XXX |
6f1a844b | 468 | |
8c8d6154 | 469 | =back |
549ea8d4 | 470 | |
8c8d6154 | 471 | =head2 Platform-Specific Notes |
aa292ef2 | 472 | |
86372193 A |
473 | XXX List any changes for specific platforms. This could include configuration |
474 | and compilation changes or changes in portability/compatibility. However, | |
475 | changes within modules for platforms should generally be listed in the | |
476 | L</Modules and Pragmata> section. | |
477 | ||
8c8d6154 | 478 | =over 4 |
739e9bee | 479 | |
86372193 | 480 | =item XXX-some-platform |
739e9bee | 481 | |
86372193 | 482 | XXX |
b23b2fdb | 483 | |
8c8d6154 | 484 | =back |
b23b2fdb | 485 | |
83b69bfd DD |
486 | =head3 Win32 |
487 | ||
488 | =over 4 | |
489 | ||
490 | =item * | |
491 | ||
492 | In the experimental C<:win32> layer, a crash in C<open> was fixed. Also | |
493 | opening C</dev/null>, which works the Win32 Perl's normal C<:unix> layer, was | |
494 | implemented for C<:win32>. | |
495 | L<[perl #122224]|https://rt.perl.org/Ticket/Display.html?id=122224> | |
496 | ||
13adb056 SH |
497 | =item * |
498 | ||
499 | A new makefile option, C<USE_LONG_DOUBLE>, has been added to the Windows | |
500 | dmake makefile for gcc builds only. Set this to "define" if you want perl to | |
501 | use long doubles to give more accuracy and range for floating point numbers. | |
502 | ||
83b69bfd DD |
503 | =back |
504 | ||
8c8d6154 | 505 | =head1 Internal Changes |
7d15b1a8 | 506 | |
86372193 A |
507 | XXX Changes which affect the interface available to C<XS> code go here. Other |
508 | significant internal changes for future core maintainers should be noted as | |
509 | well. | |
bbca64cf | 510 | |
86372193 | 511 | [ List each change as a =item entry ] |
6ff8f256 | 512 | |
86372193 | 513 | =over 4 |
28482d6c | 514 | |
28a42920 A |
515 | =item * |
516 | ||
f8d5a522 DD |
517 | C<screaminstr> has been removed. Although marked as public API, it is |
518 | undocumented and has no usage in modern perl versions on CPAN Grep. Calling it | |
519 | has been fatal since 5.17.0. | |
28a42920 | 520 | |
d109137e FC |
521 | =item * |
522 | ||
76acbf4f FC |
523 | C<newDEFSVOP>, C<block_start>, C<block_end> and C<intro_my> have been added |
524 | to the API. | |
d109137e | 525 | |
cff8e04e FC |
526 | =item * |
527 | ||
528 | The internal C<convert> function in F<op.c> has been renamed | |
529 | C<op_convert_list> and added to the API. | |
530 | ||
391823f2 FC |
531 | =item * |
532 | ||
533 | C<sv_magic> no longer forbids "ext" magic on read-only values. After all, | |
534 | perl can't know whether the custom magic will modify the SV or not. | |
535 | [perl #123103] | |
536 | ||
8c8d6154 | 537 | =back |
6ff8f256 | 538 | |
8c8d6154 | 539 | =head1 Selected Bug Fixes |
80cc3290 | 540 | |
86372193 A |
541 | XXX Important bug fixes in the core language are summarized here. Bug fixes in |
542 | files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>. | |
13dd5671 | 543 | |
86372193 | 544 | [ List each fix as a =item entry ] |
bdab7676 | 545 | |
86372193 | 546 | =over 4 |
db98db4e | 547 | |
8818afe8 TC |
548 | =item * |
549 | ||
2ad9844a TC |
550 | fchmod() and futimes() now set C<$!> when they fail due to being |
551 | passed a closed file handle. [perl #122703] | |
bb8c7e27 | 552 | |
9ee757be KW |
553 | =item * |
554 | ||
555 | Perl now comes with a corrected Unicode 7.0 for the erratum issued on | |
556 | October 21, 2014 (see L<http://www.unicode.org/errata/#current_errata>), | |
557 | dealing with glyph shaping in Arabic. | |
558 | ||
c93d2ba1 TC |
559 | =item * |
560 | ||
561 | op_free() no longer crashes due to a stack overflow when freeing a | |
562 | deeply recursive op tree. [perl #108276] | |
563 | ||
53795ef8 FC |
564 | =item * |
565 | ||
9d22ccf6 TC |
566 | scalarvoid() would crash due to a stack overflow when processing a |
567 | deeply recursive op tree. [perl #108276] | |
568 | ||
569 | =item * | |
570 | ||
53795ef8 FC |
571 | In Perl 5.20.0, C<$^N> accidentally had the internal UTF8 flag turned off |
572 | if accessed from a code block within a regular expression, effectively | |
573 | UTF8-encoding the value. This has been fixed. [perl #123135] | |
574 | ||
b7cd8332 FC |
575 | =item * |
576 | ||
577 | A failed C<semctl> call no longer overwrites existing items on the stack, | |
578 | causing C<(semctl(-1,0,0,0))[0]> to give an "uninitialized" warning. | |
579 | ||
480961b6 FC |
580 | =item * |
581 | ||
582 | C<else{foo()}> with no space before C<foo> is now better at assigning the | |
583 | right line number to that statement. [perl #122695] | |
584 | ||
94c9bf90 FC |
585 | =item * |
586 | ||
587 | Sometimes the assignment in C<@array = split> gets optimised and C<split> | |
588 | itself writes directly to the array. This caused a bug, preventing this | |
589 | assignment from being used in lvalue context. So | |
590 | C<(@a=split//,"foo")=bar()> was an error. (This bug probably goes back to | |
591 | Perl 3, when the optimisation was added.) This optimisation, and the bug, | |
592 | started to happen in more cases in 5.21.5. It has now been fixed. | |
593 | [perl #123057] | |
594 | ||
8af808bf FC |
595 | =item * |
596 | ||
597 | When argument lists that fail the checks installed by subroutine | |
598 | signatures, the resulting error messages now give the file and line number | |
599 | of the caller, not of the called subroutine. [perl #121374] | |
600 | ||
fdcaecb7 FC |
601 | =item * |
602 | ||
603 | Flip-flop operators (C<..> and C<...> in scalar context) used to maintain | |
604 | a separate state for each recursion level (the number of times the | |
605 | enclosing sub was called recursively), contrary to the documentation. Now | |
606 | each closure has one internal state for each flip-flop. [perl #122829] | |
607 | ||
2af7c6b6 FC |
608 | =item * |
609 | ||
610 | C<use>, C<no>, statement labels, special blocks (C<BEGIN>) and pod are now | |
611 | permitted as the first thing in a C<map> or C<grep> block, the block after | |
612 | C<print> or C<say> (or other functions) returning a handle, and within | |
613 | C<${...}>, C<@{...}>, etc. [perl #122782] | |
614 | ||
c0b32823 FC |
615 | =item * |
616 | ||
617 | The repetition operator C<x> now propagates lvalue context to its left-hand | |
618 | argument when used in contexts like C<foreach>. That allows | |
619 | C<for(($#that_array)x2) { ... }> to work as expected if the loop modifies | |
620 | $_. | |
621 | ||
b1a4e8b3 FC |
622 | =item * |
623 | ||
624 | C<(...) x ...> in scalar context used to corrupt the stack if one operand | |
625 | were an object with "x" overloading, causing erratic behaviour. | |
626 | [perl #121827] | |
627 | ||
9e26817d FC |
628 | =item * |
629 | ||
630 | Assignment to a lexical scalar is often optimised away (as mentioned under | |
179c70e5 | 631 | L</Performance Enhancements>). Various bugs related to this optimisation |
9e26817d FC |
632 | have been fixed. Certain operators on the right-hand side would sometimes |
633 | fail to assign the value at all or assign the wrong value, or would call | |
634 | STORE twice or not at all on tied variables. The operators affected were | |
635 | C<$foo++>, C<$foo-->, and C<-$foo> under C<use integer>, C<chomp>, C<chr> | |
636 | and C<setpgrp>. | |
637 | ||
70cee83f FC |
638 | =item * |
639 | ||
640 | List assignments were sometimes buggy if the same scalar ended up on both | |
641 | sides of the assignment due to used of C<tied>, C<values> or C<each>. The | |
642 | result would be the wrong value getting assigned. | |
643 | ||
e5fbfbc1 FC |
644 | =item * |
645 | ||
646 | C<setpgrp($nonzero)> (with one argument) was accidentally changed in 5.16 | |
647 | to mean C<setpgrp(0)>. This has been fixed. | |
648 | ||
353075a0 FC |
649 | =item * |
650 | ||
651 | C<__SUB__> could return the wrong value or even corrupt memory under the | |
652 | debugger (the B<-d> switch) and in subs containing C<eval $string>. | |
653 | ||
9f122eef FC |
654 | =item * |
655 | ||
656 | When C<sub () { $var }> becomes inlinable, it now returns a different | |
657 | scalar each time, just as a non-inlinable sub would, though Perl still | |
658 | optimises the copy away in cases where it would make no observable | |
659 | difference. | |
660 | ||
661 | =item * | |
662 | ||
663 | C<my sub f () { $var }> and C<sub () : attr { $var }> are no longer | |
664 | eligible for inlining. The former would crash; the latter would just | |
665 | throw the attributes away. An exception is made for the little-known | |
666 | ":method" attribute, which does nothing much. | |
667 | ||
668 | =item * | |
669 | ||
670 | Inlining of subs with an empty prototype is now more consistent than | |
671 | before. Previously, a sub with multiple statements, all but the last | |
672 | optimised away, would be inlinable only if it were an anonymous sub | |
673 | containing a string C<eval> or C<state> declaration or closing over an | |
674 | outer lexical variable (or any anonymous sub under the debugger). Now any | |
675 | sub that gets folded to a single constant after statements have been | |
676 | optimised away is eligible for inlining. This applies to things like C<sub | |
677 | () { jabber() if DEBUG; 42 }>. | |
678 | ||
679 | Some subroutines with an explicit C<return> were being made inlinable, | |
680 | contrary to the documentation, Now C<return> always prevents inlining. | |
681 | ||
c7f058f0 FC |
682 | =item * |
683 | ||
684 | On some systems, such as VMS, C<crypt> can return a non-ASCII string. If a | |
685 | scalar assigned to had contained a UTF8 string previously, then C<crypt> | |
686 | would not turn off the UTF8 flag, thus corrupting the return value. This | |
687 | would happen with C<$lexical = crypt ...>. | |
688 | ||
86372193 | 689 | =back |
bb8c7e27 | 690 | |
86372193 | 691 | =head1 Known Problems |
bb8c7e27 | 692 | |
86372193 A |
693 | XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any |
694 | tests that had to be C<TODO>ed for the release would be noted here. Unfixed | |
695 | platform specific bugs also go here. | |
bb8c7e27 | 696 | |
86372193 | 697 | [ List each fix as a =item entry ] |
bb8c7e27 | 698 | |
86372193 | 699 | =over 4 |
bb8c7e27 | 700 | |
74f9f9ed A |
701 | =item * |
702 | ||
eacbb379 DD |
703 | Starting in 5.21.6, accessing L<perlapi/CvPADLIST> in an XSUB is forbidden. |
704 | CvPADLIST has be reused for a different internal purpose for XSUBs. Guard all | |
705 | CvPADLIST expressions with C<CvISXSUB()> if your code doesn't already block | |
706 | XSUB CV*s from going through optree CV* expecting code. | |
28a42920 | 707 | |
86372193 | 708 | =back |
28a42920 | 709 | |
86372193 | 710 | =head1 Errata From Previous Releases |
28a42920 | 711 | |
86372193 | 712 | =over 4 |
28a42920 A |
713 | |
714 | =item * | |
715 | ||
857f4fb1 FC |
716 | Due to a mistake in the string-copying logic, copying the value of a state |
717 | variable could instead steal the value and undefine the variable. This | |
718 | bug, introduced in 5.20, would happen mostly for long strings (1250 chars | |
719 | or more), but could happen for any strings under builds with copy-on-write | |
720 | disabled. [perl #123029] | |
721 | ||
722 | This bug was actually fixed in 5.21.5, but it was not until after that | |
723 | release that this bug, and the fact that it had been fixed, were | |
724 | discovered. | |
28a42920 | 725 | |
f5630681 FC |
726 | =item * |
727 | ||
728 | If a named sub tries to access a scalar declared in an outer anonymous sub, | |
729 | the variable is not available, so the named sub gets its own undefined | |
730 | scalar. In 5.10, attempts to take a reference to the variable | |
731 | (C<\$that_variable>) began returning a reference to a I<copy> of it | |
732 | instead. This was accidentally fixed in 5.21.4, but the bug and its fix | |
733 | were not noticed till now. | |
734 | ||
8c8d6154 | 735 | =back |
3a085d00 | 736 | |
86372193 | 737 | =head1 Obituary |
01d42a22 | 738 | |
86372193 A |
739 | XXX If any significant core contributor has died, we've added a short obituary |
740 | here. | |
01d42a22 | 741 | |
86372193 | 742 | =head1 Acknowledgements |
01d42a22 | 743 | |
86372193 | 744 | XXX Generate this with: |
01d42a22 | 745 | |
86372193 | 746 | perl Porting/acknowledgements.pl v5.21.5..HEAD |
f5b73711 | 747 | |
44691e6f AB |
748 | =head1 Reporting Bugs |
749 | ||
e08634c5 SH |
750 | If you find what you think is a bug, you might check the articles recently |
751 | posted to the comp.lang.perl.misc newsgroup and the perl bug database at | |
238894db | 752 | https://rt.perl.org/ . There may also be information at |
7ef8b31d | 753 | http://www.perl.org/ , the Perl Home Page. |
44691e6f | 754 | |
e08634c5 SH |
755 | If you believe you have an unreported bug, please run the L<perlbug> program |
756 | included with your release. Be sure to trim your bug down to a tiny but | |
757 | sufficient test case. Your bug report, along with the output of C<perl -V>, | |
758 | will be sent off to perlbug@perl.org to be analysed by the Perl porting team. | |
44691e6f AB |
759 | |
760 | If the bug you are reporting has security implications, which make it | |
e08634c5 SH |
761 | inappropriate to send to a publicly archived mailing list, then please send it |
762 | to perl5-security-report@perl.org. This points to a closed subscription | |
763 | unarchived mailing list, which includes all the core committers, who will be | |
764 | able to help assess the impact of issues, figure out a resolution, and help | |
f9001595 | 765 | co-ordinate the release of patches to mitigate or fix the problem across all |
e08634c5 SH |
766 | platforms on which Perl is supported. Please only use this address for |
767 | security issues in the Perl core, not for modules independently distributed on | |
768 | CPAN. | |
44691e6f AB |
769 | |
770 | =head1 SEE ALSO | |
771 | ||
e08634c5 SH |
772 | The F<Changes> file for an explanation of how to view exhaustive details on |
773 | what changed. | |
44691e6f AB |
774 | |
775 | The F<INSTALL> file for how to build Perl. | |
776 | ||
777 | The F<README> file for general stuff. | |
778 | ||
779 | The F<Artistic> and F<Copying> files for copyright information. | |
780 | ||
781 | =cut |