Commit | Line | Data |
---|---|---|
44691e6f AB |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
39c4a6cf | 5 | perldelta - what is new for perl v5.21.4 |
c68523cb | 6 | |
238894db | 7 | =head1 DESCRIPTION |
c68523cb | 8 | |
39c4a6cf | 9 | This document describes differences between the 5.21.3 release and the 5.21.4 |
238894db | 10 | release. |
c68523cb | 11 | |
39c4a6cf PM |
12 | If you are upgrading from an earlier release such as 5.21.2, first read |
13 | L<perl5213delta>, which describes differences between 5.21.2 and 5.21.3. | |
7065301c | 14 | |
39c4a6cf | 15 | =head1 Core Enhancements |
f88f10f5 | 16 | |
5b319db8 JH |
17 | =head2 Infinity and NaN (not-a-number) handling improved |
18 | ||
5cfa0642 SH |
19 | Floating point values are able to hold the special values infinity (also |
20 | -infinity), and NaN (not-a-number). Now we more robustly recognize and | |
21 | propagate the value in computations, and on output normalize them to C<Inf> and | |
22 | C<NaN>. | |
5b319db8 | 23 | |
019bf663 | 24 | See also the L<POSIX> enhancements. |
5b319db8 | 25 | |
13900f93 | 26 | =head1 Incompatible Changes |
8bdb3f93 | 27 | |
2b03450b FC |
28 | =head2 Changes to the C<*> prototype |
29 | ||
5cfa0642 SH |
30 | The C<*> character in a subroutine's prototype used to allow barewords to take |
31 | precedence over most, but not all subroutines. It was never consistent and | |
32 | exhibited buggy behaviour. | |
2b03450b | 33 | |
5cfa0642 SH |
34 | Now it has been changed, so subroutines always take precedence over barewords, |
35 | which brings it into conformity with similarly prototyped built-in functions: | |
2b03450b FC |
36 | |
37 | sub splat($) { ... } | |
38 | sub foo { ... } | |
39 | splat(foo); # now always splat(foo()) | |
40 | splat(bar); # still splat('bar') as before | |
41 | close(foo); # close(foo()) | |
42 | close(bar); # close('bar') | |
43 | ||
39c4a6cf | 44 | =head1 Performance Enhancements |
ff433f2d | 45 | |
39c4a6cf | 46 | =over 4 |
7d19f6a1 | 47 | |
7d19f6a1 PM |
48 | =item * |
49 | ||
5cfa0642 SH |
50 | Subroutines with an empty prototype and bodies containing just C<undef> are now |
51 | eligible for inlining. | |
8f5ad91b | 52 | L<[perl #122728]|https://rt.perl.org/Ticket/Display.html?id=122728> |
55e8b286 | 53 | |
07600c14 FC |
54 | =item * |
55 | ||
56 | Subroutines in packages no longer need to carry typeglobs around with them. | |
57 | Declaring a subroutine will now put a simple sub reference in the stash if | |
5cfa0642 SH |
58 | possible, saving memory. The typeglobs still notionally exist, so accessing |
59 | them will cause the subroutine reference to be upgraded to a typeglob. This | |
60 | optimization does not currently apply to XSUBs or exported subroutines, and | |
61 | method calls will undo it, since they cache things in typeglobs. | |
8f5ad91b | 62 | L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441> |
07600c14 | 63 | |
39c4a6cf | 64 | =back |
55e8b286 | 65 | |
39c4a6cf | 66 | =head1 Modules and Pragmata |
d99849ae | 67 | |
39c4a6cf | 68 | =head2 New Modules and Pragmata |
ff433f2d | 69 | |
39c4a6cf | 70 | =over 4 |
ff433f2d PM |
71 | |
72 | =item * | |
73 | ||
5cfa0642 SH |
74 | L<B::Op_private> provides detailed information about the flags used in the |
75 | C<op_private> field of perl opcodes. | |
0bb39c26 | 76 | |
39c4a6cf | 77 | =back |
0bb39c26 | 78 | |
39c4a6cf | 79 | =head2 Updated Modules and Pragmata |
9c97a342 | 80 | |
39c4a6cf | 81 | =over 4 |
d99849ae PM |
82 | |
83 | =item * | |
84 | ||
c37b2ad0 SH |
85 | L<Archive::Tar> has been upgraded from version 2.00 to 2.02. |
86 | ||
87 | Tests can now be run in parallel. | |
88 | ||
89 | =item * | |
90 | ||
8435afd1 SH |
91 | L<Attribute::Handlers> has been upgraded from version 0.96 to 0.97. |
92 | ||
5cfa0642 SH |
93 | Internal changes to account for the fact that subroutines in packages no longer |
94 | need to carry typeglobs around with them (see under L</Performance | |
95 | Enhancements>). | |
96 | ||
8435afd1 SH |
97 | =item * |
98 | ||
99 | L<attributes> has been upgraded from version 0.22 to 0.23. | |
100 | ||
5cfa0642 SH |
101 | The usage of C<memEQs> in the XS has been corrected. |
102 | L<[perl #122701]|https://rt.perl.org/Ticket/Display.html?id=122701> | |
103 | ||
8435afd1 SH |
104 | =item * |
105 | ||
07600c14 FC |
106 | L<B> has been upgraded from version 1.50 to 1.51. |
107 | ||
108 | It provides a new C<B::safename> function, based on the existing | |
109 | C<< B::GV->SAFENAME >>, that converts "\cOPEN" to "^OPEN". | |
6ab3666b | 110 | |
233a4069 JK |
111 | =item * |
112 | ||
d0ab07ee JK |
113 | L<B::Concise> has been upgraded from version 0.992 to 0.993. |
114 | ||
5cfa0642 SH |
115 | Internal changes to account for the fact that the defines and labels for the |
116 | flags in the C<op_private> field of OPs are now auto-generated (see under | |
117 | L</Internal Changes>). | |
118 | ||
608e531f SH |
119 | =item * |
120 | ||
65452717 FC |
121 | L<B::Deparse> has been upgraded from version 1.27 to 1.28. |
122 | ||
8435afd1 SH |
123 | It now deparses C<our(I<LIST>)> and typed lexical (C<my Dog $spot>) correctly. |
124 | ||
125 | =item * | |
126 | ||
127 | L<bignum> has been upgraded from version 0.37 to 0.38. | |
128 | ||
5cfa0642 SH |
129 | An C<eval BLOCK> rather than an C<eval EXPR> is now used to see if we can find |
130 | Math::BigInt::Lite. | |
131 | ||
8435afd1 SH |
132 | =item * |
133 | ||
134 | L<constant> has been upgraded from version 1.31 to 1.32. | |
135 | ||
136 | It now accepts fully-qualified constant names, allowing constants to be defined | |
137 | in packages other than the caller. | |
65452717 FC |
138 | |
139 | =item * | |
140 | ||
608e531f | 141 | L<CPAN::Meta::Requirements> has been upgraded from version 2.126 to 2.128. |
74d5bfab | 142 | |
5cfa0642 SH |
143 | Works around limitations in version::vpp detecting v-string magic and adds |
144 | support for forthcoming L<ExtUtils::MakeMaker> bootstrap F<version.pm> for | |
145 | Perls older than 5.10.0. | |
146 | ||
74d5bfab | 147 | =item * |
5c31a0ca SH |
148 | |
149 | L<Data::Dumper> has been upgraded from version 2.152 to 2.154. | |
150 | ||
5cfa0642 SH |
151 | Fixes CVE-2014-4330 by adding a configuration variable/option to limit |
152 | recursion when dumping deep data structures. | |
153 | ||
5c31a0ca | 154 | =item * |
74d5bfab | 155 | |
8435afd1 SH |
156 | L<experimental> has been upgraded from version 0.008 to 0.010. |
157 | ||
5cfa0642 SH |
158 | Hardcodes features for Perls older than 5.15.7. |
159 | ||
8435afd1 SH |
160 | =item * |
161 | ||
162 | L<ExtUtils::CBuilder> has been upgraded from version 0.280217 to 0.280219. | |
5cfa0642 SH |
163 | |
164 | Fixes a regression on Android. | |
8f5ad91b | 165 | L<[perl #122675]|https://rt.perl.org/Ticket/Display.html?id=122675> |
74d5bfab | 166 | |
d0ab07ee JK |
167 | =item * |
168 | ||
8435afd1 | 169 | L<ExtUtils::Install> has been upgraded from version 1.68 to 2.04. |
39091b75 | 170 | |
5cfa0642 SH |
171 | No changes to installed files other than version bumps. |
172 | ||
39091b75 JK |
173 | =item * |
174 | ||
8435afd1 | 175 | L<ExtUtils::Manifest> has been upgraded from version 1.65 to 1.68. |
5cfa0642 SH |
176 | |
177 | Fixes a bug with C<maniread()>'s handling of quoted filenames and improves | |
178 | C<manifind()> to follow symlinks. | |
8f5ad91b | 179 | L<[perl #122415]|https://rt.perl.org/Ticket/Display.html?id=122415> |
ecd53122 JK |
180 | |
181 | =item * | |
182 | ||
9eace98c JK |
183 | L<File::Find> has been upgraded from version 1.27 to 1.28. |
184 | ||
185 | C<find()> and C<finddepth()> will now warn if passed inappropriate or | |
186 | misspelled options. | |
187 | ||
188 | =item * | |
189 | ||
190 | L<Getopt::Std> has been upgraded from version 1.10 to 1.11. | |
191 | ||
5cfa0642 SH |
192 | Corrects a typo in the documentation. |
193 | ||
9eace98c JK |
194 | =item * |
195 | ||
8435afd1 | 196 | L<HTTP::Tiny> has been upgraded from version 0.047 to 0.049. |
d0ab07ee | 197 | |
5cfa0642 SH |
198 | C<keep_alive> is now fork-safe and thread-safe. |
199 | ||
d0ab07ee JK |
200 | =item * |
201 | ||
8435afd1 | 202 | L<IO> has been upgraded from version 1.33 to 1.34. |
d0ab07ee | 203 | |
5cfa0642 SH |
204 | The XS implementation has been fixed for the sake of older Perls. |
205 | ||
d0ab07ee JK |
206 | =item * |
207 | ||
8435afd1 SH |
208 | L<IO::Socket::IP> has been upgraded from version 0.31 to 0.32. |
209 | ||
5cfa0642 SH |
210 | Implements Timeout for C<connect()>. |
211 | L<[cpan #92075]|https://rt.cpan.org/Ticket/Display.html?id=92075> | |
212 | ||
8435afd1 | 213 | =item * |
d0ab07ee | 214 | |
8435afd1 | 215 | L<Locale::Codes> has been upgraded from version 3.31 to 3.32. |
316ab8c6 | 216 | |
5cfa0642 SH |
217 | New codes have been added. |
218 | ||
316ab8c6 SH |
219 | =item * |
220 | ||
221 | L<Math::BigInt> has been upgraded from version 1.9996 to 1.9997. | |
8435afd1 | 222 | |
5cfa0642 SH |
223 | The documentation now gives test examples using L<Test::More> rather than |
224 | L<Test>. | |
225 | ||
8435afd1 SH |
226 | =item * |
227 | ||
50e7b15e | 228 | L<Module::CoreList> has been upgraded from version 5.021003 to 5.20140920. |
8435afd1 | 229 | |
5cfa0642 SH |
230 | Updated to cover the latest releases of Perl. |
231 | ||
8435afd1 SH |
232 | =item * |
233 | ||
234 | L<overload> has been upgraded from version 1.22 to 1.23. | |
235 | ||
5cfa0642 SH |
236 | A redundant C<ref $sub> check has been removed. |
237 | ||
8435afd1 SH |
238 | =item * |
239 | ||
240 | PathTools has been upgraded from version 3.49 to 3.50. | |
5b319db8 | 241 | |
5cfa0642 SH |
242 | A warning from the B<gcc> compiler is now avoided when building the XS. |
243 | ||
d0ab07ee JK |
244 | =item * |
245 | ||
246 | L<Pod::Perldoc> has been upgraded from version 3.23 to 3.24. | |
247 | ||
5cfa0642 SH |
248 | Filehandles opened for reading or writing now have C<:encoding(UTF-8)> set. |
249 | L<[cpan #98019]|https://rt.cpan.org/Ticket/Display.html?id=98019> | |
250 | ||
d0ab07ee JK |
251 | =item * |
252 | ||
8435afd1 SH |
253 | L<POSIX> has been upgraded from version 1.42 to 1.43. |
254 | ||
5cfa0642 SH |
255 | The C99 math functions and constants (for example acosh, isinf, isnan, round, |
256 | trunc; M_E, M_SQRT2, M_PI) have been added. | |
46274848 SH |
257 | |
258 | =item * | |
259 | ||
8435afd1 | 260 | Scalar-List-Utils has been upgraded from version 1.39 to 1.41. |
d0ab07ee | 261 | |
5cfa0642 SH |
262 | A new module, L<Sub::Util>, has been added, containing functions related to |
263 | CODE refs, including C<subname> (inspired by Sub::Identity) and C<set_subname> | |
264 | (copied and renamed from Sub::Name). | |
265 | ||
266 | The use of C<GetMagic> in C<List::Util::reduce()> has also been fixed. | |
267 | L<[cpan #63211]|https://rt.cpan.org/Ticket/Display.html?id=63211> | |
268 | ||
8435afd1 SH |
269 | =item * |
270 | ||
271 | L<Term::ReadLine> has been upgraded from version 1.14 to 1.15. | |
272 | ||
5cfa0642 SH |
273 | Faster checks are now made first in some if-statements. |
274 | ||
8435afd1 SH |
275 | =item * |
276 | ||
277 | L<Test::Harness> has been upgraded from version 3.32 to 3.33. | |
278 | ||
5cfa0642 SH |
279 | Various documentation fixes. |
280 | ||
8435afd1 SH |
281 | =item * |
282 | ||
283 | L<Test::Simple> has been upgraded from version 1.001003 to 1.001006. | |
bfc60ea2 | 284 | |
5cfa0642 SH |
285 | Various documentation fixes. |
286 | ||
d0ab07ee JK |
287 | =item * |
288 | ||
289 | L<threads> has been upgraded from version 1.95 to 1.96. | |
290 | ||
5cfa0642 SH |
291 | No changes to installed files other than version bumps. |
292 | ||
8435afd1 SH |
293 | =item * |
294 | ||
295 | L<Time::Piece> has been upgraded from version 1.27 to 1.29. | |
296 | ||
5cfa0642 SH |
297 | When pretty printing negative Time::Seconds, the "minus" is no longer lost. |
298 | ||
8435afd1 SH |
299 | =item * |
300 | ||
301 | L<version> has been upgraded from version 0.9908 to 0.9909. | |
302 | ||
5cfa0642 SH |
303 | Numerous changes. See the F<Changes> file in the CPAN distribution for |
304 | details. | |
305 | ||
39c4a6cf | 306 | =back |
9c97a342 | 307 | |
5cfa0642 SH |
308 | =head1 Documentation |
309 | ||
310 | =head2 Changes to Existing Documentation | |
311 | ||
312 | =head3 L<perlfunc> | |
d99849ae | 313 | |
39c4a6cf | 314 | =over 4 |
d99849ae | 315 | |
ff433f2d PM |
316 | =item * |
317 | ||
5cfa0642 SH |
318 | Calling C<delete> or C<exists> on array values is now described as "strongly |
319 | discouraged" rather than "deprecated". | |
ff433f2d | 320 | |
13900f93 | 321 | =back |
aac7f82f | 322 | |
5cfa0642 | 323 | =head3 L<perlpolicy> |
aac7f82f | 324 | |
5cfa0642 | 325 | =over 4 |
6d9b7c7c | 326 | |
5cfa0642 | 327 | =item * |
2a395b86 | 328 | |
5cfa0642 SH |
329 | The conditions for marking an experimental feature as non-experimental are now |
330 | set out. | |
2a395b86 | 331 | |
5cfa0642 | 332 | =back |
2a395b86 | 333 | |
5cfa0642 | 334 | =head3 L<perlrecharclass> |
2a395b86 | 335 | |
5cfa0642 SH |
336 | =over 4 |
337 | ||
338 | =item * | |
2a395b86 | 339 | |
5cfa0642 SH |
340 | The documentation of Bracketed Character Classes has been expanded to cover the |
341 | improvements in C<qr/[\N{named sequence}]/> (see under L</Selected Bug Fixes>). | |
342 | ||
343 | =back | |
39c4a6cf | 344 | |
8435afd1 | 345 | =head3 L<perlsyn> |
2a395b86 PM |
346 | |
347 | =over 4 | |
348 | ||
349 | =item * | |
350 | ||
5cfa0642 | 351 | An ambiguity in the documentation of the Ellipsis statement has been corrected. |
8f5ad91b | 352 | L<[perl #122661]|https://rt.perl.org/Ticket/Display.html?id=122661> |
8435afd1 SH |
353 | |
354 | =back | |
355 | ||
356 | =head3 L<perlxs> | |
357 | ||
358 | =over 4 | |
2a395b86 | 359 | |
12d22d1f JK |
360 | =item * |
361 | ||
8435afd1 | 362 | Added a discussion of locale issues in XS code. |
12d22d1f | 363 | |
2a395b86 PM |
364 | =back |
365 | ||
39c4a6cf | 366 | =head1 Diagnostics |
2a395b86 | 367 | |
39c4a6cf PM |
368 | The following additions or changes have been made to diagnostic output, |
369 | including warnings and fatal error messages. For the complete list of | |
370 | diagnostic messages, see L<perldiag>. | |
2a395b86 | 371 | |
39c4a6cf | 372 | =head2 New Diagnostics |
0f4a583b | 373 | |
5cfa0642 | 374 | =head3 New Warnings |
2a395b86 PM |
375 | |
376 | =over 4 | |
377 | ||
378 | =item * | |
379 | ||
5cfa0642 | 380 | L<Character in 'C' format overflow in pack|perldiag/"Character in 'C' format overflow in pack"> |
2a395b86 | 381 | |
5cfa0642 SH |
382 | (W pack) You tried converting an infinity or not-a-number to an unsigned |
383 | character, which makes no sense. Perl behaved as if you tried to pack 0xFF. | |
2a395b86 | 384 | |
5cfa0642 | 385 | =item * |
2a395b86 | 386 | |
5cfa0642 SH |
387 | L<Character in 'c' format overflow in pack|perldiag/"Character in 'c' format overflow in pack"> |
388 | ||
389 | (W pack) You tried converting an infinity or not-a-number to a signed | |
390 | character, which makes no sense. Perl behaved as if you tried to pack 0xFF. | |
2a395b86 PM |
391 | |
392 | =item * | |
393 | ||
5cfa0642 SH |
394 | L<Invalid number (%f) in chr|perldiag/"Invalid number (%f) in chr"> |
395 | ||
396 | (W utf8) You passed an invalid number (like an infinity or not-a-number) to | |
397 | C<chr>. Those are not valid character numbers, so it returned the Unicode | |
398 | replacement character (U+FFFD). | |
2a395b86 PM |
399 | |
400 | =back | |
6d9b7c7c | 401 | |
39c4a6cf PM |
402 | =head2 Changes to Existing Diagnostics |
403 | ||
13900f93 | 404 | =over 4 |
7f55cec0 SH |
405 | |
406 | =item * | |
407 | ||
5cfa0642 | 408 | L<Global symbol "%s" requires explicit package name|perldiag/"Global symbol "%s" requires explicit package name (did you forget to declare "my %s"?)"> |
623141a1 | 409 | |
5cfa0642 SH |
410 | This message has had '(did you forget to declare "my %s"?)' appended to it, to |
411 | make it more helpful to new Perl programmers. | |
4c9184fd | 412 | L<[perl #121638]|https://rt.perl.org/Ticket/Display.html?id=121638> |
aac7f82f | 413 | |
363d3025 FC |
414 | =item * |
415 | ||
5cfa0642 | 416 | L<\N{} in character class restricted to one character in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"\N{} in inverted character class or as a range end-point is restricted to one character in regex; marked by S<<-- HERE> in m/%s/"> |
334464b3 | 417 | |
5cfa0642 SH |
418 | This message has had 'character class' changed to 'inverted character class or |
419 | as a range end-point is' to reflect improvements in C<qr/[\N{named sequence}]/> | |
420 | (see under L</Selected Bug Fixes>). | |
334464b3 FC |
421 | |
422 | =item * | |
423 | ||
5cfa0642 | 424 | L<panic: frexp|perldiag/"panic: frexp: %f"> |
363d3025 | 425 | |
5cfa0642 SH |
426 | This message has had ': %f' appended to it, to show what the offending floating |
427 | point number is. | |
ef5a9509 | 428 | |
363d3025 FC |
429 | =back |
430 | ||
5cfa0642 | 431 | =head2 Diagnostic Removals |
4594cf53 | 432 | |
13900f93 | 433 | =over 4 |
96dcbc37 DD |
434 | |
435 | =item * | |
436 | ||
5cfa0642 | 437 | "Constant is not a FOO reference" |
13900f93 | 438 | |
5cfa0642 SH |
439 | Compile-time checking of constant dereferencing (e.g., C<< my_constant->() >>) |
440 | has been removed, since it was not taking overloading into account. | |
441 | L<[perl #69456]|https://rt.perl.org/Ticket/Display.html?id=69456> | |
442 | L<[perl #122607]|https://rt.perl.org/Ticket/Display.html?id=122607> | |
58f25ac1 MH |
443 | |
444 | =item * | |
445 | ||
5cfa0642 SH |
446 | "Ambiguous use of -foo resolved as -&foo()" |
447 | ||
448 | There is actually no ambiguity here, and this impedes the use of negated | |
449 | constants; e.g., C<-Inf>. | |
a5873648 | 450 | |
39c4a6cf | 451 | =back |
a5873648 | 452 | |
55ba8847 JH |
453 | =head1 Configuration and Compilation |
454 | ||
c0c55a9b SH |
455 | =over 4 |
456 | ||
457 | =item * | |
458 | ||
459 | For long doubles (to get more precision and range for floating point numbers) | |
460 | one can now use the GCC quadmath library which implements the quadruple | |
461 | precision floating point numbers in x86 and ia64 platforms. See F<INSTALL> for | |
462 | details. | |
463 | ||
464 | =back | |
55ba8847 | 465 | |
39c4a6cf | 466 | =head1 Testing |
a5873648 | 467 | |
39c4a6cf | 468 | =over 4 |
a5873648 PM |
469 | |
470 | =item * | |
471 | ||
5cfa0642 SH |
472 | A new test script, F<op/infnan.t>, has been added to test if Inf and NaN are |
473 | working correctly. See L</Infinity and NaN (not-a-number) handling improved>. | |
b3211734 | 474 | |
5cfa0642 | 475 | =item * |
6e97d65d | 476 | |
5cfa0642 SH |
477 | A new test script, F<re/rt122747.t>, has been added to test that the fix for |
478 | L<perl #122747|https://rt.perl.org/Ticket/Display.html?id=122747> is working. | |
7d0ccdba | 479 | |
7065301c RS |
480 | =back |
481 | ||
482 | =head1 Internal Changes | |
483 | ||
39c4a6cf | 484 | =over 4 |
c1284011 | 485 | |
6d67525d FC |
486 | =item * |
487 | ||
5cfa0642 | 488 | C<save_re_context> no longer does anything and has been moved to F<mathoms.c>. |
1c43698b | 489 | |
07600c14 FC |
490 | =item * |
491 | ||
5cfa0642 SH |
492 | C<cv_name> is a new API function that can be passed a CV or GV. It returns an |
493 | SV containing the name of the subroutine for use in diagnostics. | |
8f5ad91b SH |
494 | L<[perl #116735]|https://rt.perl.org/Ticket/Display.html?id=116735> |
495 | L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441> | |
07600c14 FC |
496 | |
497 | =item * | |
498 | ||
499 | C<cv_set_call_checker_flags> is a new API function that works like | |
5cfa0642 SH |
500 | C<cv_set_call_checker>, except that it allows the caller to specify whether the |
501 | call checker requires a full GV for reporting the subroutine's name, or whether | |
502 | it could be passed a CV instead. Whatever value is passed will be acceptable | |
503 | to C<cv_name>. C<cv_set_call_checker> guarantees there will be a GV, but it | |
504 | may have to create one on the fly, which is inefficient. | |
8f5ad91b | 505 | L<[perl #116735]|https://rt.perl.org/Ticket/Display.html?id=116735> |
07600c14 FC |
506 | |
507 | =item * | |
508 | ||
5cfa0642 SH |
509 | C<CvGV> (which is not part of the API) is now a more complex macro, which may |
510 | call a function and reify a GV. For those cases where is has been used as a | |
511 | boolean, C<CvHASGV> has been added, which will return true for CVs that | |
512 | notionally have GVs, but without reifying the GV. C<CvGV> also returns a GV | |
513 | now for lexical subs. | |
8f5ad91b | 514 | L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441> |
07600c14 | 515 | |
8435afd1 SH |
516 | =item * |
517 | ||
5cfa0642 SH |
518 | Added L<perlapi/sync_locale>. Changing the program's locale should be avoided |
519 | by XS code. Nevertheless, certain non-Perl libraries called from XS, such as | |
520 | C<Gtk> do so. When this happens, Perl needs to be told that the locale has | |
521 | changed. Use this function to do so, before returning to Perl. | |
8435afd1 | 522 | |
d72cd2eb DM |
523 | =item * |
524 | ||
5cfa0642 SH |
525 | The defines and labels for the flags in the C<op_private> field of OPs are now |
526 | auto-generated from data in F<regen/op_private>. The noticeable effect of this | |
527 | is that some of the flag output of C<Concise> might differ slightly, and the | |
528 | flag output of C<perl -Dx> may differ considerably (they both use the same set | |
529 | of labels now). Also in debugging builds, there is a new assert in | |
530 | C<op_free()> that checks that the op doesn't have any unrecognized flags set in | |
531 | C<op_private>. | |
d72cd2eb | 532 | |
6d9b7c7c | 533 | =back |
c1284011 | 534 | |
6d9b7c7c | 535 | =head1 Selected Bug Fixes |
375f5f06 | 536 | |
0346c3a9 | 537 | =over 4 |
375f5f06 | 538 | |
2884baee MH |
539 | =item * |
540 | ||
5cfa0642 SH |
541 | Constant dereferencing now works correctly for typeglob constants. Previously |
542 | the glob was stringified and its name looked up. Now the glob itself is used. | |
8f5ad91b | 543 | L<[perl #69456]|https://rt.perl.org/Ticket/Display.html?id=69456> |
6f1a844b | 544 | |
549ea8d4 FC |
545 | =item * |
546 | ||
547 | When parsing a funny character ($ @ % &) followed by braces, the parser no | |
5cfa0642 SH |
548 | longer tries to guess whether it is a block or a hash constructor (causing a |
549 | syntax error when it guesses the latter), since it can only be a block. | |
549ea8d4 | 550 | |
be0006e0 FC |
551 | =item * |
552 | ||
5cfa0642 SH |
553 | C<undef $reference> now frees the referent immediately, instead of hanging on |
554 | to it until the next statement. | |
8f5ad91b | 555 | L<[perl #122556]|https://rt.perl.org/Ticket/Display.html?id=122556> |
be0006e0 | 556 | |
1699f5c2 FC |
557 | =item * |
558 | ||
559 | Various cases where the name of a sub is used (autoload, overloading, error | |
560 | messages) used to crash for lexical subs, but have been fixed. | |
561 | ||
7e8b2071 FC |
562 | =item * |
563 | ||
564 | Bareword lookup now tries to avoid vivifying packages if it turns out the | |
565 | bareword is not going to be a subroutine name. | |
566 | ||
f9acf899 FC |
567 | =item * |
568 | ||
5cfa0642 SH |
569 | Compilation of anonymous constants (e.g., C<sub () { 3 }>) no longer deletes |
570 | any subroutine named C<__ANON__> in the current package. Not only was | |
571 | C<*__ANON__{CODE}> cleared, but there was a memory leak, too. This bug goes | |
572 | back to Perl 5.8.0. | |
f9acf899 | 573 | |
fd26b6f0 FC |
574 | =item * |
575 | ||
5cfa0642 SH |
576 | Stub declarations like C<sub f;> and C<sub f ();> no longer wipe out constants |
577 | of the same name declared by C<use constant>. This bug was introduced in Perl | |
578 | 5.10.0. | |
fd26b6f0 | 579 | |
499333dc KW |
580 | =item * |
581 | ||
5cfa0642 SH |
582 | Under some conditions a warning raised in compilation of regular expression |
583 | patterns could be displayed multiple times. This is now fixed. | |
499333dc | 584 | |
8f0cd35a KW |
585 | =item * |
586 | ||
5cfa0642 SH |
587 | C<qr/[\N{named sequence}]/> now works properly in many instances. Some names |
588 | known to C<\N{...}> refer to a sequence of multiple characters, instead of the | |
589 | usual single character. Bracketed character classes generally only match | |
590 | single characters, but now special handling has been added so that they can | |
591 | match named sequences, but not if the class is inverted or the sequence is | |
592 | specified as the beginning or end of a range. In these cases, the only | |
593 | behavior change from before is a slight rewording of the fatal error message | |
594 | given when this class is part of a C<?[...])> construct. When the C<[...]> | |
595 | stands alone, the same non-fatal warning as before is raised, and only the | |
596 | first character in the sequence is used, again just as before. | |
8f0cd35a | 597 | |
aa292ef2 FC |
598 | =item * |
599 | ||
600 | Tainted constants evaluated at compile time no longer cause unrelated | |
8f5ad91b SH |
601 | statements to become tainted. |
602 | L<[perl #122669]|https://rt.perl.org/Ticket/Display.html?id=122669> | |
aa292ef2 | 603 | |
739e9bee FC |
604 | =item * |
605 | ||
5cfa0642 SH |
606 | C<open $$fh, ...>, which vivifies a handle with a name like "main::_GEN_0", was |
607 | not giving the handle the right reference count, so a double free could happen. | |
739e9bee | 608 | |
b23b2fdb FC |
609 | =item * |
610 | ||
5cfa0642 SH |
611 | When deciding that a bareword was a method name, the parser would get confused |
612 | if an "our" sub with the same name existed, and look up the method in the | |
613 | package of the "our" sub, instead of the package of the invocant. | |
b23b2fdb | 614 | |
7d15b1a8 FC |
615 | =item * |
616 | ||
5cfa0642 SH |
617 | The parser no longer gets confused by C<\U=> within a double-quoted string. It |
618 | used to produce a syntax error, but now compiles it correctly. | |
8f5ad91b | 619 | L<[perl #80368]|https://rt.perl.org/Ticket/Display.html?id=80368> |
7d15b1a8 | 620 | |
bbca64cf KW |
621 | =item * |
622 | ||
5cfa0642 SH |
623 | It has always been the intention for the C<-B> and C<-T> file test operators to |
624 | treat UTF-8 encoded files as text. (L<perlfunc|perlfunc/-X FILEHANDLE> has | |
625 | been updated to say this.) Previously, it was possible for some files to be | |
626 | considered UTF-8 that actually weren't valid UTF-8. This is now fixed. The | |
627 | operators now work on EBCDIC platforms as well. | |
bbca64cf | 628 | |
0064f8cc KW |
629 | =item * |
630 | ||
5cfa0642 SH |
631 | Under some conditions warning messages raised during regular expression pattern |
632 | compilation were being output more than once. This has now been fixed. | |
0064f8cc | 633 | |
6ff8f256 KW |
634 | =item * |
635 | ||
5cfa0642 SH |
636 | A regression has been fixed that was introduced in Perl 5.20.0 (fixed in Perl |
637 | 5.20.1 as well as here) in which a UTF-8 encoded regular expression pattern | |
638 | that contains a single ASCII lowercase letter does not match its uppercase | |
639 | counterpart. | |
8f5ad91b | 640 | L<[perl #122655]|https://rt.perl.org/Ticket/Display.html?id=122655> |
6ff8f256 | 641 | |
80cc3290 FC |
642 | =item * |
643 | ||
5cfa0642 SH |
644 | Constant folding could incorrectly suppress warnings if lexical warnings (C<use |
645 | warnings> or C<no warnings>) were not in effect and C<$^W> were false at | |
646 | compile time and true at run time. | |
80cc3290 | 647 | |
13dd5671 FC |
648 | =item * |
649 | ||
650 | Loading UTF8 tables during a regular expression match could cause assertion | |
651 | failures under debugging builds if the previous match used the very same | |
8f5ad91b SH |
652 | regular expression. |
653 | L<[perl #122747]|https://rt.perl.org/Ticket/Display.html?id=122747> | |
13dd5671 | 654 | |
bdab7676 FC |
655 | =item * |
656 | ||
657 | Thread cloning used to work incorrectly for lexical subs, possibly causing | |
658 | crashes or double frees on exit. | |
659 | ||
3a085d00 FC |
660 | =item * |
661 | ||
5cfa0642 SH |
662 | Since Perl 5.14.0, deleting C<$SomePackage::{__ANON__}> and then undefining an |
663 | anonymous subroutine could corrupt things internally, resulting in | |
664 | L<Devel::Peek> crashing or L<B.pm|B> giving nonsensical data. This has been | |
665 | fixed. | |
3a085d00 | 666 | |
caa66803 FC |
667 | =item * |
668 | ||
5cfa0642 SH |
669 | C<(caller $n)[3]> now reports names of lexical subs, instead of treating them |
670 | as "(unknown)". | |
caa66803 | 671 | |
91766151 FC |
672 | =item * |
673 | ||
674 | C<sort subname LIST> now supports lexical subs for the comparison routine. | |
675 | ||
dd593f1d FC |
676 | =item * |
677 | ||
5cfa0642 SH |
678 | Aliasing (e.g., via C<*x = *y>) could confuse list assignments that mention the |
679 | two names for the same variable on either side, causing wrong values to be | |
680 | assigned. | |
4c9184fd | 681 | L<[perl #15667]|https://rt.perl.org/Ticket/Display.html?id=15667> |
dd593f1d | 682 | |
fb3b7425 FC |
683 | =item * |
684 | ||
5cfa0642 SH |
685 | Long here-doc terminators could cause a bad read on short lines of input. This |
686 | has been fixed. It is doubtful that any crash could have occurred. This bug | |
687 | goes back to when here-docs were introduced in Perl 3.000 twenty-five years | |
688 | ago. | |
fb3b7425 | 689 | |
b245455d SH |
690 | =item * |
691 | ||
692 | An optimization in C<split> to treat C<split/^/> like C<split/^/m> had the | |
693 | unfortunate side-effect of also treating C<split/\A/> like C<split/^/m>, which | |
694 | it should not. This has been fixed. (Note, however, that C<split/^x/> does | |
695 | not behave like C<split/^x/m>, which is also considered to be a bug and will be | |
696 | fixed in a future version.) | |
697 | L<[perl #122761]|https://rt.perl.org/Ticket/Display.html?id=122761> | |
698 | ||
26dd5fd6 PM |
699 | =item * |
700 | ||
5cfa0642 SH |
701 | The little-known C<my Class $var> syntax (see L<fields> and L<attributes>) |
702 | could get confused in the scope of C<use utf8> if C<Class> were a constant | |
703 | whose value contained Latin-1 characters. | |
ff433f2d | 704 | |
39c4a6cf PM |
705 | =back |
706 | ||
39c4a6cf | 707 | =head1 Acknowledgements |
ff433f2d | 708 | |
c0c55a9b SH |
709 | Perl 5.21.4 represents approximately 4 weeks of development since Perl 5.21.3 |
710 | and contains approximately 29,000 lines of changes across 520 files from 30 | |
711 | authors. | |
712 | ||
713 | Excluding auto-generated files, documentation and release tools, there were | |
714 | approximately 15,000 lines of changes to 390 .pm, .t, .c and .h files. | |
715 | ||
716 | Perl continues to flourish into its third decade thanks to a vibrant community | |
717 | of users and developers. The following people are known to have contributed | |
718 | the improvements that became Perl 5.21.4: | |
719 | ||
720 | Alberto Simões, Alexandre (Midnite) Jousset, Andy Dougherty, Anthony Heading, | |
721 | Brian Fraser, Chris 'BinGOs' Williams, Craig A. Berry, Daniel Dragan, David | |
722 | Mitchell, Doug Bell, Father Chrysostomos, George Greer, H.Merijn Brand, James E | |
723 | Keenan, Jarkko Hietaniemi, Jerry D. Hedden, Karen Etheridge, Karl Williamson, | |
724 | Olivier Mengué, Peter Martini, Reini Urban, Ricardo Signes, Steffen Müller, | |
725 | Steve Hay, Sullivan Beck, syber, Tadeusz Sośnierz, Tony Cook, Yves Orton, | |
726 | Ævar Arnfjörð Bjarmason. | |
727 | ||
728 | The list above is almost certainly incomplete as it is automatically generated | |
729 | from version control history. In particular, it does not include the names of | |
730 | the (very much appreciated) contributors who reported issues to the Perl bug | |
731 | tracker. | |
732 | ||
733 | Many of the changes included in this version originated in the CPAN modules | |
734 | included in Perl's core. We're grateful to the entire CPAN community for | |
735 | helping Perl to flourish. | |
e831f11a | 736 | |
c0c55a9b SH |
737 | For a more complete list of all of Perl's historical contributors, please see |
738 | the F<AUTHORS> file in the Perl source distribution. | |
f5b73711 | 739 | |
44691e6f AB |
740 | =head1 Reporting Bugs |
741 | ||
e08634c5 SH |
742 | If you find what you think is a bug, you might check the articles recently |
743 | posted to the comp.lang.perl.misc newsgroup and the perl bug database at | |
238894db | 744 | https://rt.perl.org/ . There may also be information at |
7ef8b31d | 745 | http://www.perl.org/ , the Perl Home Page. |
44691e6f | 746 | |
e08634c5 SH |
747 | If you believe you have an unreported bug, please run the L<perlbug> program |
748 | included with your release. Be sure to trim your bug down to a tiny but | |
749 | sufficient test case. Your bug report, along with the output of C<perl -V>, | |
750 | will be sent off to perlbug@perl.org to be analysed by the Perl porting team. | |
44691e6f AB |
751 | |
752 | If the bug you are reporting has security implications, which make it | |
e08634c5 SH |
753 | inappropriate to send to a publicly archived mailing list, then please send it |
754 | to perl5-security-report@perl.org. This points to a closed subscription | |
755 | unarchived mailing list, which includes all the core committers, who will be | |
756 | able to help assess the impact of issues, figure out a resolution, and help | |
f9001595 | 757 | co-ordinate the release of patches to mitigate or fix the problem across all |
e08634c5 SH |
758 | platforms on which Perl is supported. Please only use this address for |
759 | security issues in the Perl core, not for modules independently distributed on | |
760 | CPAN. | |
44691e6f AB |
761 | |
762 | =head1 SEE ALSO | |
763 | ||
e08634c5 SH |
764 | The F<Changes> file for an explanation of how to view exhaustive details on |
765 | what changed. | |
44691e6f AB |
766 | |
767 | The F<INSTALL> file for how to build Perl. | |
768 | ||
769 | The F<README> file for general stuff. | |
770 | ||
771 | The F<Artistic> and F<Copying> files for copyright information. | |
772 | ||
773 | =cut |