Commit | Line | Data |
---|---|---|
44691e6f AB |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
7065301c | 5 | perldelta - what is new for perl v5.21.1 |
c68523cb | 6 | |
238894db | 7 | =head1 DESCRIPTION |
c68523cb | 8 | |
7065301c | 9 | This document describes differences between the 5.21.0 release and the 5.21.1 |
238894db | 10 | release. |
c68523cb | 11 | |
7065301c RS |
12 | If you are upgrading from an earlier release such as 5.20.0, first read |
13 | L<perl5210delta>, which describes differences between 5.20.0 and 5.21.0. | |
14 | ||
15 | =head1 Notice | |
16 | ||
081463c3 MH |
17 | This release removes a number of previously deprecated constructs, many |
18 | that have been around for a long time. Please see L</"Incompatible Changes"> | |
19 | for more information. | |
7065301c RS |
20 | |
21 | =head1 Core Enhancements | |
22 | ||
09edd811 KW |
23 | =head2 Unicode 7.0 is now supported |
24 | ||
25 | For details on what is in this release, see | |
26 | L<http://www.unicode.org/versions/Unicode7.0.0/>. | |
27 | ||
7e957246 MH |
28 | =head2 Experimental C Backtrace API |
29 | ||
30 | Starting from Perl 5.21.1, on some platforms Perl supports retrieving | |
31 | the C level backtrace (similar to what symbolic debuggers like gdb do). | |
32 | ||
33 | The backtrace returns the stack trace of the C call frames, | |
34 | with the symbol names (function names), the object names (like "perl"), | |
35 | and if it can, also the source code locations (file:line). | |
36 | ||
37 | The supported platforms are Linux and OS X (some *BSD might work at | |
38 | least partly, but they have not yet been tested). | |
39 | ||
40 | The feature needs to be enabled with C<Configure -Dusecbacktrace>. | |
41 | ||
42 | Also included is a C API to retrieve backtraces. | |
43 | ||
44 | See L<perlhacktips/"C backtrace"> for more information. | |
45 | ||
8373491a KW |
46 | =head2 C<qr/foo/x> now ignores any Unicode pattern white space |
47 | ||
48 | The C</x> regular expression modifier allows the pattern to contain | |
49 | white space and comments, both of which are ignored, for improved | |
50 | readability. Until now, not all the white space characters that Unicode | |
51 | designates for this purpose were handled. The additional ones now | |
52 | recognized are | |
53 | U+0085 NEXT LINE, | |
54 | U+200E LEFT-TO-RIGHT MARK, | |
55 | U+200F RIGHT-TO-LEFT MARK, | |
56 | U+2028 LINE SEPARATOR, | |
57 | and | |
58 | U+2029 PARAGRAPH SEPARATOR. | |
59 | ||
d6ded950 KW |
60 | =head2 S<C<use locale>> can restrict which locale categories are affected |
61 | ||
62 | It is now possible to pass a parameter to S<C<use locale>> to specify | |
63 | a subset of locale categories to be locale-aware, with the remaining | |
64 | ones unaffected. See L<perllocale/The "use locale" pragma> for details. | |
65 | ||
7065301c RS |
66 | =head1 Incompatible Changes |
67 | ||
98b7895c MH |
68 | =head2 C<\N{}> with a sequence of multiple spaces is now a fatal error. |
69 | ||
70 | This has been deprecated since v5.18. | |
71 | ||
7357bd17 KW |
72 | =head2 In double-quotish C<\cI<X>>, I<X> must now be a printable ASCII character |
73 | ||
74 | In prior releases, failure to do this raised a deprecation warning. | |
7065301c | 75 | |
cd209d9d KW |
76 | =head2 Splitting the tokens C<(?> and C<(*> in regular expressions is |
77 | now a fatal compilation error. | |
78 | ||
79 | These had been deprecated since v5.18. | |
80 | ||
8373491a KW |
81 | =head2 5 additional characters are treated as white space under C</x> in |
82 | regex patterns (unless escaped) | |
83 | ||
84 | The use of these characters with C</x> outside bracketed character | |
2fc36bac MH |
85 | classes and when not preceded by a backslash has raised a deprecation |
86 | warning since v5.18. Now they will be ignored. See L</"qr/foo/x"> | |
8373491a KW |
87 | for the list of the five characters. |
88 | ||
89 | =head2 Comment lines within S<C<(?[ ])>> now are ended only by a C<\n> | |
90 | ||
91 | S<C<(?[ ])>> is an experimental feature, introduced in v5.18. It operates | |
92 | as if C</x> is always enabled. But there was a difference, comment | |
93 | lines (following a C<#> character) were terminated by anything matching | |
94 | C<\R> which includes all vertical whitespace, such as form feeds. For | |
95 | consistency, this is now changed to match what terminates comment lines | |
96 | outside S<C<(?[ ])>>, namely a C<\n> (even if escaped), which is the | |
97 | same as what terminates a heredoc string and formats. | |
98 | ||
b5adc3e5 DIM |
99 | =head2 Omitting % and @ on hash and array names is no longer permitted |
100 | ||
101 | Really old Perl let you omit the @ on array names and the % on hash | |
102 | names in some spots. This has issued a deprecation warning since Perl | |
103 | 5.0, and is no longer permitted. | |
104 | ||
2c6ee1a7 KW |
105 | =head2 C<"$!"> text is now in English outside C<"use locale"> scope |
106 | ||
107 | Previously, the text, unlike almost everything else, always came out | |
108 | based on the current underlying locale of the program. (Also affected | |
109 | on some systems is C<"$^E>".) For programs that are unprepared to | |
110 | handle locale, this can cause garbage text to be displayed. It's better | |
111 | to display text that is translatable via some tool than garbage text | |
112 | which is much harder to figure out. | |
113 | ||
5320b60d KW |
114 | =head2 C<"$!"> text will be returned in UTF-8 when appropriate |
115 | ||
116 | The stringification of C<$!> and C<$^E> will have the UTF-8 flag set | |
117 | when the text is actually non-ASCII UTF-8. This will enable programs | |
118 | that are set up to be locale-aware to properly output messages in the | |
119 | user's native language. Code that needs to continue the 5.20 and | |
120 | earlier behavior can do the stringification within the scopes of both | |
121 | 'use bytes' and 'use locale ":messages". No other Perl operations will | |
122 | be affected by locale; only C<$!> and C<$^E> stringification. The | |
123 | 'bytes' pragma causes the UTF-8 flag to not be set, just as in previous | |
124 | Perl releases. This resolves [perl #112208]. | |
125 | ||
c3383756 DIM |
126 | =head2 Support for C<?PATTERN?> without explicit operator has been removed |
127 | ||
128 | Starting regular expressions matching only once directly with the | |
129 | question mark delimiter is now a syntax error, so that the question mark | |
130 | can be available for use in new operators. Write C<m?PATTERN?> instead, | |
131 | explicitly using the C<m> operator: the question mark delimiter still | |
132 | invokes match-once behaviour. | |
133 | ||
36304e49 KW |
134 | =head2 C<defined(@array)> and C<defined(%hash)> are now fatal errors |
135 | ||
136 | These have been deprecated since v5.6.1 and have raised deprecation | |
137 | warnings since v5.16. | |
138 | ||
139 | =head2 Using a hash or an array as a reference are now fatal errors. | |
140 | ||
141 | For example, C<%foo-E<gt>{"bar"}> now causes a fatal compilation | |
142 | error. These have been deprecated since before v5.8, and have raised | |
143 | deprecation warnings since then. | |
144 | ||
7065301c RS |
145 | =head1 Deprecations |
146 | ||
df758df2 KW |
147 | =head2 Using a NO-BREAK space in a character alias for C<\N{...}> is now |
148 | deprecated | |
149 | ||
150 | This non-graphic character is essentially indistinguishable from a | |
151 | regular space, and so should not be allowed. See | |
152 | L<charnames/CUSTOM ALIASES>. | |
153 | ||
412f55bb KW |
154 | =head2 A literal C<"{"> should now be escaped in a pattern |
155 | ||
156 | If you want a literal left curly bracket (also called a left brace) in a | |
157 | regular expression pattern, you should now escape it by either | |
158 | preceding it with a backslash (C<"\{">) or enclosing it within square | |
159 | brackets C<"[{]">, or by using C<\Q>; otherwise a deprecation warning | |
160 | will be raised. This was first announced as forthcoming in the v5.16 | |
161 | release; it will allow future extensions to the language to happen. | |
162 | ||
7065301c RS |
163 | =head1 Performance Enhancements |
164 | ||
7065301c RS |
165 | =over 4 |
166 | ||
167 | =item * | |
168 | ||
8a16341a MH |
169 | Many internal functions have been refactored to improve performance and reduce |
170 | their memory footprints. | |
d133a3dd MH |
171 | |
172 | L<[perl #121436]|https://rt.perl.org/Ticket/Display.html?id=121436> | |
8a16341a MH |
173 | L<[perl #121906]|https://rt.perl.org/Ticket/Display.html?id=121906> |
174 | L<[perl #121969]|https://rt.perl.org/Ticket/Display.html?id=121969> | |
7065301c | 175 | |
6bb82be0 MH |
176 | =item * |
177 | ||
178 | C<-T> and C<-B> filetests will return sooner when an empty file is detected. | |
179 | ||
180 | L<perl #121489|https://rt.perl.org/Ticket/Display.html?id=121489> | |
181 | ||
7065301c RS |
182 | =back |
183 | ||
7ef8b31d | 184 | =head1 Modules and Pragmata |
f6f3144e | 185 | |
2fc36bac | 186 | =head2 Updated Modules and Pragmata |
7065301c | 187 | |
2fc36bac | 188 | =over 4 |
7065301c | 189 | |
2fc36bac | 190 | =item * |
24a38d90 | 191 | |
2fc36bac MH |
192 | The libnet collection of modules has been upgraded from version 1.25 to 1.27. |
193 | ||
194 | There are only whitespace changes to the installed files. | |
24a38d90 RS |
195 | |
196 | =item * | |
197 | ||
2fc36bac MH |
198 | A mismatch between the documentation and the code in utf8::downgrade() |
199 | was fixed in favour of the documentation. The optional second argument | |
200 | is now correctly treated as a perl boolean (true/false semantics) and | |
201 | not as an integer. | |
7065301c | 202 | |
2fc36bac | 203 | =item * |
7065301c | 204 | |
2fc36bac | 205 | The Locale-Codes collection of modules has been upgraded from version 3.30 to 3.31. |
7065301c | 206 | |
2fc36bac MH |
207 | Fixed a bug in the scripts used to extract data from spreadsheets that |
208 | prevented the SHP currency code from being found. | |
209 | L<[cpan #94229]|https://rt.cpan.org/Ticket/Display.html?id=94229> | |
210 | ||
211 | =item * | |
212 | ||
213 | L<Archive::Tar> has been upgraded from version 1.96 to 2.00. | |
214 | ||
215 | =item * | |
216 | ||
217 | L<autodie> has been upgraded from version 2.23 to 2.25. | |
218 | ||
219 | =item * | |
220 | ||
221 | L<B> has been upgraded from version 1.48 to 1.49. | |
222 | ||
223 | =item * | |
224 | ||
225 | L<B::Deparse> has been upgraded from version 1.26 to 1.27. | |
24a38d90 RS |
226 | |
227 | =item * | |
228 | ||
2fc36bac | 229 | L<Benchmark> has been upgraded from version 1.18 to 1.19. |
04c0d500 MH |
230 | |
231 | =item * | |
232 | ||
56cdf413 TC |
233 | L<Carp> has been upgraded from version 1.3301 to 1.34. |
234 | ||
235 | Carp::Heavy now ignores version mismatches with Carp if Carp is newer | |
236 | than 1.12, since Carp::Heavy's guts were merged into Carp at that | |
237 | point. | |
238 | L<[perl #121574]|https://rt.perl.org/Ticket/Display.html?id=121574> | |
239 | ||
240 | =item * | |
241 | ||
2fc36bac MH |
242 | L<charnames> has been upgraded from version 1.40 to 1.41. |
243 | ||
244 | =item * | |
245 | ||
246 | L<CPAN::Meta> has been upgraded from version 2.140640 to 2.141520. | |
247 | ||
248 | =item * | |
249 | ||
f9dc9a54 TC |
250 | L<Data::Dumper> has been upgraded from version 2.151 to 2.152. |
251 | ||
252 | Changes to resolve Coverity issues. | |
253 | ||
254 | XS dumps incorrectly stored the name of code references stored in a | |
255 | GLOB. | |
256 | L<[perl #122070]|https://rt.perl.org/Ticket/Display.html?id=122070> | |
257 | ||
258 | =item * | |
259 | ||
2fc36bac MH |
260 | L<Devel::Peek> has been upgraded from version 1.16 to 1.17. |
261 | ||
262 | =item * | |
263 | ||
264 | L<Devel::PPPort> has been upgraded from version 3.21 to 3.24. | |
265 | ||
266 | =item * | |
267 | ||
268 | L<Digest::SHA> has been upgraded from version 5.88 to 5.92. | |
269 | ||
270 | =item * | |
271 | ||
272 | L<DynaLoader> has been upgraded from version 1.25 to 1.26. | |
273 | ||
274 | =item * | |
275 | ||
276 | L<Encode> has been upgraded from version 2.60 to 2.62. | |
28e02325 SH |
277 | |
278 | B<piconv> now has better error handling when the encoding name is nonexistent, | |
279 | and a build breakage when upgrading L<Encode> in perl-5.8.2 and earlier has | |
280 | been fixed. | |
281 | ||
282 | =item * | |
283 | ||
2fc36bac MH |
284 | L<Errno> has been upgraded from version 1.20_03 to 1.20_04. |
285 | ||
286 | =item * | |
287 | ||
288 | L<Exporter> has been upgraded from version 5.70 to 5.71. | |
289 | ||
290 | =item * | |
291 | ||
292 | L<ExtUtils::Install> has been upgraded from version 1.67 to 1.68. | |
293 | ||
294 | =item * | |
295 | ||
296 | L<ExtUtils::Miniperl> has been upgraded from version 1.01 to 1.02. | |
297 | ||
298 | =item * | |
299 | ||
300 | L<ExtUtils::ParseXS> has been upgraded from version 3.24 to 3.25. | |
301 | ||
302 | =item * | |
303 | ||
304 | L<ExtUtils::Typemaps> has been upgraded from version 3.24 to 3.25. | |
305 | ||
306 | =item * | |
307 | ||
308 | L<File::Spec> has been upgraded from version 3.47 to 3.48. | |
309 | ||
310 | =item * | |
311 | ||
cb526893 TC |
312 | L<Hash::Util> has been upgraded from version 0.16 to 0.17. |
313 | ||
314 | Minor bug fixes and documentation fixes to Hash::Util::hash_stats() | |
315 | ||
316 | =item * | |
317 | ||
2fc36bac | 318 | L<IO> has been upgraded from version 1.31 to 1.32. |
5abafd4c | 319 | |
2fc36bac MH |
320 | =item * |
321 | ||
322 | L<List::Util> has been upgraded from version 1.38 to 1.39. | |
5abafd4c SH |
323 | |
324 | =item * | |
325 | ||
2fc36bac | 326 | L<locale> has been upgraded from version 1.03 to 1.04. |
7a945bf5 | 327 | |
2fc36bac MH |
328 | =item * |
329 | ||
330 | L<Locale::Codes> has been upgraded from version 3.30 to 3.31. | |
7a945bf5 SH |
331 | |
332 | =item * | |
333 | ||
2fc36bac | 334 | L<Math::BigInt> has been upgraded from version 1.9993 to 1.9995. |
4ed8f5ed TC |
335 | |
336 | Synchronize POD changes from the CPAN release. | |
337 | ||
ee15bb65 TC |
338 | C<< Math::BigFloat->blog(x) >> would sometimes return blog(2*x) when |
339 | the accuracy was greater than 70 digits. | |
340 | ||
341 | The result of C<< Math::BigFloat->bdiv() >> in list context now | |
342 | satisfies C<< x = quotient * divisor + remainder >>. | |
343 | ||
4ed8f5ed TC |
344 | =item * |
345 | ||
2fc36bac | 346 | L<Math::BigRat> has been upgraded from version 0.2606 to 0.2608. |
234105dd TC |
347 | |
348 | Synchronize POD changes from the CPAN release. | |
349 | ||
350 | =item * | |
351 | ||
2fc36bac MH |
352 | L<Module::CoreList> has been upgraded from version 5.021001 to 5.021001_01. |
353 | ||
354 | =item * | |
355 | ||
356 | L<Module::Metadata> has been upgraded from version 1.000019 to 1.000024. | |
b9beed70 SH |
357 | |
358 | Support installations on older perls with an L<ExtUtils::MakeMaker> earlier | |
359 | than 6.63_03 | |
360 | ||
361 | =item * | |
362 | ||
2fc36bac MH |
363 | L<NDBM_File> has been upgraded from version 1.12 to 1.13. |
364 | ||
365 | =item * | |
366 | ||
f9dc9a54 TC |
367 | L<OS2::Process> has been upgraded from version 1.09 to 1.10. |
368 | ||
369 | =item * | |
370 | ||
c13fd1a2 TC |
371 | L<perl5db.pl> has been upgraded from version 1.44 to 1.45. |
372 | ||
373 | fork() in the debugger under C<tmux> will now create a new window for | |
891822fa TC |
374 | the forked process. L<[perl |
375 | #121333]|https://rt.perl.org/Ticket/Display.html?id=121333> | |
376 | ||
377 | The debugger now saves the current working directory on startup and | |
2fc36bac | 378 | restores it when you restart your program with C<R> or C<rerun>. L<[perl |
891822fa | 379 | #121509]|https://rt.perl.org/Ticket/Display.html?id=121509> |
24a38d90 | 380 | |
cb526893 TC |
381 | =item * |
382 | ||
f9dc9a54 TC |
383 | L<PerlIO::encoding> has been upgraded from version 0.18 to 0.19. |
384 | ||
385 | No changes in behaviour. | |
386 | ||
387 | =item * | |
388 | ||
2fc36bac | 389 | L<PerlIO::mmap> has been upgraded from version 0.011 to 0.013. |
f9dc9a54 TC |
390 | |
391 | No changes in behaviour. | |
392 | ||
393 | =item * | |
394 | ||
395 | L<PerlIO::scalar> has been upgraded from version 0.18 to 0.19. | |
396 | ||
397 | No changes in behaviour. | |
398 | ||
399 | =item * | |
400 | ||
2fc36bac MH |
401 | L<PerlIO::via> has been upgraded from version 0.14 to 0.15. |
402 | ||
403 | =item * | |
404 | ||
405 | L<Pod::Html> has been upgraded from version 1.21 to 1.22. | |
406 | ||
407 | =item * | |
408 | ||
409 | L<POSIX> has been upgraded from version 1.38_03 to 1.40. | |
410 | ||
411 | =item * | |
412 | ||
413 | L<Scalar::Util> has been upgraded from version 1.38 to 1.39. | |
414 | ||
415 | =item * | |
416 | ||
417 | L<SelfLoader> has been upgraded from version 1.21 to 1.22. | |
418 | ||
419 | =item * | |
420 | ||
421 | L<Socket> has been upgraded from version 2.013 to 2.014. | |
422 | ||
423 | =item * | |
424 | ||
425 | L<Storable> has been upgraded from version 2.49 to 2.51. | |
426 | ||
427 | =item * | |
428 | ||
429 | L<Term::ANSIColor> has been upgraded from version 4.02 to 4.03. | |
430 | ||
431 | =item * | |
432 | ||
433 | L<Test::Harness> has been upgraded from version 3.30 to 3.32. | |
434 | ||
435 | =item * | |
436 | ||
437 | L<Test::Simple> has been upgraded from version 1.001002 to 1.001003. | |
438 | ||
439 | =item * | |
440 | ||
441 | L<threads> has been upgraded from version 1.93 to 1.94. | |
442 | ||
443 | =item * | |
444 | ||
445 | L<Tie::File> has been upgraded from version 1.00 to 1.01. | |
446 | ||
447 | =item * | |
448 | ||
f8187d97 SH |
449 | L<Unicode::Collate> has been upgraded from version 1.04 to 1.07. |
450 | ||
451 | Version 0.67's improved discontiguous contractions is invalidated by default | |
452 | and is supported as a parameter 'long_contraction'. | |
453 | ||
95f3e8d2 SH |
454 | =item * |
455 | ||
456 | L<Unicode::Normalize> has been upgraded from version 1.17 to 1.18. | |
457 | ||
458 | The XSUB implementation has been removed in favour of pure Perl. | |
459 | ||
3eaa3d14 YO |
460 | =item * |
461 | ||
2fc36bac | 462 | L<Unicode::UCD> has been upgraded from version 0.57 to 0.58. |
24a38d90 | 463 | |
2fc36bac | 464 | =item * |
24a38d90 | 465 | |
2fc36bac | 466 | L<utf8> has been upgraded from version 1.13 to 1.14. |
24a38d90 RS |
467 | |
468 | =item * | |
469 | ||
2fc36bac | 470 | L<warnings> has been upgraded from version 1.23 to 1.24. |
7065301c RS |
471 | |
472 | =back | |
473 | ||
474 | =head1 Documentation | |
475 | ||
7065301c RS |
476 | =head2 Changes to Existing Documentation |
477 | ||
9c0f2733 | 478 | =head3 L<perlfunc> |
7065301c RS |
479 | |
480 | =over 4 | |
481 | ||
482 | =item * | |
483 | ||
9c0f2733 MH |
484 | C<-l> now notes that it will return false if symlinks aren't supported by the |
485 | file system. | |
486 | ||
487 | L<[perl #121523]|https://rt.perl.org/Ticket/Display.html?id=121523> | |
7065301c | 488 | |
902c1f75 MH |
489 | =item * |
490 | ||
491 | Note that C<exec LIST> and C<system LIST> may fall back to the shell on | |
492 | Win32. Only C<exec PROGRAM LIST> and C<system PROGRAM LIST> indirect object | |
493 | syntax will reliably avoid using the shell. | |
494 | ||
495 | This has also been noted in L<perlport>. | |
496 | ||
497 | L<[perl #122046]|https://rt.perl.org/Ticket/Display.html?id=122046> | |
498 | ||
7065301c RS |
499 | =back |
500 | ||
58f25ac1 MH |
501 | =head3 L<perlapi> |
502 | ||
503 | =over 4 | |
504 | ||
505 | =item * | |
506 | ||
2402c6dd MH |
507 | Note that C<SvSetSV> doesn't do set magic. |
508 | ||
509 | =item * | |
510 | ||
58f25ac1 MH |
511 | C<sv_usepvn_flags> - Fix documentation to mention the use of C<NewX> instead of |
512 | C<malloc>. | |
513 | ||
514 | L<[perl #121869]|https://rt.perl.org/Ticket/Display.html?id=121869> | |
515 | ||
4c6609d3 MH |
516 | =item * |
517 | ||
518 | Clarify where C<NUL> may be embedded or is required to terminate a string. | |
519 | ||
5bafdaa4 MH |
520 | =item * |
521 | ||
522 | Previously missing documentation due to formatting errors are now included. | |
523 | ||
524 | =item * | |
525 | ||
526 | Entries are now organized into groups rather than by file where they are found. | |
527 | ||
528 | =item * | |
529 | ||
530 | Alphabetical sorting of entries is now handled by the POD generator to make | |
531 | entries easier to find when scanning. | |
532 | ||
58f25ac1 MH |
533 | =back |
534 | ||
12042f24 MH |
535 | =head3 L<perlhacktips> |
536 | ||
537 | =over 4 | |
538 | ||
539 | =item * | |
540 | ||
541 | Updated documentation for the C<test.valgrind> C<make> target. | |
542 | ||
543 | L<[perl #121431]|https://rt.perl.org/Ticket/Display.html?id=121431> | |
544 | ||
545 | =back | |
546 | ||
2705070b MH |
547 | =head3 L<perlre> |
548 | ||
549 | =over 4 | |
550 | ||
551 | =item * | |
552 | ||
553 | The C</x> modifier has been clarified to note that comments cannot be continued | |
554 | onto the next line by escaping them. | |
555 | ||
556 | =back | |
557 | ||
b10906fb MH |
558 | =head3 L<Unicode::UCD> |
559 | ||
560 | =over 4 | |
561 | ||
562 | =item * | |
563 | ||
564 | The documentation includes many clarifications and fixes. | |
565 | ||
566 | =back | |
567 | ||
7065301c RS |
568 | =head1 Diagnostics |
569 | ||
570 | The following additions or changes have been made to diagnostic output, | |
571 | including warnings and fatal error messages. For the complete list of | |
572 | diagnostic messages, see L<perldiag>. | |
573 | ||
7065301c RS |
574 | =head2 New Diagnostics |
575 | ||
7065301c RS |
576 | =head3 New Errors |
577 | ||
578 | =over 4 | |
24a38d90 RS |
579 | |
580 | =item * | |
581 | ||
28462159 MH |
582 | L<In '(?...)', the '(' and '?' must be adjacent in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"In '(?...)', the '(' and '?' must be adjacent in regex; marked by <-- HERE in m/%s/"> |
583 | ||
584 | (F) The two-character sequence C<"(?"> in | |
585 | this context in a regular expression pattern should be an | |
586 | indivisible token, with nothing intervening between the C<"("> | |
587 | and the C<"?">, but you separated them. | |
588 | ||
589 | =item * | |
590 | ||
591 | L<In '(*VERB...)', the '(' and '*' must be adjacent in regex; marked by S<<-- HERE> in mE<sol>%sE<sol>|perldiag/"In '(*VERB...)', the '(' and '*' must be adjacent in regex; marked by <-- HERE in m/%s/"> | |
592 | ||
593 | (F) The two-character sequence C<"(*"> in | |
594 | this context in a regular expression pattern should be an | |
595 | indivisible token, with nothing intervening between the C<"("> | |
596 | and the C<"*">, but you separated them. | |
597 | ||
598 | =item * | |
599 | ||
600 | L<charnames alias definitions may not contain a sequence of multiple spaces|perldiag/"charnames alias definitions may not contain a sequence of multiple spaces"> | |
601 | ||
602 | (F) You defined a character name which had multiple space | |
603 | characters in a row. Change them to single spaces. Usually these | |
604 | names are defined in the C<:alias> import argument to C<use charnames>, but | |
605 | they could be defined by a translator installed into C<$^H{charnames}>. | |
606 | See L<charnames/CUSTOM ALIASES>. | |
607 | ||
608 | =item * | |
609 | ||
610 | L<charnames alias definitions may not contain trailing white-space|perldiag/"charnames alias definitions may not contain trailing white-space"> | |
611 | ||
612 | (F) You defined a character name which ended in a space | |
613 | character. Remove the trailing space(s). Usually these names are | |
614 | defined in the C<:alias> import argument to C<use charnames>, but they | |
615 | could be defined by a translator installed into C<$^H{charnames}>. | |
616 | See L<charnames/CUSTOM ALIASES>. | |
617 | ||
618 | =item * | |
619 | ||
620 | L<Can't use a hash as a reference|perldiag/"Can't use a hash as a reference"> | |
621 | ||
622 | (F) You tried to use a hash as a reference, as in | |
2fc36bac | 623 | C<< %foo->{"bar"} >> or C<< %$ref->{"hello"} >>. Versions of perl E<lt>= 5.6.1 |
28462159 MH |
624 | used to allow this syntax, but shouldn't have. |
625 | ||
626 | =item * | |
627 | ||
628 | L<Can't use an array as a reference|perldiag/"Can't use an array as a reference"> | |
629 | ||
630 | (F) You tried to use an array as a reference, as in | |
2fc36bac | 631 | C<< @foo->[23] >> or C<< @$ref->[99] >>. Versions of perl E<lt>= 5.6.1 used to |
28462159 MH |
632 | allow this syntax, but shouldn't have. |
633 | ||
634 | =item * | |
635 | ||
636 | L<Can't use 'defined(@array)' (Maybe you should just omit the defined()?)|perldiag/"Can't use 'defined(@array)' (Maybe you should just omit the defined()?)"> | |
637 | ||
638 | (F) defined() is not useful on arrays because it | |
639 | checks for an undefined I<scalar> value. If you want to see if the | |
640 | array is empty, just use C<if (@array) { # not empty }> for example. | |
641 | ||
642 | =item * | |
643 | ||
644 | L<Can't use 'defined(%hash)' (Maybe you should just omit the defined()?)|perldiag/"Can't use 'defined(%hash)' (Maybe you should just omit the defined()?)"> | |
645 | ||
646 | (F) C<defined()> is not usually right on hashes. | |
647 | ||
648 | Although C<defined %hash> is false on a plain not-yet-used hash, it | |
649 | becomes true in several non-obvious circumstances, including iterators, | |
650 | weak references, stash names, even remaining true after C<undef %hash>. | |
651 | These things make C<defined %hash> fairly useless in practice, so it now | |
652 | generates a fatal error. | |
653 | ||
654 | If a check for non-empty is what you wanted then just put it in boolean | |
655 | context (see L<perldata/Scalar values>): | |
656 | ||
657 | if (%hash) { | |
658 | # not empty | |
659 | } | |
660 | ||
661 | If you had C<defined %Foo::Bar::QUUX> to check whether such a package | |
662 | variable exists then that's never really been reliable, and isn't | |
663 | a good way to enquire about the features of a package, or whether | |
664 | it's loaded, etc. | |
665 | ||
666 | =item * | |
667 | ||
668 | L<Illegal suidscript|perldiag/"Illegal suidscript"> | |
669 | ||
670 | (F) The script run under suidperl was somehow illegal. | |
7065301c RS |
671 | |
672 | =back | |
673 | ||
674 | =head3 New Warnings | |
675 | ||
676 | =over 4 | |
24a38d90 RS |
677 | |
678 | =item * | |
679 | ||
28462159 MH |
680 | L<Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in mE<sol>%sE<sol>|perldiag/"Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%s/"> |
681 | ||
682 | (D deprecated, regexp) You used a literal C<"{"> character in a regular | |
683 | expression pattern. You should change to use C<"\{"> instead, because a future | |
684 | version of Perl (tentatively v5.26) will consider this to be a syntax error. If | |
685 | the pattern delimiters are also braces, any matching right brace | |
686 | (C<"}">) should also be escaped to avoid confusing the parser, for | |
687 | example, | |
688 | ||
689 | qr{abc\{def\}ghi} | |
690 | ||
691 | =item * | |
692 | ||
693 | L<NO-BREAK SPACE in a charnames alias definition is deprecated|perldiag/"NO-BREAK SPACE in a charnames alias definition is deprecated"> | |
694 | ||
695 | (D deprecated) You defined a character name which contained a no-break | |
696 | space character. Change it to a regular space. Usually these names are | |
697 | defined in the C<:alias> import argument to C<use charnames>, but they | |
698 | could be defined by a translator installed into C<$^H{charnames}>. See | |
699 | L<charnames/CUSTOM ALIASES>. | |
700 | ||
701 | =item * | |
702 | ||
703 | L<PerlIO layer ':win32' is experimental|perldiag/"PerlIO layer ':win32' is experimental"> | |
704 | ||
705 | (S experimental::win32_perlio) The C<:win32> PerlIO layer is | |
706 | experimental. If you want to take the risk of using this layer, | |
707 | simply disable this warning: | |
708 | ||
709 | no warnings "experimental::win32_perlio"; | |
710 | ||
711 | =item * | |
712 | ||
713 | L<Negative repeat count does nothing|perldiag/"Negative repeat count does nothing"> | |
714 | ||
715 | (W numeric) You tried to execute the | |
716 | L<C<x>|perlop/Multiplicative Operators> repetition operator fewer than 0 | |
717 | times, which doesn't make sense. | |
718 | ||
719 | =item * | |
720 | ||
721 | L<localtime(%f) failed|perldiag/"localtime(%f) failed"> | |
722 | ||
723 | (W overflow) You called C<localtime> with a number that it could not handle: | |
724 | too large, too small, or NaN. The returned value is C<undef>. | |
725 | ||
726 | =item * | |
727 | ||
728 | L<gmtime(%f) failed|perldiag/"gmtime(%f) failed"> | |
729 | ||
730 | (W overflow) You called C<gmtime> with a number that it could not handle: | |
731 | too large, too small, or NaN. The returned value is C<undef>. | |
732 | ||
733 | =item * | |
734 | ||
097675bf TC |
735 | L<PerlIO layer ':win32' is experimental|perldiag/"PerlIO layer ':win32' is experimental">: |
736 | ||
737 | (S experimental::win32_perlio) The C<:win32> PerlIO layer is | |
738 | experimental. If you want to take the risk of using this layer, | |
739 | simply disable this warning: | |
740 | ||
741 | no warnings "experimental::win32_perlio"; | |
24a38d90 | 742 | |
28462159 | 743 | =item * |
b3211734 | 744 | |
2fc36bac | 745 | L<Negative repeat count does nothing|perldiag/"Negative repeat count does nothing"> |
b3211734 KW |
746 | |
747 | (W numeric) This warns when the repeat count of the | |
748 | L<C<x>|perlop/Multiplicative Operators> repetition operator is | |
749 | negative. | |
750 | ||
751 | This warning may be changed or removed if it turn out that it was | |
752 | unwise to have added it. | |
753 | ||
238894db | 754 | =back |
24a38d90 | 755 | |
7065301c | 756 | =head2 Changes to Existing Diagnostics |
24a38d90 | 757 | |
7065301c RS |
758 | =over 4 |
759 | ||
760 | =item * | |
761 | ||
b08d439a MH |
762 | L<Variable length lookbehind not implemented in regex mE<sol>%sE<sol>|perldiag/"Variable length lookbehind not implemented in regex m/%s/"> |
763 | ||
764 | Information about Unicode behaviour has been added. | |
765 | ||
766 | =item * | |
767 | ||
747b6130 MH |
768 | <> should be quotes |
769 | ||
770 | This warning has been changed to | |
771 | L<< <> at require-statement should be quotes|perldiag/"<> at require-statement should be quotes" >> | |
772 | to make the issue more identifiable. | |
773 | ||
774 | =item * | |
775 | ||
723edb96 TC |
776 | L<Unsuccessful %s on filename containing newline|perldiag/"Unsuccessful %s on filename containing newline"> |
777 | ||
778 | This warning is now only produced when the newline is at the end of | |
779 | the filename. | |
7065301c RS |
780 | |
781 | =back | |
782 | ||
783 | =head1 Utility Changes | |
784 | ||
eb561242 | 785 | =head2 F<x2p/> |
7065301c RS |
786 | |
787 | =over 4 | |
788 | ||
789 | =item * | |
24a38d90 | 790 | |
eb561242 MH |
791 | The F<x2p/> directory has been removed from the Perl core. |
792 | ||
793 | This removes find2perl, s2p and a2p. They have all been released to CPAN as | |
794 | separate distributions (App::find2perl, App::s2p, App::a2p). | |
7065301c RS |
795 | |
796 | =back | |
797 | ||
798 | =head1 Configuration and Compilation | |
799 | ||
7065301c RS |
800 | =over 4 |
801 | ||
802 | =item * | |
803 | ||
12042f24 MH |
804 | C<make test.valgrind> now supports parallel testing. |
805 | ||
806 | For example: | |
807 | ||
808 | TEST_JOBS=9 make test.valgrind | |
809 | ||
810 | See L<perlhacktips/valgrind> for more information. | |
811 | ||
812 | L<[perl #121431]|https://rt.perl.org/Ticket/Display.html?id=121431> | |
7065301c | 813 | |
b2e61987 KW |
814 | =item * |
815 | ||
816 | The MAD (Misc Attribute Decoration) build option has been removed | |
817 | ||
818 | This was an unmaintained attempt at preserving | |
819 | the Perl parse tree more faithfully so that automatic conversion of | |
820 | Perl 5 to Perl 6 would have been easier. | |
821 | ||
822 | This build-time configuration option had been unmaintained for years, | |
823 | and had probably seriously diverged on both Perl 5 and Perl 6 sides. | |
824 | ||
7065301c RS |
825 | =back |
826 | ||
7065301c RS |
827 | =head1 Platform Support |
828 | ||
7065301c RS |
829 | =head2 Discontinued Platforms |
830 | ||
7065301c RS |
831 | =over 4 |
832 | ||
f05550c0 | 833 | =item NeXTSTEP/OPENSTEP |
7065301c | 834 | |
f05550c0 BF |
835 | NeXTSTEP was proprietary OS bundled with NeXT's workstations in the early |
836 | to mid 90's; OPENSTEP was an API specification that provided a NeXTSTEP-like | |
837 | environment on a non-NeXTSTEP system. Both are now long dead, so support | |
838 | for building Perl on them has been removed. | |
7065301c RS |
839 | |
840 | =back | |
841 | ||
842 | =head2 Platform-Specific Notes | |
843 | ||
7065301c RS |
844 | =over 4 |
845 | ||
7d0ccdba MH |
846 | =item OpenBSD |
847 | ||
848 | On OpenBSD, Perl will now default to using the system C<malloc> due to the | |
849 | security features it provides. Perl's own malloc wrapper has been in use | |
850 | since v5.14 due to performance reasons, but the OpenBSD project believes | |
851 | the tradeoff is worth it and would prefer that users who need the speed | |
852 | specifically ask for it. | |
853 | ||
854 | L<[perl #122000]|https://rt.perl.org/Ticket/Display.html?id=122000>. | |
855 | ||
7065301c RS |
856 | =back |
857 | ||
858 | =head1 Internal Changes | |
859 | ||
7065301c RS |
860 | =over 4 |
861 | ||
862 | =item * | |
863 | ||
8dab3ba5 | 864 | The deprecated variable C<PL_sv_objcount> has been removed. |
7065301c | 865 | |
4c28b29c KW |
866 | =item * |
867 | ||
868 | Perl now tries to keep the locale category C<LC_NUMERIC> set to "C" | |
869 | except around operations that need it to be set to the program's | |
870 | underlying locale. This protects the many XS modules that cannot cope | |
871 | with the decimal radix character not being a dot. Prior to this | |
872 | release, Perl initialized this category to "C", but a call to | |
873 | C<POSIX::setlocale()> would change it. Now such a call will change the | |
874 | underlying locale of the C<LC_NUMERIC> category for the program, but the | |
875 | locale exposed to XS code will remain "C". There is an API under | |
876 | development for those relatively few modules that need to use the | |
877 | underlying locale. This API will be nailed down during the course of | |
878 | developing v5.21. Send email to L<mailto:perl5-porters@perl.org> for | |
879 | guidance. | |
880 | ||
c9fcb674 KW |
881 | =item * |
882 | ||
883 | A new macro L<C<isUTF8_CHAR>|perlapi/isUTF8_CHAR> has been written which | |
884 | efficiently determines if the string given by its parameters begins | |
885 | with a well-formed UTF-8 encoded character. | |
886 | ||
7065301c RS |
887 | =back |
888 | ||
889 | =head1 Selected Bug Fixes | |
890 | ||
7065301c RS |
891 | =over 4 |
892 | ||
893 | =item * | |
894 | ||
30536d4a TC |
895 | index() and rindex() no longer crash when used on strings over 2GB in |
896 | size. | |
897 | L<[perl #121562]|https://rt.perl.org/Ticket/Display.html?id=121562>. | |
7065301c | 898 | |
0c2c57a8 DD |
899 | =item * |
900 | ||
901 | A small previously intentional memory leak in PERL_SYS_INIT/PERL_SYS_INIT3 on | |
902 | Win32 builds was fixed. This might affect embedders who repeatedly create and | |
903 | destroy perl engines within the same process. | |
904 | ||
a835cd47 KW |
905 | =item * |
906 | ||
907 | C<POSIX::localeconv()> now returns the data for the program's underlying | |
908 | locale even when called from outside the scope of S<C<use locale>>. | |
909 | ||
03ceeedf KW |
910 | =item * |
911 | ||
912 | C<POSIX::localeconv()> now works properly on platforms which don't have | |
913 | C<LC_NUMERIC> and/or C<LC_MONETARY>, or for which Perl has been compiled | |
914 | to disregard either or both of these locale categories. In such | |
915 | circumstances, there are now no entries for the corresponding values in | |
916 | the hash returned by C<localeconv()>. | |
917 | ||
c1284011 KW |
918 | =item * |
919 | ||
920 | C<POSIX::localeconv()> now marks appropriately the values it returns as | |
921 | UTF-8 or not. Previously they were always returned as a bytes, even if | |
922 | they were supposed to be encoded as UTF-8. | |
923 | ||
375f5f06 KW |
924 | =item * |
925 | ||
926 | On Microsoft Windows, within the scope of C<S<use locale>>, the following | |
927 | POSIX character classes gave results for many locales that did not | |
928 | conform to the POSIX standard: | |
929 | C<[[:alnum:]]>, | |
930 | C<[[:alpha:]]>, | |
931 | C<[[:blank:]]>, | |
932 | C<[[:digit:]]>, | |
933 | C<[[:graph:]]>, | |
934 | C<[[:lower:]]>, | |
935 | C<[[:print:]]>, | |
936 | C<[[:punct:]]>, | |
937 | C<[[:upper:]]>, | |
938 | C<[[:word:]]>, | |
939 | and | |
940 | C<[[:xdigit:]]>. | |
941 | These are because the underlying Microsoft implementation does not | |
942 | follow the standard. Perl now takes special precautions to correct for | |
943 | this. | |
944 | ||
2884baee MH |
945 | =item * |
946 | ||
947 | Many issues have been detected by L<Coverity|http://www.coverity.com/> and | |
948 | fixed. | |
949 | ||
5af51eb4 BF |
950 | =item * |
951 | ||
952 | system() and friends should now work properly on more Android builds. | |
953 | ||
954 | Due to an oversight, the value specified through -Dtargetsh to Configure | |
955 | would end up being ignored by some of the build process. This caused perls | |
956 | cross-compiled for Android to end up with defective versions of system(), | |
957 | exec() and backticks: the commands would end up looking for C</bin/sh> | |
958 | instead of C</system/bin/sh>, and so would fail for the vast majority | |
959 | of devices, leaving C<$!> as C<ENOENT>. | |
960 | ||
412f55bb KW |
961 | =item * |
962 | ||
963 | C<qr(...\(...\)...)>, | |
964 | C<qr[...\[...\]...]>, | |
965 | and | |
966 | C<qr{...\{...\}...}> | |
967 | now work. Previously it was impossible to escape these three | |
968 | left-characters with a backslash within a regular expression pattern | |
969 | where otherwise they would be considered metacharacters, and the pattern | |
970 | opening delimiter was the character, and the closing delimiter was its | |
971 | mirror character. | |
972 | ||
7065301c RS |
973 | =back |
974 | ||
7065301c | 975 | =head1 Acknowledgements |
24a38d90 | 976 | |
bae620e0 MH |
977 | Perl 5.21.1 represents approximately 3 weeks of development since Perl 5.21.0 |
978 | and contains approximately 240,000 lines of changes across 680 files from 37 | |
979 | authors. | |
980 | ||
981 | Excluding auto-generated files, documentation and release tools, there were | |
982 | approximately 150,000 lines of changes to 420 .pm, .t, .c and .h files. | |
983 | ||
984 | Perl continues to flourish into its third decade thanks to a vibrant community | |
985 | of users and developers. The following people are known to have contributed the | |
986 | improvements that became Perl 5.21.1: | |
987 | ||
988 | Alex Solovey, Andrew Fresh, Andy Dougherty, Brian Fraser, Chris 'BinGOs' | |
989 | Williams, Craig A. Berry, Dagfinn Ilmari Mannsåker, Daniel Dragan, Darin | |
990 | McBride, David Mitchell, Doug Bell, H.Merijn Brand, James E Keenan, Jarkko | |
991 | Hietaniemi, kafka, Karen Etheridge, Karl Williamson, Leon Timmermans, Matthew | |
992 | Horsfall, Michael Bunk, Nicholas Clark, Niels Thykier, Norman Koch, Peter John | |
993 | Acklam, Pierre Bogossian, Reini Urban, Ricardo Signes, Rob Hoelz, Shlomi Fish, | |
994 | Smylers, Steffen Müller, Steve Hay, Sullivan Beck, Thomas Sibley, Todd | |
995 | Rinaldo, Tony Cook, Yves Orton. | |
996 | ||
997 | The list above is almost certainly incomplete as it is automatically generated | |
998 | from version control history. In particular, it does not include the names of | |
999 | the (very much appreciated) contributors who reported issues to the Perl bug | |
1000 | tracker. | |
1001 | ||
1002 | Many of the changes included in this version originated in the CPAN modules | |
1003 | included in Perl's core. We're grateful to the entire CPAN community for | |
1004 | helping Perl to flourish. | |
1005 | ||
1006 | For a more complete list of all of Perl's historical contributors, please see | |
1007 | the F<AUTHORS> file in the Perl source distribution. | |
f5b73711 | 1008 | |
44691e6f AB |
1009 | =head1 Reporting Bugs |
1010 | ||
e08634c5 SH |
1011 | If you find what you think is a bug, you might check the articles recently |
1012 | posted to the comp.lang.perl.misc newsgroup and the perl bug database at | |
238894db | 1013 | https://rt.perl.org/ . There may also be information at |
7ef8b31d | 1014 | http://www.perl.org/ , the Perl Home Page. |
44691e6f | 1015 | |
e08634c5 SH |
1016 | If you believe you have an unreported bug, please run the L<perlbug> program |
1017 | included with your release. Be sure to trim your bug down to a tiny but | |
1018 | sufficient test case. Your bug report, along with the output of C<perl -V>, | |
1019 | will be sent off to perlbug@perl.org to be analysed by the Perl porting team. | |
44691e6f AB |
1020 | |
1021 | If the bug you are reporting has security implications, which make it | |
e08634c5 SH |
1022 | inappropriate to send to a publicly archived mailing list, then please send it |
1023 | to perl5-security-report@perl.org. This points to a closed subscription | |
1024 | unarchived mailing list, which includes all the core committers, who will be | |
1025 | able to help assess the impact of issues, figure out a resolution, and help | |
f9001595 | 1026 | co-ordinate the release of patches to mitigate or fix the problem across all |
e08634c5 SH |
1027 | platforms on which Perl is supported. Please only use this address for |
1028 | security issues in the Perl core, not for modules independently distributed on | |
1029 | CPAN. | |
44691e6f AB |
1030 | |
1031 | =head1 SEE ALSO | |
1032 | ||
e08634c5 SH |
1033 | The F<Changes> file for an explanation of how to view exhaustive details on |
1034 | what changed. | |
44691e6f AB |
1035 | |
1036 | The F<INSTALL> file for how to build Perl. | |
1037 | ||
1038 | The F<README> file for general stuff. | |
1039 | ||
1040 | The F<Artistic> and F<Copying> files for copyright information. | |
1041 | ||
1042 | =cut |