5 [ this is a template for a new perldelta file. Any text flagged as XXX needs
6 to be processed before release. ]
8 perldelta - what is new for perl v5.21.1
12 This document describes differences between the 5.21.0 release and the 5.21.1
15 If you are upgrading from an earlier release such as 5.20.0, first read
16 L<perl5210delta>, which describes differences between 5.20.0 and 5.21.0.
20 XXX Any important notices here
22 =head1 Core Enhancements
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.
28 [ List each enhancement as a =head2 entry ]
30 =head2 Experimental C Backtrace API
32 Starting from Perl 5.21.1, on some platforms Perl supports retrieving
33 the C level backtrace (similar to what symbolic debuggers like gdb do).
35 The backtrace returns the stack trace of the C call frames,
36 with the symbol names (function names), the object names (like "perl"),
37 and if it can, also the source code locations (file:line).
39 The supported platforms are Linux and OS X (some *BSD might work at
40 least partly, but they have not yet been tested).
42 The feature needs to be enabled with C<Configure -Dusecbacktrace>.
44 Also included is a C API to retrieve backtraces.
46 See L<perlhacktips/"C backtrace"> for more information.
48 =head2 C<qr/foo/x> now ignores any Unicode pattern white space
50 The C</x> regular expression modifier allows the pattern to contain
51 white space and comments, both of which are ignored, for improved
52 readability. Until now, not all the white space characters that Unicode
53 designates for this purpose were handled. The additional ones now
56 U+200E LEFT-TO-RIGHT MARK,
57 U+200F RIGHT-TO-LEFT MARK,
58 U+2028 LINE SEPARATOR,
60 U+2029 PARAGRAPH SEPARATOR.
62 =head2 S<C<use locale>> can restrict which locale categories are affected
64 It is now possible to pass a parameter to S<C<use locale>> to specify
65 a subset of locale categories to be locale-aware, with the remaining
66 ones unaffected. See L<perllocale/The "use locale" pragma> for details.
70 XXX Any security-related notices go here. In particular, any security
71 vulnerabilities closed should be noted here rather than in the
72 L</Selected Bug Fixes> section.
74 [ List each security issue as a =head2 entry ]
76 =head1 Incompatible Changes
78 XXX For a release on a stable branch, this section aspires to be:
80 There are no changes intentionally incompatible with 5.XXX.XXX
81 If any exist, they are bugs, and we request that you submit a
82 report. See L</Reporting Bugs> below.
84 =head2 C<\N{}> with a sequence of multiple spaces is now a fatal error.
86 This has been deprecated since v5.18.
88 =head2 In double-quotish C<\cI<X>>, I<X> must now be a printable ASCII character
90 In prior releases, failure to do this raised a deprecation warning.
92 =head2 Splitting the tokens C<(?> and C<(*> in regular expressions is
93 now a fatal compilation error.
95 These had been deprecated since v5.18.
97 =head2 5 additional characters are treated as white space under C</x> in
98 regex patterns (unless escaped)
100 The use of these characters with C</x> outside bracketed character
101 classes and when not preceeded by a backslash has raised a deprecation
102 warning since v5.18. Now they will be ignored. See L</qrE<sol>fooE<sol>x>
103 for the list of the five characters.
105 =head2 Comment lines within S<C<(?[ ])>> now are ended only by a C<\n>
107 S<C<(?[ ])>> is an experimental feature, introduced in v5.18. It operates
108 as if C</x> is always enabled. But there was a difference, comment
109 lines (following a C<#> character) were terminated by anything matching
110 C<\R> which includes all vertical whitespace, such as form feeds. For
111 consistency, this is now changed to match what terminates comment lines
112 outside S<C<(?[ ])>>, namely a C<\n> (even if escaped), which is the
113 same as what terminates a heredoc string and formats.
115 =head2 Omitting % and @ on hash and array names is no longer permitted
117 Really old Perl let you omit the @ on array names and the % on hash
118 names in some spots. This has issued a deprecation warning since Perl
119 5.0, and is no longer permitted.
121 =head2 C<"$!"> text is now in English outside C<"use locale"> scope
123 Previously, the text, unlike almost everything else, always came out
124 based on the current underlying locale of the program. (Also affected
125 on some systems is C<"$^E>".) For programs that are unprepared to
126 handle locale, this can cause garbage text to be displayed. It's better
127 to display text that is translatable via some tool than garbage text
128 which is much harder to figure out.
130 =head2 C<"$!"> text will be returned in UTF-8 when appropriate
132 The stringification of C<$!> and C<$^E> will have the UTF-8 flag set
133 when the text is actually non-ASCII UTF-8. This will enable programs
134 that are set up to be locale-aware to properly output messages in the
135 user's native language. Code that needs to continue the 5.20 and
136 earlier behavior can do the stringification within the scopes of both
137 'use bytes' and 'use locale ":messages". No other Perl operations will
138 be affected by locale; only C<$!> and C<$^E> stringification. The
139 'bytes' pragma causes the UTF-8 flag to not be set, just as in previous
140 Perl releases. This resolves [perl #112208].
144 XXX Any deprecated features, syntax, modules etc. should be listed here.
146 =head2 Using a NO-BREAK space in a character alias for C<\N{...}> is now
149 This non-graphic character is essentially indistinguishable from a
150 regular space, and so should not be allowed. See
151 L<charnames/CUSTOM ALIASES>.
153 =head2 A literal C<"{"> should now be escaped in a pattern
155 If you want a literal left curly bracket (also called a left brace) in a
156 regular expression pattern, you should now escape it by either
157 preceding it with a backslash (C<"\{">) or enclosing it within square
158 brackets C<"[{]">, or by using C<\Q>; otherwise a deprecation warning
159 will be raised. This was first announced as forthcoming in the v5.16
160 release; it will allow future extensions to the language to happen.
162 =head2 Module removals
164 XXX Remove this section if inapplicable.
166 The following modules will be removed from the core distribution in a
167 future release, and will at that time need to be installed from CPAN.
168 Distributions on CPAN which require these modules will need to list them as
171 The core versions of these modules will now issue C<"deprecated">-category
172 warnings to alert you to this fact. To silence these deprecation warnings,
173 install the modules in question from CPAN.
175 Note that these are (with rare exceptions) fine modules that you are encouraged
176 to continue to use. Their disinclusion from core primarily hinges on their
177 necessity to bootstrapping a fully functional, CPAN-capable Perl installation,
178 not usually on concerns over their design.
184 XXX Note that deprecated modules should be listed here even if they are listed
185 as an updated module in the L</Modules and Pragmata> section.
189 [ List each other deprecation as a =head2 entry ]
191 =head1 Performance Enhancements
193 XXX Changes which enhance performance without changing behaviour go here.
194 There may well be none in a stable release.
196 [ List each enhancement as a =item entry ]
202 Many internal functions have been refactored to improve performance and reduce
203 their memory footprints.
205 L<[perl #121436]|https://rt.perl.org/Ticket/Display.html?id=121436>
206 L<[perl #121906]|https://rt.perl.org/Ticket/Display.html?id=121906>
207 L<[perl #121969]|https://rt.perl.org/Ticket/Display.html?id=121969>
211 C<-T> and C<-B> filetests will return sooner when an empty file is detected.
213 L<perl #121489|https://rt.perl.org/Ticket/Display.html?id=121489>
217 =head1 Modules and Pragmata
219 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
220 go here. If Module::CoreList is updated, generate an initial draft of the
221 following sections using F<Porting/corelist-perldelta.pl>. A paragraph summary
222 for important changes should then be added by hand. In an ideal world,
223 dual-life modules would have a F<Changes> file that could be cribbed.
225 [ Within each section, list entries as a =item entry ]
227 =head2 New Modules and Pragmata
237 =head2 Updated Modules and Pragmata
243 L<Carp> has been upgraded from version 1.3301 to 1.34.
245 Carp::Heavy now ignores version mismatches with Carp if Carp is newer
246 than 1.12, since Carp::Heavy's guts were merged into Carp at that
248 L<[perl #121574]|https://rt.perl.org/Ticket/Display.html?id=121574>
252 L<Data::Dumper> has been upgraded from version 2.151 to 2.152.
254 Changes to resolve Coverity issues.
256 XS dumps incorrectly stored the name of code references stored in a
258 L<[perl #122070]|https://rt.perl.org/Ticket/Display.html?id=122070>
262 L<Encode> has been upgraded from version 2.60_01 to 2.62.
264 B<piconv> now has better error handling when the encoding name is nonexistent,
265 and a build breakage when upgrading L<Encode> in perl-5.8.2 and earlier has
270 L<Hash::Util> has been upgraded from version 0.16 to 0.17.
272 Minor bug fixes and documentation fixes to Hash::Util::hash_stats()
276 The libnet collection of modules has been upgraded from version 1.25 to 1.27.
278 There are only whitespace changes to the installed files.
282 The Locale-Codes collection of modules has been upgraded from vesion 3.30 to 3.31.
284 Fixed a bug in the scripts used to extract data from spreadsheets that
285 prevented the SHP currency code from being found.
286 L<[cpan #94229]|https://rt.cpan.org/Ticket/Display.html?id=94229>
290 L<Math::BigInt> has been upgraded from version 1.9993 to 1.9994.
292 Synchronize POD changes from the CPAN release.
294 C<< Math::BigFloat->blog(x) >> would sometimes return blog(2*x) when
295 the accuracy was greater than 70 digits.
297 The result of C<< Math::BigFloat->bdiv() >> in list context now
298 satisfies C<< x = quotient * divisor + remainder >>.
302 L<Math::BigRat> has been upgraded from version 0.2606 to 0.2607.
304 Synchronize POD changes from the CPAN release.
308 L<Module::Metadata> has been upgraded from version 1.000022 to 1.000024.
310 Support installations on older perls with an L<ExtUtils::MakeMaker> earlier
315 L<OS2::Process> has been upgraded from version 1.09 to 1.10.
319 L<perl5db.pl> has been upgraded from version 1.44 to 1.45.
321 fork() in the debugger under C<tmux> will now create a new window for
322 the forked process. L<[perl
323 #121333]|https://rt.perl.org/Ticket/Display.html?id=121333>
325 The debugger now saves the current working directory on startup and
326 restores it when you restart your program with C<R> or <rerun>. L<[perl
327 #121509]|https://rt.perl.org/Ticket/Display.html?id=121509>
331 L<PerlIO::encoding> has been upgraded from version 0.18 to 0.19.
333 No changes in behaviour.
337 L<PerlIO::mmap> has been upgraded from version 0.012 to 0.013.
339 No changes in behaviour.
343 L<PerlIO::scalar> has been upgraded from version 0.18 to 0.19.
345 No changes in behaviour.
349 L<Unicode::Collate> has been upgraded from version 1.04 to 1.07.
351 Version 0.67's improved discontiguous contractions is invalidated by default
352 and is supported as a parameter 'long_contraction'.
356 L<Unicode::Normalize> has been upgraded from version 1.17 to 1.18.
358 The XSUB implementation has been removed in favour of pure Perl.
362 A mismatch between the documentation and the code in utf8::downgrade()
363 was fixed in favour of the documentation. The optional second argument
364 is now correctly treated as a perl boolean (true/false semantics) and
369 =head2 Removed Modules and Pragmata
381 XXX Changes to files in F<pod/> go here. Consider grouping entries by
382 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
384 =head2 New Documentation
386 XXX Changes which create B<new> files in F<pod/> go here.
390 XXX Description of the purpose of the new file here
392 =head2 Changes to Existing Documentation
394 XXX Changes which significantly change existing files in F<pod/> go here.
395 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
404 C<-l> now notes that it will return false if symlinks aren't supported by the
407 L<[perl #121523]|https://rt.perl.org/Ticket/Display.html?id=121523>
411 Note that C<exec LIST> and C<system LIST> may fall back to the shell on
412 Win32. Only C<exec PROGRAM LIST> and C<system PROGRAM LIST> indirect object
413 syntax will reliably avoid using the shell.
415 This has also been noted in L<perlport>.
417 L<[perl #122046]|https://rt.perl.org/Ticket/Display.html?id=122046>
427 C<sv_usepvn_flags> - Fix documentation to mention the use of C<NewX> instead of
430 L<[perl #121869]|https://rt.perl.org/Ticket/Display.html?id=121869>
434 Clarify where C<NUL> may be embedded or is required to terminate a string.
438 Previously missing documentation due to formatting errors are now included.
442 Entries are now organized into groups rather than by file where they are found.
446 Alphabetical sorting of entries is now handled by the POD generator to make
447 entries easier to find when scanning.
451 =head3 L<perlhacktips>
457 Updated documentation for the C<test.valgrind> C<make> target.
459 L<[perl #121431]|https://rt.perl.org/Ticket/Display.html?id=121431>
469 The C</x> modifier has been clarified to note that comments cannot be continued
470 onto the next line by escaping them.
474 =head3 L<Unicode::UCD>
480 The documentation includes many clarifications and fixes.
486 The following additions or changes have been made to diagnostic output,
487 including warnings and fatal error messages. For the complete list of
488 diagnostic messages, see L<perldiag>.
490 XXX New or changed warnings emitted by the core's C<C> code go here. Also
491 include any changes in L<perldiag> that reconcile it to the C<C> code.
493 =head2 New Diagnostics
495 XXX Newly added diagnostic messages go under here, separated into New Errors
504 XXX L<message|perldiag/"message">
514 L<PerlIO layer ':win32' is experimental|perldiag/"PerlIO layer ':win32' is experimental">:
516 (S experimental::win32_perlio) The C<:win32> PerlIO layer is
517 experimental. If you want to take the risk of using this layer,
518 simply disable this warning:
520 no warnings "experimental::win32_perlio";
524 =head2 Changes to Existing Diagnostics
526 XXX Changes (i.e. rewording) of diagnostic messages go here
534 This warning has been changed to
535 L<< <> at require-statement should be quotes|perldiag/"<> at require-statement should be quotes" >>
536 to make the issue more identifiable.
540 L<Unsuccessful %s on filename containing newline|perldiag/"Unsuccessful %s on filename containing newline">
542 This warning is now only produced when the newline is at the end of
547 =head1 Utility Changes
549 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
550 Most of these are built within the directory F<utils>.
552 [ List utility changes as a =head2 entry for each utility and =item
553 entries for each change
554 Use L<XXX> with program names to get proper documentation linking. ]
562 The F<x2p/> directory has been removed from the Perl core.
564 This removes find2perl, s2p and a2p. They have all been released to CPAN as
565 separate distributions (App::find2perl, App::s2p, App::a2p).
569 =head1 Configuration and Compilation
571 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
572 go here. Any other changes to the Perl build process should be listed here.
573 However, any platform-specific changes should be listed in the
574 L</Platform Support> section, instead.
576 [ List changes as a =item entry ].
582 C<make test.valgrind> now supports parallel testing.
586 TEST_JOBS=9 make test.valgrind
588 See L<perlhacktips/valgrind> for more information.
590 L<[perl #121431]|https://rt.perl.org/Ticket/Display.html?id=121431>
596 XXX Any significant changes to the testing of a freshly built perl should be
597 listed here. Changes which create B<new> files in F<t/> go here as do any
598 large changes to the testing harness (e.g. when parallel testing was added).
599 Changes to existing files in F<t/> aren't worth summarizing, although the bugs
600 that they represent may be covered elsewhere.
602 [ List each test improvement as a =item entry ]
612 =head1 Platform Support
614 XXX Any changes to platform support should be listed in the sections below.
616 [ Within the sections, list each platform as a =item entry with specific
617 changes as paragraphs below it. ]
621 XXX List any platforms that this version of perl compiles on, that previous
622 versions did not. These will either be enabled by new files in the F<hints/>
623 directories, or new subdirectories and F<README> files at the top level of the
628 =item XXX-some-platform
634 =head2 Discontinued Platforms
636 XXX List any platforms that this version of perl no longer compiles on.
640 =item NeXTSTEP/OPENSTEP
642 NeXTSTEP was proprietary OS bundled with NeXT's workstations in the early
643 to mid 90's; OPENSTEP was an API specification that provided a NeXTSTEP-like
644 environment on a non-NeXTSTEP system. Both are now long dead, so support
645 for building Perl on them has been removed.
649 =head2 Platform-Specific Notes
651 XXX List any changes for specific platforms. This could include configuration
652 and compilation changes or changes in portability/compatibility. However,
653 changes within modules for platforms should generally be listed in the
654 L</Modules and Pragmata> section.
658 =item XXX-some-platform
664 On OpenBSD, Perl will now default to using the system C<malloc> due to the
665 security features it provides. Perl's own malloc wrapper has been in use
666 since v5.14 due to performance reasons, but the OpenBSD project believes
667 the tradeoff is worth it and would prefer that users who need the speed
668 specifically ask for it.
670 L<[perl #122000]|https://rt.perl.org/Ticket/Display.html?id=122000>.
674 =head1 Internal Changes
676 XXX Changes which affect the interface available to C<XS> code go here. Other
677 significant internal changes for future core maintainers should be noted as
684 The deprecated variable C<PL_sv_objcount> has been removed.
688 Perl now tries to keep the locale category C<LC_NUMERIC> set to "C"
689 except around operations that need it to be set to the program's
690 underlying locale. This protects the many XS modules that cannot cope
691 with the decimal radix character not being a dot. Prior to this
692 release, Perl initialized this category to "C", but a call to
693 C<POSIX::setlocale()> would change it. Now such a call will change the
694 underlying locale of the C<LC_NUMERIC> category for the program, but the
695 locale exposed to XS code will remain "C". There is an API under
696 development for those relatively few modules that need to use the
697 underlying locale. This API will be nailed down during the course of
698 developing v5.21. Send email to L<mailto:perl5-porters@perl.org> for
703 =head1 Selected Bug Fixes
705 XXX Important bug fixes in the core language are summarized here. Bug fixes in
706 files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
708 [ List each fix as a =item entry ]
714 index() and rindex() no longer crash when used on strings over 2GB in
716 L<[perl #121562]|https://rt.perl.org/Ticket/Display.html?id=121562>.
720 A small previously intentional memory leak in PERL_SYS_INIT/PERL_SYS_INIT3 on
721 Win32 builds was fixed. This might affect embedders who repeatedly create and
722 destroy perl engines within the same process.
726 C<POSIX::localeconv()> now returns the data for the program's underlying
727 locale even when called from outside the scope of S<C<use locale>>.
731 C<POSIX::localeconv()> now works properly on platforms which don't have
732 C<LC_NUMERIC> and/or C<LC_MONETARY>, or for which Perl has been compiled
733 to disregard either or both of these locale categories. In such
734 circumstances, there are now no entries for the corresponding values in
735 the hash returned by C<localeconv()>.
739 C<POSIX::localeconv()> now marks appropriately the values it returns as
740 UTF-8 or not. Previously they were always returned as a bytes, even if
741 they were supposed to be encoded as UTF-8.
745 On Microsoft Windows, within the scope of C<S<use locale>>, the following
746 POSIX character classes gave results for many locales that did not
747 conform to the POSIX standard:
760 These are because the underlying Microsoft implementation does not
761 follow the standard. Perl now takes special precautions to correct for
766 Many issues have been detected by L<Coverity|http://www.coverity.com/> and
771 system() and friends should now work properly on more Android builds.
773 Due to an oversight, the value specified through -Dtargetsh to Configure
774 would end up being ignored by some of the build process. This caused perls
775 cross-compiled for Android to end up with defective versions of system(),
776 exec() and backticks: the commands would end up looking for C</bin/sh>
777 instead of C</system/bin/sh>, and so would fail for the vast majority
778 of devices, leaving C<$!> as C<ENOENT>.
782 C<qr(...\(...\)...)>,
783 C<qr[...\[...\]...]>,
786 now work. Previously it was impossible to escape these three
787 left-characters with a backslash within a regular expression pattern
788 where otherwise they would be considered metacharacters, and the pattern
789 opening delimiter was the character, and the closing delimiter was its
794 =head1 Known Problems
796 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
797 tests that had to be C<TODO>ed for the release would be noted here. Unfixed
798 platform specific bugs also go here.
800 [ List each fix as a =item entry ]
810 =head1 Errata From Previous Releases
816 XXX Add anything here that we forgot to add, or were mistaken about, in
817 the perldelta of a previous release.
823 XXX If any significant core contributor has died, we've added a short obituary
826 =head1 Acknowledgements
828 XXX Generate this with:
830 perl Porting/acknowledgements.pl v5.21.1..HEAD
832 =head1 Reporting Bugs
834 If you find what you think is a bug, you might check the articles recently
835 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
836 https://rt.perl.org/ . There may also be information at
837 http://www.perl.org/ , the Perl Home Page.
839 If you believe you have an unreported bug, please run the L<perlbug> program
840 included with your release. Be sure to trim your bug down to a tiny but
841 sufficient test case. Your bug report, along with the output of C<perl -V>,
842 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
844 If the bug you are reporting has security implications, which make it
845 inappropriate to send to a publicly archived mailing list, then please send it
846 to perl5-security-report@perl.org. This points to a closed subscription
847 unarchived mailing list, which includes all the core committers, who will be
848 able to help assess the impact of issues, figure out a resolution, and help
849 co-ordinate the release of patches to mitigate or fix the problem across all
850 platforms on which Perl is supported. Please only use this address for
851 security issues in the Perl core, not for modules independently distributed on
856 The F<Changes> file for an explanation of how to view exhaustive details on
859 The F<INSTALL> file for how to build Perl.
861 The F<README> file for general stuff.
863 The F<Artistic> and F<Copying> files for copyright information.