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.27.6
12 This document describes differences between the 5.27.5 release and the 5.27.6
15 If you are upgrading from an earlier release such as 5.27.4, first read
16 L<perl5275delta>, which describes differences between 5.27.4 and 5.27.5.
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 Initialisation of aggregate state variables
32 A persistent lexical array or hash variable can now be initialized,
33 by an expression such as C<state @a = qw(x y z)>. Initialization of a
34 list of persistent lexical variables is still not possible.
36 =head2 Full-size inode numbers
38 On platforms where inode numbers are of a type larger than perl's native
39 integer numerical types, L<stat|perlfunc/stat> will preserve the full
40 content of large inode numbers by returning them in the form of strings of
41 decimal digits. Exact comparison of inode numbers can thus be achieved by
42 comparing with C<eq> rather than C<==>. Comparison with C<==>, and other
43 numerical operations (which are usually meaningless on inode numbers),
44 work as well as they did before, which is to say they fall back to
45 floating point, and ultimately operate on a fairly useless rounded inode
46 number if the real inode number is too big for the floating point format.
50 XXX Any security-related notices go here. In particular, any security
51 vulnerabilities closed should be noted here rather than in the
52 L</Selected Bug Fixes> section.
54 [ List each security issue as a =head2 entry ]
56 =head1 Incompatible Changes
58 XXX For a release on a stable branch, this section aspires to be:
60 There are no changes intentionally incompatible with 5.XXX.XXX
61 If any exist, they are bugs, and we request that you submit a
62 report. See L</Reporting Bugs> below.
64 [ List each incompatible change as a =head2 entry ]
66 =head2 Yada-yada is now strictly a statement
68 By the time of its initial stable release in Perl 5.12, the C<...>
69 (yada-yada) operator was explicitly intended to serve as a statement,
70 not an expression. However, the original implementation was confused
71 on this point, leading to inconsistent parsing. The operator was
72 accidentally accepted in a few situations where it did not serve as a
73 complete statement, such as
78 The parsing has now been made consistent, permitting yada-yada only as
79 a statement. Affected code can use C<do{...}> to put a yada-yada into
80 an arbitrary expression context.
82 =head2 Subroutines no longer need typeglobs
84 Perl 5.22.0 introduced an optimization allowing subroutines to be stored in
85 packages as simple sub refs, not requiring a full typeglob (thus
86 potentially saving large amounts of memeory). However, the optimization
87 was flawed: it only applied to the main package.
89 This optimization has now been extended to all packages. This may break
90 compatibility with introspection code that looks inside stashes and expects
91 everything in them to be a typeglob.
93 When this optimization happens, the typeglob still notionally exists, so
94 accessing it will cause the stash entry to be upgraded to a typeglob. The
95 optimization does not apply to XSUBs or exported subroutines, and calling a
96 method will undo it, since method calls cache things in typeglobs.
98 [perl #129916] [perl #132252]
100 =head2 Sort algorithm can no longer be specified
102 Since Perl 5.8, the L<sort> pragma has had subpragmata C<_mergesort>,
103 C<_quicksort>, and C<_qsort> that can be used to specify which algorithm
104 perl should use to implement the L<sort|perlfunc/sort> builtin.
105 This was always considered a dubious feature that might not last,
106 hence the underscore spellings, and they were documented as not being
107 portable beyond Perl 5.8. These subpragmata have now been deleted,
108 and any attempt to use them is an error. The L<sort> pragma otherwise
109 remains, and the algorithm-neutral C<stable> subpragma can be used to
110 control sorting behaviour.
114 XXX Any deprecated features, syntax, modules etc. should be listed here.
116 =head2 Module removals
118 XXX Remove this section if inapplicable.
120 The following modules will be removed from the core distribution in a
121 future release, and will at that time need to be installed from CPAN.
122 Distributions on CPAN which require these modules will need to list them as
125 The core versions of these modules will now issue C<"deprecated">-category
126 warnings to alert you to this fact. To silence these deprecation warnings,
127 install the modules in question from CPAN.
129 Note that these are (with rare exceptions) fine modules that you are encouraged
130 to continue to use. Their disinclusion from core primarily hinges on their
131 necessity to bootstrapping a fully functional, CPAN-capable Perl installation,
132 not usually on concerns over their design.
138 XXX Note that deprecated modules should be listed here even if they are listed
139 as an updated module in the L</Modules and Pragmata> section.
143 [ List each other deprecation as a =head2 entry ]
145 =head1 Performance Enhancements
147 XXX Changes which enhance performance without changing behaviour go here.
148 There may well be none in a stable release.
150 [ List each enhancement as an =item entry ]
156 Many string concatenation expressions are now considerably faster, due
157 to the introduction internally of a C<multiconcat> opcode which combines
158 multiple concatenations, and optionally a C<=> or C<.=>, into a single
159 action. For example, apart from retrieving C<$s>, C<$a> and C<$b>, this
160 whole expression is now handled as a single op:
164 As a special case, if the LHS of an assign is a lexical variable or
165 C<my $s>, the op itself handles retrieving the lexical variable, which
168 In general, the more the expression includes a mix of constant strings and
169 variable expressions, the longer the expression, and the more it mixes
170 together non-utf8 and utf8 strings, the more marked the performance
171 improvement. For example on a C<x86_64> system, this code has been
172 benchmarked running four times faster:
175 my $a = "ab\x{100}cde";
177 my $c = "\x{101}klmn";
179 for my $i (1..10_000_000) {
181 $s .= "foo=$a bar=$b baz=$c";
184 In addition, C<sprintf> expressions which have a constant format
185 containing only C<%s> and C<%%> format elements, and which have a fixed
186 number of arguments, are now also optimised into a C<multiconcat> op.
190 Subroutines in packages no longer need to be stored in typeglobs, saving
191 large amounts of memory. See L</Subroutines no longer need typeglobs>
192 under L</Incompatible Changes>, above.
196 =head1 Modules and Pragmata
198 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
199 go here. If Module::CoreList is updated, generate an initial draft of the
200 following sections using F<Porting/corelist-perldelta.pl>. A paragraph summary
201 for important changes should then be added by hand. In an ideal world,
202 dual-life modules would have a F<Changes> file that could be cribbed.
204 The list of new and updated modules is modified automatically as part of
205 preparing a Perl release, so the only reason to manually add entries here is if
206 you're summarising the important changes in the module update. (Also, if the
207 manually-added details don't match the automatically-generated ones, the
208 release manager will have to investigate the situation carefully.)
210 [ Within each section, list entries as an =item entry ]
212 =head2 Removal of use vars
216 The usage of "use vars" has been discouraged since the introduction of our in
217 Perl 5.6.0. Where possible the usage of this pragma has now been removed from
218 the Perl source code.
220 This had a slight effect (for the better) on the output of WARNING_BITS in B::Deparse.
224 =head2 New Modules and Pragmata
234 =head2 Updated Modules and Pragmata
240 L<Carp> has been upgraded from version 1.43 to 1.44.
242 If a package on the call stack contains a constant named C<ISA>, Carp no
243 longer throws a "Not a GLOB reference" error.
247 L<File::Copy> has been upgraded from version 2.32 to 2.33. It will now use
248 Time::HiRes utime where available (RT #132401).
252 To address a security vulnerability in older versions of the 'zlib' library
253 (which is bundled with Compress-Raw-Zlib), L<Compress::Raw::Zlib> has been
254 upgraded to CPAN version 2.075.
258 L<Test::Simple> has been upgraded from version 1.302103 to 1.302111.
262 =head2 Removed Modules and Pragmata
274 XXX Changes to files in F<pod/> go here. Consider grouping entries by
275 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
277 =head2 New Documentation
279 XXX Changes which create B<new> files in F<pod/> go here.
283 XXX Description of the purpose of the new file here
285 =head2 Changes to Existing Documentation
287 We have attempted to update the documentation to reflect the changes
288 listed in this document. If you find any we have missed, send email
289 to L<perlbug@perl.org|mailto:perlbug@perl.org>.
291 XXX Changes which significantly change existing files in F<pod/> go here.
292 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
295 Additionally, the following selected changes have been made:
299 =item * L<perldiag/Variable length lookbehind not implemented in regex m/%s/>
301 This now gives more ideas as to workarounds to the issue that was
302 introduced in Perl 5.18 (but not documented explicitly in its perldelta)
303 for the fact that some Unicode C</i> rules cause a few sequences such as
307 to be considered variable length, and hence disallowed.
311 The section on reference counting in L<perlguts> has been heavily revised,
312 to describe references in the way a programmer needs to think about them
313 rather than in terms of the physical data structures.
317 The section "Truth and Falsehood" in L<perlsyn> has been removed from
318 that document, where it didn't belong, and merged into the existing
319 paragraph on the same topic in L<perldata>.
323 The description of the C<x> operator in L<perlop> has been clarified.
327 L<perluniprops> has been updated to note that C<\p{Word}> now includes
328 code points matching the C<\p{Join_Control}> property. The change to
329 the property was made in Perl 5.18, but not documented until now. There
330 are currently only two code points that match this property U+200C (ZERO
331 WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER).
337 The following additions or changes have been made to diagnostic output,
338 including warnings and fatal error messages. For the complete list of
339 diagnostic messages, see L<perldiag>.
341 XXX New or changed warnings emitted by the core's C<C> code go here. Also
342 include any changes in L<perldiag> that reconcile it to the C<C> code.
344 =head2 New Diagnostics
346 XXX Newly added diagnostic messages go under here, separated into New Errors
355 XXX L<message|perldiag/"message">
365 XXX L<message|perldiag/"message">
369 =head2 Changes to Existing Diagnostics
371 XXX Changes (i.e. rewording) of diagnostic messages go here
377 The diagnostic C<Initialization of state variables in list context
378 currently forbidden> has changed to C<Initialization of state variables
379 in list currently forbidden>, because list-context initialization of
380 single aggregate state variables is now permitted.
384 XXX Describe change here
388 =head1 Utility Changes
390 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
391 Most of these are built within the directory F<utils>.
393 [ List utility changes as a =head2 entry for each utility and =item
394 entries for each change
395 Use L<XXX> with program names to get proper documentation linking. ]
407 =head1 Configuration and Compilation
409 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
410 go here. Any other changes to the Perl build process should be listed here.
411 However, any platform-specific changes should be listed in the
412 L</Platform Support> section, instead.
414 [ List changes as an =item entry ].
418 =item C89 requirement
420 Perl has been documented as requiring a C89 compiler to build since October
421 1998. A variety of simplifications have now been made to Perl's internals to
422 rely on the features specified by the C89 standard. We believe that this
423 internal change hasn't altered the set of platforms that Perl builds on, but
424 please report a bug if Perl now has new problems building on your platform.
430 =item HAS_BUILTIN_ADD_OVERFLOW
432 =item HAS_BUILTIN_MUL_OVERFLOW
434 =item HAS_BUILTIN_SUB_OVERFLOW
436 =item HAS_THREAD_SAFE_NL_LANGINFO_L
438 =item HAS_LOCALECONV_L
460 XXX Any significant changes to the testing of a freshly built perl should be
461 listed here. Changes which create B<new> files in F<t/> go here as do any
462 large changes to the testing harness (e.g. when parallel testing was added).
463 Changes to existing files in F<t/> aren't worth summarizing, although the bugs
464 that they represent may be covered elsewhere.
466 XXX If there were no significant test changes, say this:
468 Tests were added and changed to reflect the other additions and changes
471 XXX If instead there were significant changes, say this:
473 Tests were added and changed to reflect the other additions and
474 changes in this release. Furthermore, these significant changes were
477 [ List each test improvement as an =item entry ]
489 For the past few years we have released perl using three different archive
490 formats: bzip (C<.bz2>), LZMA2 (C<.xz>) and gzip (C<.gz>). Since xz compresses
491 better and decompresses faster, and gzip is more compatible and uses less memory,
492 we have dropped the C<.bz2> archive format with this release.
493 (If this poses a problem, do let us know; see L</Reporting Bugs>, below.)
495 =head1 Platform Support
497 XXX Any changes to platform support should be listed in the sections below.
499 [ Within the sections, list each platform as an =item entry with specific
500 changes as paragraphs below it. ]
504 XXX List any platforms that this version of perl compiles on, that previous
505 versions did not. These will either be enabled by new files in the F<hints/>
506 directories, or new subdirectories and F<README> files at the top level of the
511 =item XXX-some-platform
517 =head2 Discontinued Platforms
519 XXX List any platforms that this version of perl no longer compiles on.
523 =item XXX-some-platform
529 =head2 Platform-Specific Notes
531 XXX List any changes for specific platforms. This could include configuration
532 and compilation changes or changes in portability/compatibility. However,
533 changes within modules for platforms should generally be listed in the
534 L</Modules and Pragmata> section.
540 Visual C++ compiler version detection has been improved to work on non-English
545 =head1 Internal Changes
547 XXX Changes which affect the interface available to C<XS> code go here. Other
548 significant internal changes for future core maintainers should be noted as
551 [ List each change as an =item entry ]
557 A new optimisation phase has been added to the compiler,
558 C<optimize_optree()>, which does a top-down scan of a complete optree
559 just before the peephole optimiser is run. This phase is not currently
564 An C<OP_MULTICONCAT> op has been added. At C<optimize_optree()> time, a
565 chain of C<OP_CONCAT> and C<OP_CONST> ops, together optionally with an
566 C<OP_STRINGIFY> and/or C<OP_SASSIGN>, are combined into a single
567 C<OP_MULTICONCAT> op. The op is of type C<UNOP_AUX>, and the aux array
568 contains the argument count, plus a pointer to a constant string and a set
569 of segment lengths. For example with
571 my $x = "foo=$foo, bar=$bar\n";
573 the constant string would be C<"foo=, bar=\n"> and the segment lengths
574 would be (4,6,1). If the string contains characters such as C<\x80>, whose
575 representation changes under utf8, two sets of strings plus lengths are
576 precomputed and stored.
580 Direct access to L<C<PL_keyword_plugin>|perlapi/PL_keyword_plugin> is not
581 safe in the presence of multithreading. A new
582 L<C<wrap_keyword_plugin>|perlapi/wrap_keyword_plugin> function has been
583 added to allow XS modules to safely define custom keywords even when
584 loaded from a thread, analoguous to L<C<PL_check>|perlapi/PL_check> /
585 L<C<wrap_op_checker>|perlapi/wrap_op_checker>.
589 =head1 Selected Bug Fixes
591 XXX Important bug fixes in the core language are summarized here. Bug fixes in
592 files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
594 [ List each fix as an =item entry ]
600 C<stat()>, C<lstat()>, and file test operators now fail if given a
601 filename containing a nul character, in the same way that C<open()>
606 C<stat()>, C<lstat()>, and file test operators now reliably set C<$!> when
607 failing due to being applied to a closed or otherwise invalid file handle.
611 File test operators for Unix permission bits that don't exist on a
612 particular platform, such as C<-k> (sticky bit) on Windows, now check that
613 the file being tested exists before returning the blanket false result,
614 and yield the appropriate errors if the argument doesn't refer to a file.
618 The in-place reverse optimisation now correctly strengthens weak
619 references using the L<C<sv_rvunweaken()>|perlapi/sv_rvunweaken>
624 Fixed a read before buffer when parsing a range starting with C<\N{}>
625 at the beginning of the character set for the transliteration
626 operator. [perl #132245]
630 Fixed a leaked SV when parsing an empty C<\N{}> at compile-time.
635 Calling C<do $path> on a directory or block device now yields a meaningful
636 error code in C<$!>. [perl #125774]
640 Regexp substitution using an overloaded replacement value that provides
641 a tainted stringification now correctly taints the resulting string.
646 Lexical sub declarations in C<do> blocks such as C<do { my sub lex; 123 }>
647 could corrupt the stack, erasing items already on the stack in the
648 enclosing statement. This has been fixed. [perl #132442]
652 =head1 Known Problems
654 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
655 tests that had to be C<TODO>ed for the release would be noted here. Unfixed
656 platform specific bugs also go here.
658 [ List each fix as an =item entry ]
668 =head1 Errata From Previous Releases
674 XXX Add anything here that we forgot to add, or were mistaken about, in
675 the perldelta of a previous release.
681 XXX If any significant core contributor has died, we've added a short obituary
684 =head1 Acknowledgements
686 XXX Generate this with:
688 perl Porting/acknowledgements.pl v5.27.5..HEAD
690 =head1 Reporting Bugs
692 If you find what you think is a bug, you might check the perl bug database
693 at L<https://rt.perl.org/> . There may also be information at
694 L<http://www.perl.org/> , the Perl Home Page.
696 If you believe you have an unreported bug, please run the L<perlbug> program
697 included with your release. Be sure to trim your bug down to a tiny but
698 sufficient test case. Your bug report, along with the output of C<perl -V>,
699 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
701 If the bug you are reporting has security implications which make it
702 inappropriate to send to a publicly archived mailing list, then see
703 L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
704 for details of how to report the issue.
708 If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
709 you can do so by running the C<perlthanks> program:
713 This will send an email to the Perl 5 Porters list with your show of thanks.
717 The F<Changes> file for an explanation of how to view exhaustive details on
720 The F<INSTALL> file for how to build Perl.
722 The F<README> file for general stuff.
724 The F<Artistic> and F<Copying> files for copyright information.