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