This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta - Fix a typo and remove a trailing space
[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.4
9
10 =head1 DESCRIPTION
11
12 This document describes differences between the 5.21.3 release and the 5.21.4
13 release.
14
15 If you are upgrading from an earlier release such as 5.21.2, first read
16 L<perl5213delta>, which describes differences between 5.21.2 and 5.21.3.
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 Infinity and NaN (not-a-number) handling improved
31
32 Floating point values are able to hold the special values infinity
33 (also -infinity), and NaN (not-a-number).  Now we more robustly recognize
34 and propagate the value in computations, and on output normalize them
35 to C<Inf> and C<NaN>.
36
37 See also the L<POSIX> enhancements.
38
39 =head1 Security
40
41 XXX Any security-related notices go here.  In particular, any security
42 vulnerabilities closed should be noted here rather than in the
43 L</Selected Bug Fixes> section.
44
45 [ List each security issue as a =head2 entry ]
46
47 =head1 Incompatible Changes
48
49 XXX For a release on a stable branch, this section aspires to be:
50
51     There are no changes intentionally incompatible with 5.XXX.XXX
52     If any exist, they are bugs, and we request that you submit a
53     report.  See L</Reporting Bugs> below.
54
55 [ List each incompatible change as a =head2 entry ]
56
57 =head2 Changes to the C<*> prototype
58
59 The C<*> character in a subroutine's prototype used to allow barewords
60 to take precedence over most, but not all subroutines.  It was never
61 consistent and exhibited buggy behaviour.
62
63 Now it has been changed, so subroutines always take precedence over
64 barewords, which brings it into conformity with similarly prototyped
65 built-in functions:
66
67     sub splat($) { ... }
68     sub foo { ... }
69     splat(foo); # now always splat(foo())
70     splat(bar); # still splat('bar') as before
71     close(foo); # close(foo())
72     close(bar); # close('bar')
73
74 =head1 Deprecations
75
76 XXX Any deprecated features, syntax, modules etc. should be listed here.
77
78 =head2 Module removals
79
80 XXX Remove this section if inapplicable.
81
82 The following modules will be removed from the core distribution in a
83 future release, and will at that time need to be installed from CPAN.
84 Distributions on CPAN which require these modules will need to list them as
85 prerequisites.
86
87 The core versions of these modules will now issue C<"deprecated">-category
88 warnings to alert you to this fact.  To silence these deprecation warnings,
89 install the modules in question from CPAN.
90
91 Note that these are (with rare exceptions) fine modules that you are encouraged
92 to continue to use.  Their disinclusion from core primarily hinges on their
93 necessity to bootstrapping a fully functional, CPAN-capable Perl installation,
94 not usually on concerns over their design.
95
96 =over
97
98 =item XXX
99
100 XXX Note that deprecated modules should be listed here even if they are listed
101 as an updated module in the L</Modules and Pragmata> section.
102
103 =back
104
105 [ List each other deprecation as a =head2 entry ]
106
107 =head1 Performance Enhancements
108
109 XXX Changes which enhance performance without changing behaviour go here.
110 There may well be none in a stable release.
111
112 [ List each enhancement as a =item entry ]
113
114 =over 4
115
116 =item *
117
118 Subroutines with an empty prototype and bodies containing just C<undef> are
119 now eligible for inlining.
120 L<[perl #122728]|https://rt.perl.org/Ticket/Display.html?id=122728>
121
122 =item *
123
124 Subroutines in packages no longer need to carry typeglobs around with them.
125 Declaring a subroutine will now put a simple sub reference in the stash if
126 possible, saving memory.  The typeglobs still notionally exist, so
127 accessing them will cause the subroutine reference to be upgraded to a
128 typeglob.  This optimisation does not currently apply to XSUBs or exported
129 subroutines, and method calls will undo it, since they cache things in
130 typeglobs.
131 L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
132
133 =back
134
135 =head1 Modules and Pragmata
136
137 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
138 go here.  If Module::CoreList is updated, generate an initial draft of the
139 following sections using F<Porting/corelist-perldelta.pl>.  A paragraph summary
140 for important changes should then be added by hand.  In an ideal world,
141 dual-life modules would have a F<Changes> file that could be cribbed.
142
143 [ Within each section, list entries as a =item entry ]
144
145 =head2 New Modules and Pragmata
146
147 =over 4
148
149 =item *
150
151 XXX
152
153 =back
154
155 =head2 Updated Modules and Pragmata
156
157 =over 4
158
159 =item *
160
161 L<Archive::Tar> has been upgraded from version 2.00 to 2.02.
162
163 Tests can now be run in parallel.
164
165 =item *
166
167 L<Attribute::Handlers> has been upgraded from version 0.96 to 0.97.
168
169 =item *
170
171 L<attributes> has been upgraded from version 0.22 to 0.23.
172
173 =item *
174
175 L<B> has been upgraded from version 1.50 to 1.51.
176
177 It provides a new C<B::safename> function, based on the existing
178 C<< B::GV->SAFENAME >>, that converts "\cOPEN" to "^OPEN".
179
180 =item *
181
182 L<B::Concise> has been upgraded from version 0.992 to 0.993.
183
184 =item *
185
186 L<B::Deparse> has been upgraded from version 1.27 to 1.28.
187
188 It now deparses C<our(I<LIST>)> and typed lexical (C<my Dog $spot>) correctly.
189
190 =item *
191
192 L<bignum> has been upgraded from version 0.37 to 0.38.
193
194 =item *
195
196 L<constant> has been upgraded from version 1.31 to 1.32.
197
198 It now accepts fully-qualified constant names, allowing constants to be defined
199 in packages other than the caller.
200
201 =item *
202
203 L<CPAN::Meta::Requirements> has been upgraded from version 2.126 to 2.128.
204
205 =item *
206
207 L<experimental> has been upgraded from version 0.008 to 0.010.
208
209 =item *
210
211 L<ExtUtils::CBuilder> has been upgraded from version 0.280217 to 0.280219.
212 L<[perl #122675]|https://rt.perl.org/Ticket/Display.html?id=122675>
213
214 =item *
215
216 L<ExtUtils::Install> has been upgraded from version 1.68 to 2.04.
217
218 =item *
219
220 L<ExtUtils::Manifest> has been upgraded from version 1.65 to 1.68.
221 L<[perl #122415]|https://rt.perl.org/Ticket/Display.html?id=122415>
222
223 =item *
224
225 L<File::Find> has been upgraded from version 1.27 to 1.28.
226
227 C<find()> and C<finddepth()> will now warn if passed inappropriate or
228 misspelled options.
229
230 =item *
231
232 L<Getopt::Std> has been upgraded from version 1.10 to 1.11.
233
234 =item *
235
236 L<HTTP::Tiny> has been upgraded from version 0.047 to 0.049.
237
238 =item *
239
240 L<IO> has been upgraded from version 1.33 to 1.34.
241
242 =item *
243
244 L<IO::Socket::IP> has been upgraded from version 0.31 to 0.32.
245
246 =item *
247
248 L<Locale::Codes> has been upgraded from version 3.31 to 3.32.
249
250 =item *
251
252 L<Module::CoreList> has been upgraded from version 5.021003 to 5.20140915.
253
254 =item *
255
256 L<overload> has been upgraded from version 1.22 to 1.23.
257
258 =item *
259
260 PathTools has been upgraded from version 3.49 to 3.50.
261
262 =item *
263
264 L<Pod::Perldoc> has been upgraded from version 3.23 to 3.24.
265
266 =item *
267
268 L<POSIX> has been upgraded from version 1.42 to 1.43.
269
270 The C99 math functions and constants (for example acosh, round, M_E, M_PI) have
271 been added.
272
273 =item *
274
275 Scalar-List-Utils has been upgraded from version 1.39 to 1.41.
276
277 =item *
278
279 L<Term::ReadLine> has been upgraded from version 1.14 to 1.15.
280
281 =item *
282
283 L<Test::Harness> has been upgraded from version 3.32 to 3.33.
284
285 =item *
286
287 L<Test::Simple> has been upgraded from version 1.001003 to 1.001006.
288
289 =item *
290
291 L<threads> has been upgraded from version 1.95 to 1.96.
292
293 =item *
294
295 L<Time::Piece> has been upgraded from version 1.27 to 1.29.
296
297 =item *
298
299 L<version> has been upgraded from version 0.9908 to 0.9909.
300
301 =back
302
303 =head2 Removed Modules and Pragmata
304
305 =over 4
306
307 =item *
308
309 XXX
310
311 =back
312
313 =head1 Documentation
314
315 XXX Changes to files in F<pod/> go here.  Consider grouping entries by
316 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
317
318 =head2 New Documentation
319
320 XXX Changes which create B<new> files in F<pod/> go here.
321
322 =head3 L<XXX>
323
324 XXX Description of the purpose of the new file here
325
326 =head2 Changes to Existing Documentation
327
328 XXX Changes which significantly change existing files in F<pod/> go here.
329 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
330 section.
331
332 =head3 L<perlsyn>
333
334 =over 4
335
336 =item *
337
338 An ambiguity in the documentation of the Ellipsis statement has
339 been corrected.
340 L<[perl #122661]|https://rt.perl.org/Ticket/Display.html?id=122661>
341
342 =back
343
344 =head3 L<perlxs>
345
346 =over 4
347
348 =item *
349
350 Added a discussion of locale issues in XS code.
351
352 =back
353
354 =head1 Diagnostics
355
356 The following additions or changes have been made to diagnostic output,
357 including warnings and fatal error messages.  For the complete list of
358 diagnostic messages, see L<perldiag>.
359
360 XXX New or changed warnings emitted by the core's C<C> code go here.  Also
361 include any changes in L<perldiag> that reconcile it to the C<C> code.
362
363 =head2 New Diagnostics
364
365 XXX Newly added diagnostic messages go under here, separated into New Errors
366 and New Warnings
367
368 =head3 New Errors
369
370 =over 4
371
372 =item *
373
374 XXX L<message|perldiag/"message">
375
376 =back
377
378 =head3 New Warnings
379
380 =over 4
381
382 =item *
383
384 XXX L<message|perldiag/"message">
385
386 =back
387
388 =head2 Changes to Existing Diagnostics
389
390 XXX Changes (i.e. rewording) of diagnostic messages go here
391
392 =over 4
393
394 =item *
395
396 XXX Describe change here
397
398 =back
399
400 =head2 Diagnostic Removals
401
402 =over 4
403
404 =item *
405
406 "Constant is not a FOO reference"
407
408 Compile-time checking of constant dereferencing (e.g.,
409 C<< my_constant->() >>) has been removed, since it was not taking
410 overloading into account.
411 L<[perl #69456]|https://rt.perl.org/Ticket/Display.html?id=69456>
412 L<[perl #122607]|https://rt.perl.org/Ticket/Display.html?id=122607>
413
414 =item *
415
416 The warning "Ambiguous use of -foo resolved as -&foo()" has been removed.
417 There is actually no ambiguity here, and this impedes the use of negated
418 constants; e.g., C<-Inf>.
419
420 =item *
421
422 The little-known C<my Class $var> syntax (see L<fields> and L<attributes>)
423 could get confused in the scope of C<use utf8> if C<Class> were a constant
424 whose value contained Latin-1 characters.
425
426 =back
427
428 =head1 Utility Changes
429
430 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
431 Most of these are built within the directory F<utils>.
432
433 [ List utility changes as a =head2 entry for each utility and =item
434 entries for each change
435 Use L<XXX> with program names to get proper documentation linking. ]
436
437 =head2 L<XXX>
438
439 =over 4
440
441 =item *
442
443 XXX
444
445 =back
446
447 =head1 Configuration and Compilation
448
449 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
450 go here.  Any other changes to the Perl build process should be listed here.
451 However, any platform-specific changes should be listed in the
452 L</Platform Support> section, instead.
453
454 [ List changes as a =item entry ].
455
456 =over 4
457
458 =item *
459
460 XXX
461
462 =back
463
464 =head1 Testing
465
466 XXX Any significant changes to the testing of a freshly built perl should be
467 listed here.  Changes which create B<new> files in F<t/> go here as do any
468 large changes to the testing harness (e.g. when parallel testing was added).
469 Changes to existing files in F<t/> aren't worth summarizing, although the bugs
470 that they represent may be covered elsewhere.
471
472 [ List each test improvement as a =item entry ]
473
474 =over 4
475
476 =item *
477
478 XXX
479
480 =back
481
482 =head1 Platform Support
483
484 XXX Any changes to platform support should be listed in the sections below.
485
486 [ Within the sections, list each platform as a =item entry with specific
487 changes as paragraphs below it. ]
488
489 =head2 New Platforms
490
491 XXX List any platforms that this version of perl compiles on, that previous
492 versions did not.  These will either be enabled by new files in the F<hints/>
493 directories, or new subdirectories and F<README> files at the top level of the
494 source tree.
495
496 =over 4
497
498 =item XXX-some-platform
499
500 XXX
501
502 =back
503
504 =head2 Discontinued Platforms
505
506 XXX List any platforms that this version of perl no longer compiles on.
507
508 =over 4
509
510 =item XXX-some-platform
511
512 XXX
513
514 =back
515
516 =head2 Platform-Specific Notes
517
518 XXX List any changes for specific platforms.  This could include configuration
519 and compilation changes or changes in portability/compatibility.  However,
520 changes within modules for platforms should generally be listed in the
521 L</Modules and Pragmata> section.
522
523 =over 4
524
525 =item XXX-some-platform
526
527 XXX
528
529 =back
530
531 =head1 Internal Changes
532
533 XXX Changes which affect the interface available to C<XS> code go here.  Other
534 significant internal changes for future core maintainers should be noted as
535 well.
536
537 [ List each change as a =item entry ]
538
539 =over 4
540
541 =item *
542
543 C<save_re_context> no longer does anything and has been moved to
544 F<mathoms.c>.
545
546 =item *
547
548 C<cv_name> is a new API function that can be passed a CV or GV.  It returns
549 an SV containing the name of the subroutine for use in diagnostics.
550 L<[perl #116735]|https://rt.perl.org/Ticket/Display.html?id=116735>
551 L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
552
553 =item *
554
555 C<cv_set_call_checker_flags> is a new API function that works like
556 C<cv_set_call_checker>, except that it allows the caller to specify whether
557 the call checker requires a full GV for reporting the subroutine's name, or
558 whether it could be passed a CV instead.  Whatever value is passed will be
559 acceptable to C<cv_name>.  C<cv_set_call_checker> guarantees there will be
560 a GV, but it may have to create one on the fly, which is inefficient.
561 L<[perl #116735]|https://rt.perl.org/Ticket/Display.html?id=116735>
562
563 =item *
564
565 C<CvGV> (which is not part of the API) is now a more complex macro, which
566 may call a function and reify a GV.  For those cases where is has been used
567 as a boolean, C<CvHASGV> has been added, which will return true for CVs
568 that notionally have GVs, but without reifying the GV.  C<CvGV> also
569 returns a GV now for lexical subs.
570 L<[perl #120441]|https://rt.perl.org/Ticket/Display.html?id=120441>
571
572 =item *
573
574 Added L<perlapi/sync_locale>.
575 Changing the program's locale should be avoided by XS code.  Nevertheless,
576 certain non-Perl libraries called from XS, such as C<Gtk> do so.  When this
577 happens, Perl needs to be told that the locale has changed.  Use this function
578 to do so, before returning to Perl.
579
580 =back
581
582 =head1 Selected Bug Fixes
583
584 XXX Important bug fixes in the core language are summarized here.  Bug fixes in
585 files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
586
587 [ List each fix as a =item entry ]
588
589 =over 4
590
591 =item *
592
593 XXX
594
595 =item *
596
597 Constant dereferencing now works correctly for typeglob constants.
598 Previously the glob was stringified and its name looked up.  Now the glob
599 itself is used.
600 L<[perl #69456]|https://rt.perl.org/Ticket/Display.html?id=69456>
601
602 =item *
603
604 When parsing a funny character ($ @ % &) followed by braces, the parser no
605 longer tries to guess whether it is a block or a hash constructor (causing
606 a syntax error when it guesses the latter), since it can only be a block.
607
608 =item *
609
610 C<undef $reference> now frees the referent immediately, instead of hanging
611 on to it until the next statement.
612 L<[perl #122556]|https://rt.perl.org/Ticket/Display.html?id=122556>
613
614 =item *
615
616 Various cases where the name of a sub is used (autoload, overloading, error
617 messages) used to crash for lexical subs, but have been fixed.
618
619 =item *
620
621 Bareword lookup now tries to avoid vivifying packages if it turns out the
622 bareword is not going to be a subroutine name.
623
624 =item *
625
626 Compilation of anonymous constants (e.g., C<sub () { 3 }>) no longer
627 deletes any subroutine named C<__ANON__> in the current package.  Not only
628 was C<*__ANON__{CODE}> cleared, but there was a memory leak, too.  This bug
629 goes back to perl 5.8.0.
630
631 =item *
632
633 Stub declarations like C<sub f;> and C<sub f ();> no longer wipe out
634 constants of the same name declared by C<use constant>.  This bug was
635 introduced in perl 5.10.0.
636
637 =item *
638
639 Under some conditions a warning raised in compilation of regular
640 expression patterns could be displayed multiple times.  This is now
641 fixed.
642
643 =item *
644
645 C<qr/[\N{named sequence}]/> now works properly in many instances.  Some
646 names known to C<\N{...}> refer to a sequence of multiple characters,
647 instead of the usual single character.  Bracketed character classes
648 generally only match single characters, but now special handling has
649 been added so that they can match named sequences, but not if the class
650 is inverted or the sequence is specified as the beginning or end of a
651 range.  In these cases, the only behavior change from before is a slight
652 rewording of the fatal error message given when this class is part of a
653 C<?[...])> construct.  When the C<[...]> stands alone, the same
654 non-fatal warning as before is raised, and only the first character in
655 the sequence is used, again just as before.
656
657 =item *
658
659 Tainted constants evaluated at compile time no longer cause unrelated
660 statements to become tainted.
661 L<[perl #122669]|https://rt.perl.org/Ticket/Display.html?id=122669>
662
663 =item *
664
665 C<open $$fh, ...>, which vivifies a handle with a name like "main::_GEN_0",
666 was not giving the handle the right reference count, so a double free could
667 happen.
668
669 =item *
670
671 When deciding that a bareword was a method name, the parser would get
672 confused if an "our" sub with the same name existed, and look up the method
673 in the package of the "our" sub, instead of the package of the invocant.
674
675 =item *
676
677 The parser no longer gets confused by C<\U=> within a double-quoted string.
678 It used to produce a syntax error, but now compiles it correctly.
679 L<[perl #80368]|https://rt.perl.org/Ticket/Display.html?id=80368>
680
681 =item *
682
683 It has always been the intention for the C<-B> and C<-T> file test
684 operators to treat UTF-8 encoded files as text.
685 (L<perlfunc|perlfunc/-X FILEHANDLE> has been updated to say this.)
686 Previously, it was possible for some files to be considered UTF-8 that
687 actually weren't valid UTF-8.  This is now fixed.  The operators now
688 work on EBCDIC platforms as well.
689
690 =item *
691
692 Under some conditions warning messages raised during regular expression
693 pattern compilation were being output more than once.  This has now been
694 fixed.
695
696 =item *
697
698 A regression has been fixed that was introduced in v5.20.0 (fixed in
699 v5.20.1 as well as here) in which a UTF-8 encoded regular expression
700 pattern that contains a single ASCII lowercase letter does not match its
701 uppercase counterpart.
702 L<[perl #122655]|https://rt.perl.org/Ticket/Display.html?id=122655>
703
704 =item *
705
706 Constant folding could incorrectly suppress warnings if lexical warnings
707 (C<use warnings> or C<no warnings>) were not in effect and C<$^W> were
708 false at compile time and true at run time.
709
710 =item *
711
712 Loading UTF8 tables during a regular expression match could cause assertion
713 failures under debugging builds if the previous match used the very same
714 regular expression.
715 L<[perl #122747]|https://rt.perl.org/Ticket/Display.html?id=122747>
716
717 =item *
718
719 Thread cloning used to work incorrectly for lexical subs, possibly causing
720 crashes or double frees on exit.
721
722 =item *
723
724 Since perl 5.14.0, deleting C<$SomePackage::{__ANON__}> and then undefining
725 an anonymous subroutine could corrupt things internally, resulting in
726 L<Devel::Peek> crashing or L<B.pm|B> giving nonsensical data.  This has
727 been fixed.
728
729 =item *
730
731 C<(caller $n)[3]> now reports names of lexical subs, instead of treating
732 them as "(unknown)".
733
734 =item *
735
736 C<sort subname LIST> now supports lexical subs for the comparison routine.
737
738 =back
739
740 =head1 Known Problems
741
742 XXX Descriptions of platform agnostic bugs we know we can't fix go here.  Any
743 tests that had to be C<TODO>ed for the release would be noted here.  Unfixed
744 platform specific bugs also go here.
745
746 [ List each fix as a =item entry ]
747
748 =over 4
749
750 =item *
751
752 XXX
753
754 =back
755
756 =head1 Errata From Previous Releases
757
758 =over 4
759
760 =item *
761
762 XXX Add anything here that we forgot to add, or were mistaken about, in
763 the perldelta of a previous release.
764
765 =back
766
767 =head1 Obituary
768
769 XXX If any significant core contributor has died, we've added a short obituary
770 here.
771
772 =head1 Acknowledgements
773
774 XXX Generate this with:
775
776   perl Porting/acknowledgements.pl v5.21.3..HEAD
777
778 =head1 Reporting Bugs
779
780 If you find what you think is a bug, you might check the articles recently
781 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
782 https://rt.perl.org/ .  There may also be information at
783 http://www.perl.org/ , the Perl Home Page.
784
785 If you believe you have an unreported bug, please run the L<perlbug> program
786 included with your release.  Be sure to trim your bug down to a tiny but
787 sufficient test case.  Your bug report, along with the output of C<perl -V>,
788 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
789
790 If the bug you are reporting has security implications, which make it
791 inappropriate to send to a publicly archived mailing list, then please send it
792 to perl5-security-report@perl.org.  This points to a closed subscription
793 unarchived mailing list, which includes all the core committers, who will be
794 able to help assess the impact of issues, figure out a resolution, and help
795 co-ordinate the release of patches to mitigate or fix the problem across all
796 platforms on which Perl is supported.  Please only use this address for
797 security issues in the Perl core, not for modules independently distributed on
798 CPAN.
799
800 =head1 SEE ALSO
801
802 The F<Changes> file for an explanation of how to view exhaustive details on
803 what changed.
804
805 The F<INSTALL> file for how to build Perl.
806
807 The F<README> file for general stuff.
808
809 The F<Artistic> and F<Copying> files for copyright information.
810
811 =cut