This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for #119815 / 12cea2fa65
[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.21.6
9
10 =head1 DESCRIPTION
11
12 This document describes differences between the 5.21.5 release and the 5.21.6
13 release.
14
15 If you are upgrading from an earlier release such as 5.21.4, first read
16 L<perl5215delta>, which describes differences between 5.21.4 and 5.21.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 List form of pipe open implemented for Win32
31
32 The list form of pipe:
33
34   open my $fh, "-|", "program", @arguments;
35
36 is now implemented on Win32.  It has the same limitations as C<system
37 LIST> on Win32, since the Win32 API doesn't accept program arguments
38 as a list.
39
40 =head2 Assignment to list repetition
41
42 C<(...) x ...> can now be used within a list that is assigned to, as long
43 as the left-hand side is a valid lvalue.  This allows C<(undef,undef,$foo)
44 = that_function()> to be written as C<((undef)x2, $foo) = that_function()>.
45
46 =head2 C<close> now sets C<$!>
47
48 When an I/O error occurs, the fact that there has been an error is recorded
49 in the handle.  C<close> returns false for such a handle.  Previously, the
50 value of C<$!> would be untouched by C<close>, so the common convention of
51 writing C<close $fh or die $!> did not work reliably.  Now the handle
52 records the value of C<$!>, too, and C<close> restores it.
53
54 =head1 Security
55
56 XXX Any security-related notices go here.  In particular, any security
57 vulnerabilities closed should be noted here rather than in the
58 L</Selected Bug Fixes> section.
59
60 [ List each security issue as a =head2 entry ]
61
62 =head1 Incompatible Changes
63
64 XXX For a release on a stable branch, this section aspires to be:
65
66     There are no changes intentionally incompatible with 5.XXX.XXX
67     If any exist, they are bugs, and we request that you submit a
68     report.  See L</Reporting Bugs> below.
69
70 [ List each incompatible change as a =head2 entry ]
71
72 =head1 Deprecations
73
74 XXX Any deprecated features, syntax, modules etc. should be listed here.
75
76 =head2 Module removals
77
78 XXX Remove this section if inapplicable.
79
80 The following modules will be removed from the core distribution in a
81 future release, and will at that time need to be installed from CPAN.
82 Distributions on CPAN which require these modules will need to list them as
83 prerequisites.
84
85 The core versions of these modules will now issue C<"deprecated">-category
86 warnings to alert you to this fact.  To silence these deprecation warnings,
87 install the modules in question from CPAN.
88
89 Note that these are (with rare exceptions) fine modules that you are encouraged
90 to continue to use.  Their disinclusion from core primarily hinges on their
91 necessity to bootstrapping a fully functional, CPAN-capable Perl installation,
92 not usually on concerns over their design.
93
94 =over
95
96 =item XXX
97
98 XXX Note that deprecated modules should be listed here even if they are listed
99 as an updated module in the L</Modules and Pragmata> section.
100
101 =back
102
103 [ List each other deprecation as a =head2 entry ]
104
105 =head2 Use of non-graphic characters in single-character variable names
106
107 The syntax for single-character variable names is more lenient than
108 for longer variable names, allowing the one-character name to be a
109 punctuation character or even invisible (a non-graphic).  Perl v5.20
110 deprecated the ASCII-range controls as such a name.  Now, all
111 non-graphic characters that formerly were allowed are deprecated.
112 The practical effect of this occurs only when not under C<S<"use
113 utf8">>, and affects just the C1 controls (code points 0x80 through
114 0xFF), NO-BREAK SPACE, and SOFT HYPHEN.
115
116 =head1 Performance Enhancements
117
118 XXX Changes which enhance performance without changing behaviour go here.
119 There may well be none in a stable release.
120
121 [ List each enhancement as a =item entry ]
122
123 =over 4
124
125 =item *
126
127 C<(...)x1>, C<("constant")x0> and C<($scalar)x0> are now optimised in list
128 context.  If the right-hand argument is a constant 1, the repetition
129 operator disappears.  If the right-hand argument is a constant 0, the whole
130 expressions is optimised to the empty list, so long as the left-hand
131 argument is a simple scalar or constant.  C<(foo())x0> is not optimised.
132
133 =item *
134
135 C<substr> assignment is now optimised into 4-argument C<substr> at the end
136 of a subroutine (or as the argument to C<return>).  Previously, this
137 optimisation only happened in void context.
138
139 =item *
140
141 Assignment to lexical variables is often optimised away.  For instance, in
142 C<$lexical = chr $foo>, the C<chr> operator writes directly to the lexical
143 variable instead of returning a value that gets copied.  This optimisation
144 has been extended to C<split>, C<x> and C<vec> on the right-hand side.  It
145 has also been made to work with state variable initialization.
146
147 =back
148
149 =head1 Modules and Pragmata
150
151 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
152 go here.  If Module::CoreList is updated, generate an initial draft of the
153 following sections using F<Porting/corelist-perldelta.pl>.  A paragraph summary
154 for important changes should then be added by hand.  In an ideal world,
155 dual-life modules would have a F<Changes> file that could be cribbed.
156
157 [ Within each section, list entries as a =item entry ]
158
159 =head2 New Modules and Pragmata
160
161 =over 4
162
163 =item *
164
165 XXX
166
167 =back
168
169 =head2 Updated Modules and Pragmata
170
171 =over 4
172
173 =item *
174
175 L<B::Deparse> has been upgraded from version 1.29 to 1.30.
176
177 It now deparses C<+sub : attr { ... }> correctly at the start of a
178 statement.  Without the initial C<+>, C<sub> would be a statement label.
179
180 C<BEGIN> blocks are now emitted in the right place most of the time, but
181 the change unfortunately introduced a regression, in that C<BEGIN> blocks
182 occurring just before the end of the enclosing block may appear below it
183 instead.  So this change may need to be reverted if it cannot be fixed
184 before Perl 5.22.  [perl #77452]
185
186 B::Deparse no longer puts erroneous C<local> here and there, such as for
187 C<LIST = tr/a//d>.  [perl #119815]
188
189 =item *
190
191 L<DynaLoader> has been upgraded from version 1.27 to 1.28.
192
193 =item *
194
195 L<IO::Socket> has been upgraded from version 1.37 to 1.38.
196
197 Document the limitations of the isconnected() method.  [perl #123096]
198
199 =back
200
201 =head2 Removed Modules and Pragmata
202
203 =over 4
204
205 =item *
206
207 XXX
208
209 =back
210
211 =head1 Documentation
212
213 XXX Changes to files in F<pod/> go here.  Consider grouping entries by
214 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
215
216 =head2 New Documentation
217
218 XXX Changes which create B<new> files in F<pod/> go here.
219
220 =head3 L<XXX>
221
222 XXX Description of the purpose of the new file here
223
224 =head2 Changes to Existing Documentation
225
226 XXX Changes which significantly change existing files in F<pod/> go here.
227 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
228 section.
229
230 =head3 L<perldata/Identifier parsing>
231
232 =over 4
233
234 =item *
235
236 The syntax of single-character variable names has been brought
237 up-to-date and more fully explained.
238
239 =back
240
241 =head1 Diagnostics
242
243 The following additions or changes have been made to diagnostic output,
244 including warnings and fatal error messages.  For the complete list of
245 diagnostic messages, see L<perldiag>.
246
247 XXX New or changed warnings emitted by the core's C<C> code go here.  Also
248 include any changes in L<perldiag> that reconcile it to the C<C> code.
249
250 =head2 New Diagnostics
251
252 XXX Newly added diagnostic messages go under here, separated into New Errors
253 and New Warnings
254
255 =head3 New Errors
256
257 =over 4
258
259 =item *
260
261 XXX L<message|perldiag/"message">
262
263 =back
264
265 =head3 New Warnings
266
267 =over 4
268
269 =item *
270
271 L<Use of literal non-graphic characters in variable names is deprecated|perldiag/"Use of literal non-graphic characters in variable names is deprecated">
272
273 =item *
274
275 A new C<locale> warning category has been created, with the following warning
276 messages currently in it:
277
278 =over 4
279
280 =item *
281
282 L<Locale '%s' may not work well.%s|perldiag/Locale '%s' may not work well.%s>
283
284 =item *
285
286 L<Can't do %s("%s") on non-UTF-8 locale; resolved to "%s".|perldiag/Can't do %s("%s") on non-UTF-8 locale; resolved to "%s".>
287
288 =back
289
290 =item *
291
292 L<Warning: unable to close filehandle %s properly: %s|perldiag/"Warning: unable to close filehandle %s properly: %s">
293
294 =back
295
296 =head2 Changes to Existing Diagnostics
297
298 XXX Changes (i.e. rewording) of diagnostic messages go here
299
300 =over 4
301
302 =item *
303
304 L<Quantifier unexpected on zero-length expression in regex mE<sol>%sE<sol>|perldiag/"Quantifier unexpected on zero-length expression in regex m/%s/">.
305
306 This message has had the S<"<-- HERE"> marker removed, as it was always
307 placed at the end of the regular expression, regardless of where the
308 problem actually occurred.  [perl #122680]
309
310 =back
311
312 =head1 Utility Changes
313
314 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
315 Most of these are built within the directory F<utils>.
316
317 [ List utility changes as a =head2 entry for each utility and =item
318 entries for each change
319 Use L<XXX> with program names to get proper documentation linking. ]
320
321 =head2 L<XXX>
322
323 =over 4
324
325 =item *
326
327 XXX
328
329 =back
330
331 =head1 Configuration and Compilation
332
333 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
334 go here.  Any other changes to the Perl build process should be listed here.
335 However, any platform-specific changes should be listed in the
336 L</Platform Support> section, instead.
337
338 [ List changes as a =item entry ].
339
340 =over 4
341
342 =item *
343
344 F<Configure> with C<-Dmksymlinks> should now be faster. [perl #122002]
345
346 =back
347
348 =head1 Testing
349
350 XXX Any significant changes to the testing of a freshly built perl should be
351 listed here.  Changes which create B<new> files in F<t/> go here as do any
352 large changes to the testing harness (e.g. when parallel testing was added).
353 Changes to existing files in F<t/> aren't worth summarizing, although the bugs
354 that they represent may be covered elsewhere.
355
356 [ List each test improvement as a =item entry ]
357
358 =over 4
359
360 =item *
361
362 XXX
363
364 =back
365
366 =head1 Platform Support
367
368 XXX Any changes to platform support should be listed in the sections below.
369
370 [ Within the sections, list each platform as a =item entry with specific
371 changes as paragraphs below it. ]
372
373 =head2 New Platforms
374
375 XXX List any platforms that this version of perl compiles on, that previous
376 versions did not.  These will either be enabled by new files in the F<hints/>
377 directories, or new subdirectories and F<README> files at the top level of the
378 source tree.
379
380 =over 4
381
382 =item XXX-some-platform
383
384 XXX
385
386 =back
387
388 =head2 Discontinued Platforms
389
390 XXX List any platforms that this version of perl no longer compiles on.
391
392 =over 4
393
394 =item XXX-some-platform
395
396 XXX
397
398 =back
399
400 =head2 Platform-Specific Notes
401
402 XXX List any changes for specific platforms.  This could include configuration
403 and compilation changes or changes in portability/compatibility.  However,
404 changes within modules for platforms should generally be listed in the
405 L</Modules and Pragmata> section.
406
407 =over 4
408
409 =item XXX-some-platform
410
411 XXX
412
413 =back
414
415 =head3 Win32
416
417 =over 4
418
419 =item *
420
421 In the experimental C<:win32> layer, a crash in C<open> was fixed. Also
422 opening C</dev/null>, which works the Win32 Perl's normal C<:unix> layer, was
423 implemented for C<:win32>.
424 L<[perl #122224]|https://rt.perl.org/Ticket/Display.html?id=122224>
425
426 =item *
427
428 A new makefile option, C<USE_LONG_DOUBLE>, has been added to the Windows
429 dmake makefile for gcc builds only.  Set this to "define" if you want perl to
430 use long doubles to give more accuracy and range for floating point numbers.
431
432 =back
433
434 =head1 Internal Changes
435
436 XXX Changes which affect the interface available to C<XS> code go here.  Other
437 significant internal changes for future core maintainers should be noted as
438 well.
439
440 [ List each change as a =item entry ]
441
442 =over 4
443
444 =item *
445
446 C<screaminstr> has been removed. Although marked as public API, it is
447 undocumented and has no usage in modern perl versions on CPAN Grep. Calling it
448 has been fatal since 5.17.0.
449
450 =item *
451
452 C<newDEFSVOP>, C<block_start>, C<block_end> and C<intro_my> have been added
453 to the API.
454
455 =item *
456
457 The internal C<convert> function in F<op.c> has been renamed
458 C<op_convert_list> and added to the API.
459
460 =item *
461
462 C<sv_magic> no longer forbids "ext" magic on read-only values.  After all,
463 perl can't know whether the custom magic will modify the SV or not.
464 [perl #123103]
465
466 =back
467
468 =head1 Selected Bug Fixes
469
470 XXX Important bug fixes in the core language are summarized here.  Bug fixes in
471 files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
472
473 [ List each fix as a =item entry ]
474
475 =over 4
476
477 =item *
478
479 fchmod() and futimes() now set C<$!> when they fail due to being
480 passed a closed file handle.  [perl #122703]
481
482 =item *
483
484 Perl now comes with a corrected Unicode 7.0 for the erratum issued on
485 October 21, 2014 (see L<http://www.unicode.org/errata/#current_errata>),
486 dealing with glyph shaping in Arabic.
487
488 =item *
489
490 op_free() no longer crashes due to a stack overflow when freeing a
491 deeply recursive op tree. [perl #108276]
492
493 =item *
494
495 scalarvoid() would crash due to a stack overflow when processing a
496 deeply recursive op tree. [perl #108276]
497
498 =item *
499
500 In Perl 5.20.0, C<$^N> accidentally had the internal UTF8 flag turned off
501 if accessed from a code block within a regular expression, effectively
502 UTF8-encoding the value.  This has been fixed.  [perl #123135]
503
504 =item *
505
506 A failed C<semctl> call no longer overwrites existing items on the stack,
507 causing C<(semctl(-1,0,0,0))[0]> to give an "uninitialized" warning.
508
509 =item *
510
511 C<else{foo()}> with no space before C<foo> is now better at assigning the
512 right line number to that statement.  [perl #122695]
513
514 =item *
515
516 Sometimes the assignment in C<@array = split> gets optimised and C<split>
517 itself writes directly to the array.  This caused a bug, preventing this
518 assignment from being used in lvalue context.  So
519 C<(@a=split//,"foo")=bar()> was an error.  (This bug probably goes back to
520 Perl 3, when the optimisation was added.)  This optimisation, and the bug,
521 started to happen in more cases in 5.21.5.  It has now been fixed.
522 [perl #123057]
523
524 =item *
525
526 When argument lists that fail the checks installed by subroutine
527 signatures, the resulting error messages now give the file and line number
528 of the caller, not of the called subroutine.  [perl #121374]
529
530 =item *
531
532 Flip-flop operators (C<..> and C<...> in scalar context) used to maintain
533 a separate state for each recursion level (the number of times the
534 enclosing sub was called recursively), contrary to the documentation.  Now
535 each closure has one internal state for each flip-flop.  [perl #122829]
536
537 =item *
538
539 C<use>, C<no>, statement labels, special blocks (C<BEGIN>) and pod are now
540 permitted as the first thing in a C<map> or C<grep> block, the block after
541 C<print> or C<say> (or other functions) returning a handle, and within
542 C<${...}>, C<@{...}>, etc.  [perl #122782]
543
544 =item *
545
546 The repetition operator C<x> now propagates lvalue context to its left-hand
547 argument when used in contexts like C<foreach>.  That allows
548 C<for(($#that_array)x2) { ... }> to work as expected if the loop modifies
549 $_.
550
551 =item *
552
553 C<(...) x ...> in scalar context used to corrupt the stack if one operand
554 were an object with "x" overloading, causing erratic behaviour.
555 [perl #121827]
556
557 =back
558
559 =head1 Known Problems
560
561 XXX Descriptions of platform agnostic bugs we know we can't fix go here.  Any
562 tests that had to be C<TODO>ed for the release would be noted here.  Unfixed
563 platform specific bugs also go here.
564
565 [ List each fix as a =item entry ]
566
567 =over 4
568
569 =item *
570
571 Starting in 5.21.6, accessing L<perlapi/CvPADLIST> in an XSUB is forbidden.
572 CvPADLIST has be reused for a different internal purpose for XSUBs. Guard all
573 CvPADLIST expressions with C<CvISXSUB()> if your code doesn't already block
574 XSUB CV*s from going through optree CV* expecting code.
575
576 =back
577
578 =head1 Errata From Previous Releases
579
580 =over 4
581
582 =item *
583
584 Due to a mistake in the string-copying logic, copying the value of a state
585 variable could instead steal the value and undefine the variable.  This
586 bug, introduced in 5.20, would happen mostly for long strings (1250 chars
587 or more), but could happen for any strings under builds with copy-on-write
588 disabled.  [perl #123029]
589
590 This bug was actually fixed in 5.21.5, but it was not until after that
591 release that this bug, and the fact that it had been fixed, were
592 discovered.
593
594 =back
595
596 =head1 Obituary
597
598 XXX If any significant core contributor has died, we've added a short obituary
599 here.
600
601 =head1 Acknowledgements
602
603 XXX Generate this with:
604
605   perl Porting/acknowledgements.pl v5.21.5..HEAD
606
607 =head1 Reporting Bugs
608
609 If you find what you think is a bug, you might check the articles recently
610 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
611 https://rt.perl.org/ .  There may also be information at
612 http://www.perl.org/ , the Perl Home Page.
613
614 If you believe you have an unreported bug, please run the L<perlbug> program
615 included with your release.  Be sure to trim your bug down to a tiny but
616 sufficient test case.  Your bug report, along with the output of C<perl -V>,
617 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
618
619 If the bug you are reporting has security implications, which make it
620 inappropriate to send to a publicly archived mailing list, then please send it
621 to perl5-security-report@perl.org.  This points to a closed subscription
622 unarchived mailing list, which includes all the core committers, who will be
623 able to help assess the impact of issues, figure out a resolution, and help
624 co-ordinate the release of patches to mitigate or fix the problem across all
625 platforms on which Perl is supported.  Please only use this address for
626 security issues in the Perl core, not for modules independently distributed on
627 CPAN.
628
629 =head1 SEE ALSO
630
631 The F<Changes> file for an explanation of how to view exhaustive details on
632 what changed.
633
634 The F<INSTALL> file for how to build Perl.
635
636 The F<README> file for general stuff.
637
638 The F<Artistic> and F<Copying> files for copyright information.
639
640 =cut