This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for perluniprops change
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
e6a2e5ca
SH
5[ this is a template for a new perldelta file. Any text flagged as XXX needs
6to be processed before release. ]
7
8perldelta - what is new for perl v5.27.6
89853d76 9
b5cbfe35 10=head1 DESCRIPTION
89853d76 11
e6a2e5ca 12This document describes differences between the 5.27.5 release and the 5.27.6
b5cbfe35 13release.
89853d76 14
e6a2e5ca
SH
15If you are upgrading from an earlier release such as 5.27.4, first read
16L<perl5275delta>, which describes differences between 5.27.4 and 5.27.5.
17
18=head1 Notice
19
20XXX Any important notices here
21
22=head1 Core Enhancements
23
24XXX New core language features go here. Summarize user-visible core language
25enhancements. Particularly prominent performance optimisations could go
26here, but most should go in the L</Performance Enhancements> section.
27
28[ List each enhancement as a =head2 entry ]
29
f99042c8
Z
30=head2 Initialisation of aggregate state variables
31
32A persistent lexical array or hash variable can now be initialized,
33by an expression such as C<state @a = qw(x y z)>. Initialization of a
34list of persistent lexical variables is still not possible.
35
2e8ea15a
Z
36=head2 Full-size inode numbers
37
38On platforms where inode numbers are of a type larger than perl's native
39integer numerical types, L<stat|perlfunc/stat> will preserve the full
40content of large inode numbers by returning them in the form of strings of
41decimal digits. Exact comparison of inode numbers can thus be achieved by
42comparing with C<eq> rather than C<==>. Comparison with C<==>, and other
43numerical operations (which are usually meaningless on inode numbers),
44work as well as they did before, which is to say they fall back to
45floating point, and ultimately operate on a fairly useless rounded inode
46number if the real inode number is too big for the floating point format.
47
e6a2e5ca
SH
48=head1 Security
49
50XXX Any security-related notices go here. In particular, any security
51vulnerabilities closed should be noted here rather than in the
52L</Selected Bug Fixes> section.
53
54[ List each security issue as a =head2 entry ]
55
56=head1 Incompatible Changes
57
58XXX For a release on a stable branch, this section aspires to be:
59
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.
63
64[ List each incompatible change as a =head2 entry ]
65
29d69c3c
Z
66=head2 Yada-yada is now strictly a statement
67
68By 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,
70not an expression. However, the original implementation was confused
71on this point, leading to inconsistent parsing. The operator was
72accidentally accepted in a few situations where it did not serve as a
73complete statement, such as
74
75 ... . "foo";
76 ... if $a < $b;
77
78The parsing has now been made consistent, permitting yada-yada only as
79a statement. Affected code can use C<do{...}> to put a yada-yada into
80an arbitrary expression context.
81
7d65f652
FC
82=head2 Subroutines no longer need typeglobs
83
84Perl 5.22.0 introduced an optimization allowing subroutines to be stored in
85packages as simple sub refs, not requiring a full typeglob (thus
86potentially saving large amounts of memeory). However, the optimization
87was flawed: it only applied to the main package.
88
89This optimization has now been extended to all packages. This may break
90compatibility with introspection code that looks inside stashes and expects
91everything in them to be a typeglob.
92
93When this optimization happens, the typeglob still notionally exists, so
94accessing it will cause the stash entry to be upgraded to a typeglob. The
95optimization does not apply to XSUBs or exported subroutines, and calling a
96method will undo it, since method calls cache things in typeglobs.
97
98[perl #129916] [perl #132252]
99
e2091bb6
Z
100=head2 Sort algorithm can no longer be specified
101
102Since Perl 5.8, the L<sort> pragma has had subpragmata C<_mergesort>,
103C<_quicksort>, and C<_qsort> that can be used to specify which algorithm
104perl should use to implement the L<sort|perlfunc/sort> builtin.
105This was always considered a dubious feature that might not last,
106hence the underscore spellings, and they were documented as not being
107portable beyond Perl 5.8. These subpragmata have now been deleted,
108and any attempt to use them is an error. The L<sort> pragma otherwise
109remains, and the algorithm-neutral C<stable> subpragma can be used to
110control sorting behaviour.
111
e6a2e5ca
SH
112=head1 Deprecations
113
114XXX Any deprecated features, syntax, modules etc. should be listed here.
115
116=head2 Module removals
117
118XXX Remove this section if inapplicable.
119
120The following modules will be removed from the core distribution in a
121future release, and will at that time need to be installed from CPAN.
122Distributions on CPAN which require these modules will need to list them as
123prerequisites.
124
125The core versions of these modules will now issue C<"deprecated">-category
126warnings to alert you to this fact. To silence these deprecation warnings,
127install the modules in question from CPAN.
128
129Note that these are (with rare exceptions) fine modules that you are encouraged
130to continue to use. Their disinclusion from core primarily hinges on their
131necessity to bootstrapping a fully functional, CPAN-capable Perl installation,
132not usually on concerns over their design.
133
134=over
135
136=item XXX
137
138XXX Note that deprecated modules should be listed here even if they are listed
139as an updated module in the L</Modules and Pragmata> section.
140
141=back
142
143[ List each other deprecation as a =head2 entry ]
a8ba758d 144
cf663f87
AC
145=head1 Performance Enhancements
146
e6a2e5ca
SH
147XXX Changes which enhance performance without changing behaviour go here.
148There may well be none in a stable release.
149
150[ List each enhancement as an =item entry ]
151
1b510166
S
152=over 4
153
154=item *
155
8ed1839e
DM
156Many string concatenation expressions are now considerably faster, due
157to the introduction internally of a C<multiconcat> opcode which combines
158multiple concatenations, and optionally a C<=> or C<.=>, into a single
159action. For example, apart from retrieving C<$s>, C<$a> and C<$b>, this
160whole expression is now handled as a single op:
161
162 $s .= "a=$a b=$b\n"
163
164As a special case, if the LHS of an assign is a lexical variable or
165C<my $s>, the op itself handles retrieving the lexical variable, which
166is faster.
167
168In general, the more the expression includes a mix of constant strings and
169variable expressions, the longer the expression, and the more it mixes
170together non-utf8 and utf8 strings, the more marked the performance
171improvement. For example on a C<x86_64> system, this code has been
172benchmarked running four times faster:
173
174 my $s;
175 my $a = "ab\x{100}cde";
176 my $b = "fghij";
177 my $c = "\x{101}klmn";
178
179 for my $i (1..10_000_000) {
180 $s = "\x{100}wxyz";
181 $s .= "foo=$a bar=$b baz=$c";
182 }
183
184In addition, C<sprintf> expressions which have a constant format
185containing only C<%s> and C<%%> format elements, and which have a fixed
186number of arguments, are now also optimised into a C<multiconcat> op.
d912eab8 187
7d65f652
FC
188=item *
189
190Subroutines in packages no longer need to be stored in typeglobs, saving
191large amounts of memory. See L</Subroutines no longer need typeglobs>
192under L</Incompatible Changes>, above.
193
c83a3d01 194=back
d912eab8 195
c83a3d01 196=head1 Modules and Pragmata
af94b3ac 197
e6a2e5ca
SH
198XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
199go here. If Module::CoreList is updated, generate an initial draft of the
200following sections using F<Porting/corelist-perldelta.pl>. A paragraph summary
201for important changes should then be added by hand. In an ideal world,
202dual-life modules would have a F<Changes> file that could be cribbed.
203
204The list of new and updated modules is modified automatically as part of
205preparing a Perl release, so the only reason to manually add entries here is if
206you're summarising the important changes in the module update. (Also, if the
207manually-added details don't match the automatically-generated ones, the
208release manager will have to investigate the situation carefully.)
209
210[ Within each section, list entries as an =item entry ]
211
9b78f210
TR
212=head2 Removal of use vars
213
214=over 4
215
216The usage of "use vars" has been discouraged since the introduction of our in
217Perl 5.6.0. Where possible the usage of this pragma has now been removed from
218the Perl source code.
219
1218f5ba
TR
220This had a slight effect (for the better) on the output of WARNING_BITS in B::Deparse.
221
9b78f210
TR
222=back
223
e6a2e5ca 224=head2 New Modules and Pragmata
a8ba758d
JSA
225
226=over 4
ba2fe89f
AC
227
228=item *
229
e6a2e5ca 230XXX
64b9a139 231
e6a2e5ca 232=back
64b9a139 233
e6a2e5ca
SH
234=head2 Updated Modules and Pragmata
235
236=over 4
64b9a139
SH
237
238=item *
239
b5af74de
FC
240L<Carp> has been upgraded from version 1.43 to 1.44.
241
242If a package on the call stack contains a constant named C<ISA>, Carp no
243longer throws a "Not a GLOB reference" error.
64b9a139 244
d7408e7a
JK
245=item *
246
247L<File::Copy> has been upgraded from version 2.32 to 2.33. It will now use
248Time::HiRes utime where available (RT #132401).
249
ad3f654c
JK
250=item *
251
252To 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
254upgraded to CPAN version 2.075.
255
7358a033
JK
256=item *
257
258L<Test::Simple> has been upgraded from version 1.302103 to 1.302111.
259
e6a2e5ca 260=back
64b9a139 261
e6a2e5ca
SH
262=head2 Removed Modules and Pragmata
263
264=over 4
64b9a139
SH
265
266=item *
267
e6a2e5ca 268XXX
64b9a139 269
e6a2e5ca 270=back
64b9a139 271
e6a2e5ca 272=head1 Documentation
64b9a139 273
e6a2e5ca
SH
274XXX Changes to files in F<pod/> go here. Consider grouping entries by
275file and be sure to link to the appropriate page, e.g. L<perlfunc>.
64b9a139 276
e6a2e5ca 277=head2 New Documentation
64b9a139 278
e6a2e5ca 279XXX Changes which create B<new> files in F<pod/> go here.
64b9a139 280
e6a2e5ca 281=head3 L<XXX>
64b9a139 282
e6a2e5ca 283XXX Description of the purpose of the new file here
64b9a139 284
e6a2e5ca 285=head2 Changes to Existing Documentation
64b9a139 286
e6a2e5ca
SH
287We have attempted to update the documentation to reflect the changes
288listed in this document. If you find any we have missed, send email
289to L<perlbug@perl.org|mailto:perlbug@perl.org>.
64b9a139 290
e6a2e5ca
SH
291XXX Changes which significantly change existing files in F<pod/> go here.
292However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
293section.
64b9a139 294
e6a2e5ca
SH
295Additionally, the following selected changes have been made:
296
04f89ea7
Z
297=over 4
298
299=item * L<perldiag/Variable length lookbehind not implemented in regex m/%s/>
754dd754
KW
300
301This now gives more ideas as to workarounds to the issue that was
302introduced in Perl 5.18 (but not documented explicitly in its perldelta)
303for the fact that some Unicode C</i> rules cause a few sequences such as
304
305 (?<!st)
306
307to be considered variable length, and hence disallowed.
64b9a139 308
64b9a139
SH
309=item *
310
2b8b74b0
Z
311The section on reference counting in L<perlguts> has been heavily revised,
312to describe references in the way a programmer needs to think about them
313rather than in terms of the physical data structures.
314
315=item *
316
77fae439
Z
317The section "Truth and Falsehood" in L<perlsyn> has been removed from
318that document, where it didn't belong, and merged into the existing
319paragraph on the same topic in L<perldata>.
320
321=item *
322
e509fc38
Z
323The description of the C<x> operator in L<perlop> has been clarified.
324
325=item *
326
6ce1ac11
KW
327L<perluniprops> has been updated to note that C<\p{Word}> now includes
328code points matching the C<\p{Join_Control}> property. The change to
329the property was made in Perl 5.18, but not documented until now. There
330are currently only two code points that match this property U+200C (ZERO
331WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER).
64b9a139 332
e6a2e5ca 333=back
64b9a139 334
e6a2e5ca 335=head1 Diagnostics
64b9a139 336
e6a2e5ca
SH
337The following additions or changes have been made to diagnostic output,
338including warnings and fatal error messages. For the complete list of
339diagnostic messages, see L<perldiag>.
64b9a139 340
e6a2e5ca
SH
341XXX New or changed warnings emitted by the core's C<C> code go here. Also
342include any changes in L<perldiag> that reconcile it to the C<C> code.
64b9a139 343
e6a2e5ca 344=head2 New Diagnostics
64b9a139 345
e6a2e5ca
SH
346XXX Newly added diagnostic messages go under here, separated into New Errors
347and New Warnings
64b9a139 348
e6a2e5ca 349=head3 New Errors
64b9a139 350
e6a2e5ca 351=over 4
64b9a139
SH
352
353=item *
354
e6a2e5ca 355XXX L<message|perldiag/"message">
64b9a139 356
e6a2e5ca
SH
357=back
358
359=head3 New Warnings
64b9a139 360
e6a2e5ca 361=over 4
64b9a139
SH
362
363=item *
364
e6a2e5ca 365XXX L<message|perldiag/"message">
64b9a139 366
e6a2e5ca
SH
367=back
368
369=head2 Changes to Existing Diagnostics
64b9a139 370
e6a2e5ca
SH
371XXX Changes (i.e. rewording) of diagnostic messages go here
372
373=over 4
64b9a139
SH
374
375=item *
376
f99042c8
Z
377The diagnostic C<Initialization of state variables in list context
378currently forbidden> has changed to C<Initialization of state variables
379in list currently forbidden>, because list-context initialization of
380single aggregate state variables is now permitted.
381
382=item *
383
e6a2e5ca
SH
384XXX Describe change here
385
386=back
387
388=head1 Utility Changes
389
390XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
391Most of these are built within the directory F<utils>.
392
393[ List utility changes as a =head2 entry for each utility and =item
394entries for each change
395Use L<XXX> with program names to get proper documentation linking. ]
396
397=head2 L<XXX>
398
399=over 4
64b9a139
SH
400
401=item *
402
e6a2e5ca
SH
403XXX
404
405=back
406
407=head1 Configuration and Compilation
408
409XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
410go here. Any other changes to the Perl build process should be listed here.
411However, any platform-specific changes should be listed in the
412L</Platform Support> section, instead.
413
414[ List changes as an =item entry ].
415
416=over 4
64b9a139 417
5952a840
AC
418=item C89 requirement
419
420Perl has been documented as requiring a C89 compiler to build since October
515c1ce3 4211998. A variety of simplifications have now been made to Perl's internals to
5952a840
AC
422rely on the features specified by the C89 standard. We believe that this
423internal change hasn't altered the set of platforms that Perl builds on, but
424please report a bug if Perl now has new problems building on your platform.
425
dea26044 426=item New probes
64b9a139 427
dea26044
MB
428=over 2
429
430=item HAS_BUILTIN_ADD_OVERFLOW
431
432=item HAS_BUILTIN_MUL_OVERFLOW
433
434=item HAS_BUILTIN_SUB_OVERFLOW
435
436=item HAS_THREAD_SAFE_NL_LANGINFO_L
437
438=item HAS_LOCALECONV_L
439
440=item HAS_MBRLEN
441
442=item HAS_MBRTOWC
443
444=item HAS_MEMRCHR
445
446=item HAS_NANOSLEEP
447
448=item HAS_STRNLEN
449
450=item HAS_STRTOLD_L
451
452=item I_WCHAR
453
454=back
e6a2e5ca
SH
455
456=back
457
458=head1 Testing
459
460XXX Any significant changes to the testing of a freshly built perl should be
461listed here. Changes which create B<new> files in F<t/> go here as do any
462large changes to the testing harness (e.g. when parallel testing was added).
463Changes to existing files in F<t/> aren't worth summarizing, although the bugs
464that they represent may be covered elsewhere.
465
466XXX If there were no significant test changes, say this:
467
468Tests were added and changed to reflect the other additions and changes
469in this release.
470
471XXX If instead there were significant changes, say this:
472
473Tests were added and changed to reflect the other additions and
474changes in this release. Furthermore, these significant changes were
475made:
476
477[ List each test improvement as an =item entry ]
478
479=over 4
64b9a139
SH
480
481=item *
482
e6a2e5ca 483XXX
cf663f87 484
a8ba758d
JSA
485=back
486
a8ba758d 487=head1 Platform Support
cf663f87 488
e6a2e5ca
SH
489XXX Any changes to platform support should be listed in the sections below.
490
491[ Within the sections, list each platform as an =item entry with specific
492changes as paragraphs below it. ]
493
494=head2 New Platforms
495
496XXX List any platforms that this version of perl compiles on, that previous
497versions did not. These will either be enabled by new files in the F<hints/>
498directories, or new subdirectories and F<README> files at the top level of the
499source tree.
500
501=over 4
502
503=item XXX-some-platform
504
505XXX
506
507=back
508
509=head2 Discontinued Platforms
510
511XXX List any platforms that this version of perl no longer compiles on.
512
513=over 4
514
515=item XXX-some-platform
516
517XXX
518
519=back
520
a8ba758d
JSA
521=head2 Platform-Specific Notes
522
e6a2e5ca
SH
523XXX List any changes for specific platforms. This could include configuration
524and compilation changes or changes in portability/compatibility. However,
525changes within modules for platforms should generally be listed in the
526L</Modules and Pragmata> section.
527
a8ba758d 528=over 4
9ef07b78 529
40ed7988 530=item Windows
a8ba758d 531
40ed7988
SH
532Visual C++ compiler version detection has been improved to work on non-English
533language systems.
a8ba758d
JSA
534
535=back
536
e6a2e5ca
SH
537=head1 Internal Changes
538
539XXX Changes which affect the interface available to C<XS> code go here. Other
540significant internal changes for future core maintainers should be noted as
541well.
542
543[ List each change as an =item entry ]
a8ba758d 544
a8ba758d 545=over 4
cf663f87 546
21741043 547=item *
c83a3d01 548
8ed1839e
DM
549A new optimisation phase has been added to the compiler,
550C<optimize_optree()>, which does a top-down scan of a complete optree
551just before the peephole optimiser is run. This phase is not currently
552hookable.
553
554=item *
555
556An C<OP_MULTICONCAT> op has been added. At C<optimize_optree()> time, a
557chain of C<OP_CONCAT> and C<OP_CONST> ops, together optionally with an
558C<OP_STRINGIFY> and/or C<OP_SASSIGN>, are combined into a single
559C<OP_MULTICONCAT> op. The op is of type C<UNOP_AUX>, and the aux array
560contains the argument count, plus a pointer to a constant string and a set
561of segment lengths. For example with
562
563 my $x = "foo=$foo, bar=$bar\n";
564
565the constant string would be C<"foo=, bar=\n"> and the segment lengths
566would be (4,6,1). If the string contains characters such as C<\x80>, whose
567representation changes under utf8, two sets of strings plus lengths are
568precomputed and stored.
a8ba758d 569
ee5287f6
LM
570=item *
571
572Direct access to L<C<PL_keyword_plugin>|perlapi/PL_keyword_plugin> is not
573safe in the presence of multithreading. A new
574L<C<wrap_keyword_plugin>|perlapi/wrap_keyword_plugin> function has been
575added to allow XS modules to safely define custom keywords even when
576loaded from a thread, analoguous to L<C<PL_check>|perlapi/PL_check> /
577L<C<wrap_op_checker>|perlapi/wrap_op_checker>.
578
e6a2e5ca
SH
579=back
580
581=head1 Selected Bug Fixes
582
583XXX Important bug fixes in the core language are summarized here. Bug fixes in
584files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
834e1dc6 585
e6a2e5ca
SH
586[ List each fix as an =item entry ]
587
588=over 4
77baf8eb
SH
589
590=item *
591
a155eb05
TC
592C<stat()>, C<lstat()>, and file test operators now fail if given a
593filename containing a nul character, in the same way that C<open()>
594already fails.
595
596=item *
597
c2bb91f9
Z
598C<stat()>, C<lstat()>, and file test operators now reliably set C<$!> when
599failing due to being applied to a closed or otherwise invalid file handle.
600
601=item *
602
a6c31837
Z
603File test operators for Unix permission bits that don't exist on a
604particular platform, such as C<-k> (sticky bit) on Windows, now check that
605the file being tested exists before returning the blanket false result,
606and yield the appropriate errors if the argument doesn't refer to a file.
607
608=item *
609
5bad3c4f
DIM
610The in-place reverse optimisation now correctly strengthens weak
611references using the L<C<sv_rvunweaken()>|perlapi/sv_rvunweaken>
612API function.
e6a2e5ca 613
4faa3060
TC
614=item *
615
616Fixed a read before buffer when parsing a range starting with C<\N{}>
617at the beginning of the character set for the transliteration
618operator. [perl #132245]
619
620=item *
621
622Fixed a leaked SV when parsing an empty C<\N{}> at compile-time.
623[perl #132245]
624
d1ac83c4
DD
625=item *
626
627Calling C<do $path> on a directory or block device now yields a meaningful
628error code in C<$!>. [perl #125774]
629
02d43d4f
FC
630=item *
631
632Lexical sub declarations in C<do> blocks such as C<do { my sub lex; 123 }>
633could corrupt the stack, erasing items already on the stack in the
634enclosing statement. This has been fixed. [perl #132442]
635
e6a2e5ca
SH
636=back
637
638=head1 Known Problems
639
640XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
641tests that had to be C<TODO>ed for the release would be noted here. Unfixed
642platform specific bugs also go here.
643
644[ List each fix as an =item entry ]
645
646=over 4
77baf8eb
SH
647
648=item *
649
e6a2e5ca 650XXX
834e1dc6 651
a8ba758d
JSA
652=back
653
e6a2e5ca
SH
654=head1 Errata From Previous Releases
655
656=over 4
8abafd33 657
e6a2e5ca
SH
658=item *
659
660XXX Add anything here that we forgot to add, or were mistaken about, in
661the perldelta of a previous release.
8abafd33 662
e6a2e5ca 663=back
b2e49ab9 664
e6a2e5ca 665=head1 Obituary
b2e49ab9 666
e6a2e5ca
SH
667XXX If any significant core contributor has died, we've added a short obituary
668here.
b2e49ab9 669
e6a2e5ca 670=head1 Acknowledgements
b2e49ab9 671
e6a2e5ca 672XXX Generate this with:
b2e49ab9 673
cab780cc 674 perl Porting/acknowledgements.pl v5.27.5..HEAD
f5b73711 675
44691e6f
AB
676=head1 Reporting Bugs
677
b5cbfe35
S
678If you find what you think is a bug, you might check the perl bug database
679at L<https://rt.perl.org/> . There may also be information at
680L<http://www.perl.org/> , the Perl Home Page.
44691e6f 681
e08634c5
SH
682If you believe you have an unreported bug, please run the L<perlbug> program
683included with your release. Be sure to trim your bug down to a tiny but
684sufficient test case. Your bug report, along with the output of C<perl -V>,
b5cbfe35 685will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
44691e6f 686
87c118b9
DM
687If the bug you are reporting has security implications which make it
688inappropriate to send to a publicly archived mailing list, then see
c0ea3294
SH
689L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
690for details of how to report the issue.
44691e6f 691
390ae6f9
S
692=head1 Give Thanks
693
694If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
695you can do so by running the C<perlthanks> program:
696
697 perlthanks
698
699This will send an email to the Perl 5 Porters list with your show of thanks.
700
44691e6f
AB
701=head1 SEE ALSO
702
e08634c5
SH
703The F<Changes> file for an explanation of how to view exhaustive details on
704what changed.
44691e6f
AB
705
706The F<INSTALL> file for how to build Perl.
707
708The F<README> file for general stuff.
709
710The F<Artistic> and F<Copying> files for copyright information.
711
712=cut