This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
initialisation of simple aggregate state variables
[perl5.git] / pod / perldelta.pod
... / ...
CommitLineData
1=encoding utf8
2
3=head1 NAME
4
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
9
10=head1 DESCRIPTION
11
12This document describes differences between the 5.27.5 release and the 5.27.6
13release.
14
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
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
36=head1 Security
37
38XXX Any security-related notices go here. In particular, any security
39vulnerabilities closed should be noted here rather than in the
40L</Selected Bug Fixes> section.
41
42[ List each security issue as a =head2 entry ]
43
44=head1 Incompatible Changes
45
46XXX For a release on a stable branch, this section aspires to be:
47
48 There are no changes intentionally incompatible with 5.XXX.XXX
49 If any exist, they are bugs, and we request that you submit a
50 report. See L</Reporting Bugs> below.
51
52[ List each incompatible change as a =head2 entry ]
53
54=head1 Deprecations
55
56XXX Any deprecated features, syntax, modules etc. should be listed here.
57
58=head2 Module removals
59
60XXX Remove this section if inapplicable.
61
62The following modules will be removed from the core distribution in a
63future release, and will at that time need to be installed from CPAN.
64Distributions on CPAN which require these modules will need to list them as
65prerequisites.
66
67The core versions of these modules will now issue C<"deprecated">-category
68warnings to alert you to this fact. To silence these deprecation warnings,
69install the modules in question from CPAN.
70
71Note that these are (with rare exceptions) fine modules that you are encouraged
72to continue to use. Their disinclusion from core primarily hinges on their
73necessity to bootstrapping a fully functional, CPAN-capable Perl installation,
74not usually on concerns over their design.
75
76=over
77
78=item XXX
79
80XXX Note that deprecated modules should be listed here even if they are listed
81as an updated module in the L</Modules and Pragmata> section.
82
83=back
84
85[ List each other deprecation as a =head2 entry ]
86
87=head1 Performance Enhancements
88
89XXX Changes which enhance performance without changing behaviour go here.
90There may well be none in a stable release.
91
92[ List each enhancement as an =item entry ]
93
94=over 4
95
96=item *
97
98Many string concatenation expressions are now considerably faster, due
99to the introduction internally of a C<multiconcat> opcode which combines
100multiple concatenations, and optionally a C<=> or C<.=>, into a single
101action. For example, apart from retrieving C<$s>, C<$a> and C<$b>, this
102whole expression is now handled as a single op:
103
104 $s .= "a=$a b=$b\n"
105
106As a special case, if the LHS of an assign is a lexical variable or
107C<my $s>, the op itself handles retrieving the lexical variable, which
108is faster.
109
110In general, the more the expression includes a mix of constant strings and
111variable expressions, the longer the expression, and the more it mixes
112together non-utf8 and utf8 strings, the more marked the performance
113improvement. For example on a C<x86_64> system, this code has been
114benchmarked running four times faster:
115
116 my $s;
117 my $a = "ab\x{100}cde";
118 my $b = "fghij";
119 my $c = "\x{101}klmn";
120
121 for my $i (1..10_000_000) {
122 $s = "\x{100}wxyz";
123 $s .= "foo=$a bar=$b baz=$c";
124 }
125
126In addition, C<sprintf> expressions which have a constant format
127containing only C<%s> and C<%%> format elements, and which have a fixed
128number of arguments, are now also optimised into a C<multiconcat> op.
129
130=back
131
132=head1 Modules and Pragmata
133
134XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
135go here. If Module::CoreList is updated, generate an initial draft of the
136following sections using F<Porting/corelist-perldelta.pl>. A paragraph summary
137for important changes should then be added by hand. In an ideal world,
138dual-life modules would have a F<Changes> file that could be cribbed.
139
140The list of new and updated modules is modified automatically as part of
141preparing a Perl release, so the only reason to manually add entries here is if
142you're summarising the important changes in the module update. (Also, if the
143manually-added details don't match the automatically-generated ones, the
144release manager will have to investigate the situation carefully.)
145
146[ Within each section, list entries as an =item entry ]
147
148=head2 New Modules and Pragmata
149
150=over 4
151
152=item *
153
154XXX
155
156=back
157
158=head2 Updated Modules and Pragmata
159
160=over 4
161
162=item *
163
164L<Carp> has been upgraded from version 1.43 to 1.44.
165
166If a package on the call stack contains a constant named C<ISA>, Carp no
167longer throws a "Not a GLOB reference" error.
168
169=back
170
171=head2 Removed Modules and Pragmata
172
173=over 4
174
175=item *
176
177XXX
178
179=back
180
181=head1 Documentation
182
183XXX Changes to files in F<pod/> go here. Consider grouping entries by
184file and be sure to link to the appropriate page, e.g. L<perlfunc>.
185
186=head2 New Documentation
187
188XXX Changes which create B<new> files in F<pod/> go here.
189
190=head3 L<XXX>
191
192XXX Description of the purpose of the new file here
193
194=head2 Changes to Existing Documentation
195
196We have attempted to update the documentation to reflect the changes
197listed in this document. If you find any we have missed, send email
198to L<perlbug@perl.org|mailto:perlbug@perl.org>.
199
200XXX Changes which significantly change existing files in F<pod/> go here.
201However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
202section.
203
204Additionally, the following selected changes have been made:
205
206=head3 L<perldiag/Variable length lookbehind not implemented in regex m/%s/>
207
208This now gives more ideas as to workarounds to the issue that was
209introduced in Perl 5.18 (but not documented explicitly in its perldelta)
210for the fact that some Unicode C</i> rules cause a few sequences such as
211
212 (?<!st)
213
214to be considered variable length, and hence disallowed.
215
216=over 4
217
218=item *
219
220XXX Description of the change here
221
222=back
223
224=head1 Diagnostics
225
226The following additions or changes have been made to diagnostic output,
227including warnings and fatal error messages. For the complete list of
228diagnostic messages, see L<perldiag>.
229
230XXX New or changed warnings emitted by the core's C<C> code go here. Also
231include any changes in L<perldiag> that reconcile it to the C<C> code.
232
233=head2 New Diagnostics
234
235XXX Newly added diagnostic messages go under here, separated into New Errors
236and New Warnings
237
238=head3 New Errors
239
240=over 4
241
242=item *
243
244XXX L<message|perldiag/"message">
245
246=back
247
248=head3 New Warnings
249
250=over 4
251
252=item *
253
254XXX L<message|perldiag/"message">
255
256=back
257
258=head2 Changes to Existing Diagnostics
259
260XXX Changes (i.e. rewording) of diagnostic messages go here
261
262=over 4
263
264=item *
265
266The diagnostic C<Initialization of state variables in list context
267currently forbidden> has changed to C<Initialization of state variables
268in list currently forbidden>, because list-context initialization of
269single aggregate state variables is now permitted.
270
271=item *
272
273XXX Describe change here
274
275=back
276
277=head1 Utility Changes
278
279XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
280Most of these are built within the directory F<utils>.
281
282[ List utility changes as a =head2 entry for each utility and =item
283entries for each change
284Use L<XXX> with program names to get proper documentation linking. ]
285
286=head2 L<XXX>
287
288=over 4
289
290=item *
291
292XXX
293
294=back
295
296=head1 Configuration and Compilation
297
298XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
299go here. Any other changes to the Perl build process should be listed here.
300However, any platform-specific changes should be listed in the
301L</Platform Support> section, instead.
302
303[ List changes as an =item entry ].
304
305=over 4
306
307=item New probes
308
309=over 2
310
311=item HAS_BUILTIN_ADD_OVERFLOW
312
313=item HAS_BUILTIN_MUL_OVERFLOW
314
315=item HAS_BUILTIN_SUB_OVERFLOW
316
317=item HAS_THREAD_SAFE_NL_LANGINFO_L
318
319=item HAS_LOCALECONV_L
320
321=item HAS_MBRLEN
322
323=item HAS_MBRTOWC
324
325=item HAS_MEMRCHR
326
327=item HAS_NANOSLEEP
328
329=item HAS_STRNLEN
330
331=item HAS_STRTOLD_L
332
333=item I_WCHAR
334
335=back
336
337=back
338
339=head1 Testing
340
341XXX Any significant changes to the testing of a freshly built perl should be
342listed here. Changes which create B<new> files in F<t/> go here as do any
343large changes to the testing harness (e.g. when parallel testing was added).
344Changes to existing files in F<t/> aren't worth summarizing, although the bugs
345that they represent may be covered elsewhere.
346
347XXX If there were no significant test changes, say this:
348
349Tests were added and changed to reflect the other additions and changes
350in this release.
351
352XXX If instead there were significant changes, say this:
353
354Tests were added and changed to reflect the other additions and
355changes in this release. Furthermore, these significant changes were
356made:
357
358[ List each test improvement as an =item entry ]
359
360=over 4
361
362=item *
363
364XXX
365
366=back
367
368=head1 Platform Support
369
370XXX Any changes to platform support should be listed in the sections below.
371
372[ Within the sections, list each platform as an =item entry with specific
373changes as paragraphs below it. ]
374
375=head2 New Platforms
376
377XXX List any platforms that this version of perl compiles on, that previous
378versions did not. These will either be enabled by new files in the F<hints/>
379directories, or new subdirectories and F<README> files at the top level of the
380source tree.
381
382=over 4
383
384=item XXX-some-platform
385
386XXX
387
388=back
389
390=head2 Discontinued Platforms
391
392XXX List any platforms that this version of perl no longer compiles on.
393
394=over 4
395
396=item XXX-some-platform
397
398XXX
399
400=back
401
402=head2 Platform-Specific Notes
403
404XXX List any changes for specific platforms. This could include configuration
405and compilation changes or changes in portability/compatibility. However,
406changes within modules for platforms should generally be listed in the
407L</Modules and Pragmata> section.
408
409=over 4
410
411=item XXX-some-platform
412
413XXX
414
415=back
416
417=head1 Internal Changes
418
419XXX Changes which affect the interface available to C<XS> code go here. Other
420significant internal changes for future core maintainers should be noted as
421well.
422
423[ List each change as an =item entry ]
424
425=over 4
426
427=item *
428
429A new optimisation phase has been added to the compiler,
430C<optimize_optree()>, which does a top-down scan of a complete optree
431just before the peephole optimiser is run. This phase is not currently
432hookable.
433
434=item *
435
436An C<OP_MULTICONCAT> op has been added. At C<optimize_optree()> time, a
437chain of C<OP_CONCAT> and C<OP_CONST> ops, together optionally with an
438C<OP_STRINGIFY> and/or C<OP_SASSIGN>, are combined into a single
439C<OP_MULTICONCAT> op. The op is of type C<UNOP_AUX>, and the aux array
440contains the argument count, plus a pointer to a constant string and a set
441of segment lengths. For example with
442
443 my $x = "foo=$foo, bar=$bar\n";
444
445the constant string would be C<"foo=, bar=\n"> and the segment lengths
446would be (4,6,1). If the string contains characters such as C<\x80>, whose
447representation changes under utf8, two sets of strings plus lengths are
448precomputed and stored.
449
450=back
451
452=head1 Selected Bug Fixes
453
454XXX Important bug fixes in the core language are summarized here. Bug fixes in
455files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
456
457[ List each fix as an =item entry ]
458
459=over 4
460
461=item *
462
463C<stat()>, C<lstat()>, and file test operators now fail if given a
464filename containing a nul character, in the same way that C<open()>
465already fails.
466
467=item *
468
469The in-place reverse optimisation now correctly strengthens weak
470references using the L<C<sv_rvunweaken()>|perlapi/sv_rvunweaken>
471API function.
472
473=item *
474
475Fixed a read before buffer when parsing a range starting with C<\N{}>
476at the beginning of the character set for the transliteration
477operator. [perl #132245]
478
479=item *
480
481Fixed a leaked SV when parsing an empty C<\N{}> at compile-time.
482[perl #132245]
483
484=back
485
486=head1 Known Problems
487
488XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
489tests that had to be C<TODO>ed for the release would be noted here. Unfixed
490platform specific bugs also go here.
491
492[ List each fix as an =item entry ]
493
494=over 4
495
496=item *
497
498XXX
499
500=back
501
502=head1 Errata From Previous Releases
503
504=over 4
505
506=item *
507
508XXX Add anything here that we forgot to add, or were mistaken about, in
509the perldelta of a previous release.
510
511=back
512
513=head1 Obituary
514
515XXX If any significant core contributor has died, we've added a short obituary
516here.
517
518=head1 Acknowledgements
519
520XXX Generate this with:
521
522 perl Porting/acknowledgements.pl v5.27.5..HEAD
523
524=head1 Reporting Bugs
525
526If you find what you think is a bug, you might check the perl bug database
527at L<https://rt.perl.org/> . There may also be information at
528L<http://www.perl.org/> , the Perl Home Page.
529
530If you believe you have an unreported bug, please run the L<perlbug> program
531included with your release. Be sure to trim your bug down to a tiny but
532sufficient test case. Your bug report, along with the output of C<perl -V>,
533will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
534
535If the bug you are reporting has security implications which make it
536inappropriate to send to a publicly archived mailing list, then see
537L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
538for details of how to report the issue.
539
540=head1 Give Thanks
541
542If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
543you can do so by running the C<perlthanks> program:
544
545 perlthanks
546
547This will send an email to the Perl 5 Porters list with your show of thanks.
548
549=head1 SEE ALSO
550
551The F<Changes> file for an explanation of how to view exhaustive details on
552what changed.
553
554The F<INSTALL> file for how to build Perl.
555
556The F<README> file for general stuff.
557
558The F<Artistic> and F<Copying> files for copyright information.
559
560=cut