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