5 [ this is a template for a new perldelta file. Any text flagged as XXX needs
6 to be processed before release. ]
8 perldelta - what is new for perl v5.17.4
12 This document describes differences between the 5.17.3 release and the 5.17.4
15 If you are upgrading from an earlier release such as 5.17.2, first read
16 L<perl5173delta>, which describes differences between 5.17.2 and 5.17.3.
20 XXX Any important notices here
22 =head1 Core Enhancements
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.
28 [ List each enhancement as a =head2 entry ]
30 =head2 Latest Unicode 6.2 beta is included
32 This is supposed to be the final data for 6.2, unless glitches are
33 found. The earlier experimental 6.2 beta data has been reverted, and
34 this used instead. Not all the changes that were proposed for 6.2 and
35 that were in the earlier beta versions are actually going into 6.2. In
36 particular, there are no changes from 6.1 in the General_Category of any
37 characters. 6.2 does revise the C<\X> handling for the REGIONAL
38 INDICATOR characters that were added in Unicode 6.0. Perl now for the
39 first time fully handles this revision.
41 =head2 New DTrace probes
43 The following new DTrace probes have been added:
57 This new variable provides access to the filehandle that was last read.
58 This is the handle used by C<$.> and by C<tell> and C<eof> without
61 =head2 Looser here-doc parsing
63 Here-doc terminators no longer require a terminating newline character when
64 they occur at the end of a file. This was already the case at the end of a
65 string eval [perl #65838].
67 =head2 New mechanism for experimental features
69 Newly-added experimental features will now require this incantation:
71 no warnings "experimental:feature_name";
72 use feature "feature_name"; # would warn without the prev line
74 There is a new warnings category, called "experimental", containing
75 warnings that the L<feature> pragma emits when enabling experimental
78 Newly-added experimental features will also be given special warning IDs,
79 which consist of "experimental:" followed by the name of the feature. (The
80 plan is to extend this mechanism eventually to all warnings, to allow them
81 to be enabled or disabled individually, and not just by category.)
85 no warnings "experimental:feature_name";
87 you are taking responsibility for any breakage that future changes to, or
88 removal of, the feature may cause.
90 =head2 Lexical subroutines
92 This new feature is still considered experimental. To enable it, use the
93 mechanism described above:
96 no warnings "experimental:lexical_subs";
97 use feature "lexical_subs";
99 You can now declare subroutines with C<state sub foo>, C<my sub foo>, and
100 C<our sub foo>. (C<state sub> requires that the "state" feature be
101 enabled, unless you write it as C<CORE::state sub foo>.)
103 C<state sub> creates a subroutine visible within the lexical scope in which
104 it is declared. The subroutine is shared between calls to the outer sub.
106 C<my sub> declares a lexical subroutine that is created each time the
107 enclosing block is entered. C<state sub> is generally slightly faster than
110 C<our sub> declares a lexical alias to the package subroutine of the same
113 See L<perlsub/Lexical Subroutines>.
117 XXX Any security-related notices go here. In particular, any security
118 vulnerabilities closed should be noted here rather than in the
119 L</Selected Bug Fixes> section.
121 [ List each security issue as a =head2 entry ]
123 =head1 Incompatible Changes
125 XXX For a release on a stable branch, this section aspires to be:
127 There are no changes intentionally incompatible with 5.XXX.XXX
128 If any exist, they are bugs, and we request that you submit a
129 report. See L</Reporting Bugs> below.
131 [ List each incompatible change as a =head2 entry ]
133 =head2 Here-doc parsing
135 The body of a here-document inside a quote-like operator now always begins
136 on the line after the "<<foo" marker. Previously, it was documented to
137 begin on the line following the containing quote-like operator, but that
138 was only sometimes the case [perl #114040].
140 =head2 Stricter parsing of substitution replacement
142 It is no longer possible to abuse the way the parser parses C<s///e> like
145 %_=(_,"Just another ");
149 =head2 Interaction of lexical and default warnings
151 Turning on any lexical warnings used first to disable all default warnings
152 if lexical warnings were not already enabled:
154 $*; # deprecation warning
156 $#; # void warning; no deprecation warning
158 Now, the debugging, deprecated, glob, inplace and malloc warnings
159 categories are left on when turning on lexical warnings (unless they are
160 turned off by C<no warnings>, of course).
162 This may cause deprecation warnings to occur in code that used to be free
165 Those are the only categories consisting only of default warnings. Default
166 warnings in other categories are still disabled by C<use warnings
167 "category">, as we do not yet have the infrastructure for controlling
170 =head2 C<state sub> and C<our sub>
172 Due to an accident of history, C<state sub> and C<our sub> were equivalent
173 to a plain C<sub>, so one could even create an anonymous sub with
174 C<our sub { ... }>. These are now disallowed outside of the "lexical_subs"
175 feature. Under the "lexical_subs" feature they have new meanings described
176 in L<perlsub/Lexical Subroutines>.
178 =head2 C<gv_fetchmeth_*> and SUPER
180 The various C<gv_fetchmeth_*> XS functions used to treat a package whose
181 named ended with ::SUPER specially. A method lookup on the Foo::SUPER
182 package would be treated as a SUPER method lookup on the Foo package. This
183 is no longer the case. To do a SUPER lookup, pass the Foo stash and the
188 XXX Any deprecated features, syntax, modules etc. should be listed here. In
189 particular, deprecated modules should be listed here even if they are listed as
190 an updated module in the L</Modules and Pragmata> section.
192 [ List each deprecation as a =head2 entry ]
194 =head1 Performance Enhancements
196 XXX Changes which enhance performance without changing behaviour go here.
197 There may well be none in a stable release.
199 [ List each enhancement as a =item entry ]
205 Speed up in regular expression matching against Unicode properties. The
206 largest gain is for C<\X>, the Unicode "extended grapheme cluster". The
207 gain for it is about 35% - 40%. Bracketed character classes, e.g.,
208 C<[0-9\x{100}]> containing code points above 255 are also now faster.
212 On platforms supporting it, several former macros are now implemented as static
213 inline functions. This should speed things up slightly on non-GCC platforms.
217 Apply the optimisation of hashes in boolean context, such as in C<if> or C<and>,
218 to constructs in non-void context.
222 Extend the optimisation of hashes in boolean context to C<scalar(%hash)>,
223 C<%hash ? ... : ...>, and C<sub { %hash || ... }>.
227 When making a copy of the string being matched against (so that $1, $& et al
228 continue to show the correct value even if the original string is subsequently
229 modified), only copy that substring of the original string needed for the
230 capture variables, rather than copying the whole string.
232 This is a big win for code like
235 $_ = 'x' x 1_000_000;
238 Also, when pessimizing if the code contains C<$`>, C<$&> or C<$'>, record the
239 presence of each variable separately, so that the determination of the substring
240 range is based on each variable separately. So performance-wise,
244 is now roughly equivalent to
248 whereas previously it was like
256 is now roughly equivalent to
264 =head1 Modules and Pragmata
266 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
267 go here. If Module::CoreList is updated, generate an initial draft of the
268 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
269 entries to STDOUT. Results can be pasted in place of the '=head2' entries
270 below. A paragraph summary for important changes should then be added by hand.
271 In an ideal world, dual-life modules would have a F<Changes> file that could be
274 [ Within each section, list entries as a =item entry ]
276 =head2 New Modules and Pragmata
286 =head2 Updated Modules and Pragmata
292 L<Archive::Tar> has been upgraded from version 1.88 to 1.90. This adds
297 L<B> has been upgraded from version 1.37 to 1.38. This makes the module work
298 with the new pad API.
302 L<B::Concise> has been upgraded from version 0.92 to 0.93. This adds support
303 for the new C<OpMAYBE_TRUEBOOL> and C<OPpTRUEBOOL> flags.
307 L<B::Deparse> has been upgraded from version 1.16 to 1.17. This suppresses
308 trailing semicolons in formats.
312 L<DB_File> has been upgraded from version 1.826 to 1.827. The main Perl module
313 no longer uses the C<"@_"> construct.
317 L<Devel::Peek> has been upgraded from version 1.09 to 1.10. This fixes
318 compilation with C++ compilers and makes the module work with the new pad API.
322 L<DynaLoader> has been upgraded from version 1.15 to 1.16. This fixes warnings
323 about using C<CODE> sections without an C<OUTPUT> section.
327 L<ExtUtils::ParseXS> has been upgraded from version 3.17 to 3.18. This avoids a
328 bogus warning for initialised XSUB non-parameters [perl #112776].
332 L<File::Copy> has been upgraded from version 2.23 to 2.24. C<copy()> no longer
333 zeros files when copying into the same directory, and also now fails (as it has
334 long been documented to do) when attempting to copy a file over itself.
338 L<File::Find> has been upgraded from version 1.21 to 1.22. This fixes
339 inconsistent unixy path handling on VMS.
343 L<IPC::Open3> has been upgraded from version 1.12 to 1.13. The C<open3()>
344 function no longer uses C<POSIX::close()> to close file descriptors since that
345 breaks the ref-counting of file descriptors done by PerlIO in cases where the
346 file descriptors are shared by PerlIO streams, leading to attempts to close the
347 file descriptors a second time when any such PerlIO streams are closed later on.
351 L<Locale::Codes> has been upgraded from version 3.22 to 3.23. It includes some
356 L<Module::CoreList> has been upgraded from version 2.71 to 2.73. This restores
357 compatibility with older versions of perl and cleans up the corelist data for
362 L<Opcode> has been upgraded from version 1.23 to 1.24 to reflect the removal of
363 the boolkeys opcode and the addition of the clonecv, introcv and padcv
368 L<Socket> has been upgraded from version 2.004 to 2.006.
369 C<unpack_sockaddr_in()> and C<unpack_sockaddr_in6()> now return just the IP
370 address in scalar context, and C<inet_ntop()> now guards against incorrect
371 length scalars being passed in.
375 L<Storable> has been upgraded from version 2.38 to 2.39. This contains Various
376 bugfixes, including compatibility fixes for older versions of Perl and vstring
381 L<threads::shared> has been upgraded from version 1.40 to 1.41. This adds the
382 option to warn about or ignore attempts to clone structures that can't be
383 cloned, as opposed to just unconditionally dying in that case.
387 L<XSLoader> has been upgraded from version 0.15 to 0.16.
391 =head2 Removed Modules and Pragmata
403 XXX Changes to files in F<pod/> go here. Consider grouping entries by
404 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
406 =head2 New Documentation
408 XXX Changes which create B<new> files in F<pod/> go here.
412 XXX Description of the purpose of the new file here
414 =head2 Changes to Existing Documentation
416 XXX Changes which significantly change existing files in F<pod/> go here.
417 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
426 XXX Description of the change here
432 The following additions or changes have been made to diagnostic output,
433 including warnings and fatal error messages. For the complete list of
434 diagnostic messages, see L<perldiag>.
436 XXX New or changed warnings emitted by the core's C<C> code go here. Also
437 include any changes in L<perldiag> that reconcile it to the C<C> code.
439 =head2 New Diagnostics
441 XXX Newly added diagnostic messages go under here, separated into New Errors
450 XXX L<message|perldiag/"message">
460 L<Experimental "%s" subs not enabled|perldiag/"Experimental "%s" subs not enabled">
462 (F) To use lexical subs, you must first enable them:
464 no warnings 'experimental:lexical_subs';
465 use feature 'lexical_subs';
470 L<Subroutine "&%s" is not available|perldiag/"Subroutine "&%s" is not available">
472 (W closure) During compilation, an inner named subroutine or eval is
473 attempting to capture an outer lexical subroutine that is not currently
474 available. This can happen for one of two reasons. First, the lexical
475 subroutine may be declared in an outer anonymous subroutine that has not
476 yet been created. (Remember that named subs are created at compile time,
477 while anonymous subs are created at run-time.) For example,
479 sub { my sub a {...} sub f { \&a } }
481 At the time that f is created, it can't capture the current the "a" sub,
482 since the anonymous subroutine hasn't been created yet. Conversely, the
483 following won't give a warning since the anonymous subroutine has by now
484 been created and is live:
486 sub { my sub a {...} eval 'sub f { \&a }' }->();
488 The second situation is caused by an eval accessing a variable that has
489 gone out of scope, for example,
497 Here, when the '\&a' in the eval is being compiled, f() is not currently
498 being executed, so its &a is not available for capture.
502 L<"%s" subroutine &%s masks earlier declaration in same %s|perldiag/"%s" subroutine &%s masks earlier declaration in same %s>
504 (W misc) A "my" or "state" subroutine has been redeclared in the
505 current scope or statement, effectively eliminating all access to
506 the previous instance. This is almost always a typographical error.
507 Note that the earlier subroutine will still exist until the end of
508 the scope or until all closure references to it are destroyed.
512 L<The %s feature is experimental|perldiag/"The %s feature is experimental">
514 (S experimental) This warning is emitted if you enable an experimental
515 feature via C<use feature>. Simply suppress the warning if you want
516 to use the feature, but know that in doing so you are taking the risk
517 of using an experimental feature which may change or be removed in a
520 no warnings "experimental:lexical_subs";
521 use feature "lexical_subs";
525 =head2 Changes to Existing Diagnostics
527 XXX Changes (i.e. rewording) of diagnostic messages go here
533 L<vector argument not supported with alpha versions|perldiag/vector argument not supported with alpha versions>
535 This warning was not suppressable, even with C<no warnings>. Now it is
536 suppressible, and has been moved from the "internal" category to the
541 =head1 Utility Changes
543 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
544 Most of these are built within the directories F<utils> and F<x2p>.
546 [ List utility changes as a =head3 entry for each utility and =item
547 entries for each change
548 Use L<XXX> with program names to get proper documentation linking. ]
560 =head1 Configuration and Compilation
562 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
563 go here. Any other changes to the Perl build process should be listed here.
564 However, any platform-specific changes should be listed in the
565 L</Platform Support> section, instead.
567 [ List changes as a =item entry ].
573 F<Configure> will now correctly detect C<isblank()> when compiling with a C++
580 XXX Any significant changes to the testing of a freshly built perl should be
581 listed here. Changes which create B<new> files in F<t/> go here as do any
582 large changes to the testing harness (e.g. when parallel testing was added).
583 Changes to existing files in F<t/> aren't worth summarizing, although the bugs
584 that they represent may be covered elsewhere.
586 [ List each test improvement as a =item entry ]
596 =head1 Platform Support
598 XXX Any changes to platform support should be listed in the sections below.
600 [ Within the sections, list each platform as a =item entry with specific
601 changes as paragraphs below it. ]
605 XXX List any platforms that this version of perl compiles on, that previous
606 versions did not. These will either be enabled by new files in the F<hints/>
607 directories, or new subdirectories and F<README> files at the top level of the
612 =item XXX-some-platform
618 =head2 Discontinued Platforms
624 Support for VM/ESA has been removed. The port was tested on 2.3.0, which
625 IBM ended service on in March 2002. 2.4.0 ended service in June 2003, and
626 was superseded by Z/VM. The current version of Z/VM is V6.2.0, and scheduled
627 for end of service on 2015/04/30.
631 =head2 Platform-Specific Notes
633 XXX List any changes for specific platforms. This could include configuration
634 and compilation changes or changes in portability/compatibility. However,
635 changes within modules for platforms should generally be listed in the
636 L</Modules and Pragmata> section.
642 Fixed a problem where perl could crash while cleaning up threads (including the
643 main thread) in threaded debugging builds on Win32 and possibly other platforms
646 A rare race condition that would lead to L<sleep|perlfunc/sleep>
647 taking more time than requested, and upto a hang has been fixed [perl #33096].
651 In Configure, avoid running sed commands with flags not supported on Solaris.
655 Stop hardcoding an alignment on 8 byte boundaries to fix builds using
660 Fix linking on builds configured with -Dusemymalloc=y.
664 =head1 Internal Changes
666 XXX Changes which affect the interface available to C<XS> code go here. Other
667 significant internal changes for future core maintainers should be noted as
670 [ List each change as a =item entry ]
676 The APIs for accessing lexical pads have changed considerably.
678 C<PADLIST>s are now longer C<AV>s, but their own type instead. C<PADLIST>s now
679 contain a C<PAD> and a C<PADNAMELIST> of C<PADNAME>s, rather than C<AV>s for the
680 pad and the list of pad names. C<PAD>s, C<PADNAMELIST>s, and C<PADNAME>s are to
681 be accessed as such though the newly added pad API instead of the plain C<AV>
682 and C<SV> APIs. See L<perlapi> for details.
686 In the regex API, the numbered capture callbacks are passed an index
687 indicating what match variable is being accessed. There are special
688 index values for the C<$`, $&, $&> variables. Previously the same three
689 values were used to retrieve C<${^PREMATCH}, ${^MATCH}, ${^POSTMATCH}>
690 too, but these have now been assigned three separate values. See
691 L<perlreapi/Numbered capture callbacks>.
695 C<PL_sawampersand> was previously a boolean indicating that any of
696 C<$`, $&, $&> had been seen; it now contains three one-bit flags
697 indicating the presence of each of the variables individually.
701 =head1 Selected Bug Fixes
703 XXX Important bug fixes in the core language are summarized here. Bug fixes in
704 files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
710 The error "Can't localize through a reference" had disappeared in 5.16.0
711 when C<local %$ref> appeared on the last line of an lvalue subroutine.
712 This error disappeared for C<\local %$ref> in perl 5.8.1. It has now
717 The parsing of here-docs has been improved significantly, fixing several
718 parsing bugs and crashes and one memory leak, and correcting wrong
719 subsequent line numbers under certain conditions.
723 Inside an eval, the error message for an unterminated here-doc no longer
724 has a newline in the middle of it [perl #70836].
728 A substitution inside a substitution pattern (C<s/${s|||}//>) no longer
733 It may be an odd place to allow comments, but C<s//"" # hello/e> has
734 always worked, I<unless> there happens to be a null character before the
735 first #. Now it works even in the presence of nulls.
739 An invalid range in C<tr///> or C<y///> no longer results in a memory leak.
743 String eval no longer treats a semicolon-delimited quote-like operator at
744 the very end (C<eval 'q;;'>) as a syntax error.
748 C<< warn {$_ => 1} + 1 >> is no longer a syntax error. The parser used to
749 get confused with certain list operators followed by an anonymous hash and
750 then an infix operator that shares its form with a unary operator.
754 C<(caller $n)[6]> (which gives the text of the eval) used to return the
755 actual parser buffer. Modifying it could result in crashes. Now it always
756 returns a copy. The string returned no longer has "\n;" tacked on to the
757 end. The returned text also includes here-doc bodies, which used to be
762 Reset the utf8 position cache when accessing magical variables to avoid the
763 string buffer and the utf8 position cache to get out of sync
768 Various cases of get magic being called twice for magical utf8 strings have been
773 This code (when not in the presence of C<$&> etc)
775 $_ = 'x' x 1_000_000;
778 used to skip the buffer copy for performance reasons, but suffered from C<$1>
779 etc changing if the original string changed. That's now been fixed.
783 Perl doesn't use PerlIO anymore to report out of memory messages, as PerlIO
784 might attempt to allocate more memory.
788 In a regular expression, if something is quantified with C<{n,m}>
789 where C<S<n E<gt> m>>, it can't possibly match. Previously this was a fatal error,
790 but now is merely a warning (and that something won't match). [perl #82954].
794 It used to be possible for formats defined in subroutines that have
795 subquently been undefined and redefined to close over variables in the
796 wrong pad (the newly-defined enclosing sub), resulting in crashes or
797 "Bizarre copy" errors.
801 Redefinition of XSUBs at run time could produce warnings with the wrong
806 The %vd sprintf format does not support version objects for alpha versions.
807 It used to output the format itself (%vd) when passed an alpha version, and
808 also emit an "Invalid conversion in printf" warning. It no longer does,
809 but produces the empty string in the output. It also no longer leaks
814 A bug fix in an earlier 5.17.x release caused C<no a a 3> (a syntax error)
815 to result in a bad read or assertion failure, because an op was being freed
820 C<< $obj->SUPER::method >> calls in the main package could fail if the
821 SUPER package had already been accessed by other means.
825 Stash aliasing (C<*foo:: = *bar::>) no longer causes SUPER calls to ignore
826 changes to methods or @ISA or use the wrong package.
830 Method calls on packages whose names end in ::SUPER are no longer treated
831 as SUPER method calls, resulting in failure to find the method.
832 Furthermore, defining subroutines in such packages no longer causes them to
833 be found by SUPER method calls on the containing package [perl #114924].
837 =head1 Known Problems
839 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
840 tests that had to be C<TODO>ed for the release would be noted here. Unfixed
841 platform specific bugs also go here.
843 [ List each fix as a =item entry ]
849 Changes in the lexical pad API break several CPAN modules.
851 To avoid having to patch those modules again later if we change pads from AVs
852 into their own types, APIs for accessing the contents of pads have been added.
858 XXX If any significant core contributor has died, we've added a short obituary
861 =head1 Acknowledgements
863 XXX Generate this with:
865 perl Porting/acknowledgements.pl v5.17.3..HEAD
867 =head1 Reporting Bugs
869 If you find what you think is a bug, you might check the articles recently
870 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
871 http://rt.perl.org/perlbug/ . There may also be information at
872 http://www.perl.org/ , the Perl Home Page.
874 If you believe you have an unreported bug, please run the L<perlbug> program
875 included with your release. Be sure to trim your bug down to a tiny but
876 sufficient test case. Your bug report, along with the output of C<perl -V>,
877 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
879 If the bug you are reporting has security implications, which make it
880 inappropriate to send to a publicly archived mailing list, then please send it
881 to perl5-security-report@perl.org. This points to a closed subscription
882 unarchived mailing list, which includes all the core committers, who will be
883 able to help assess the impact of issues, figure out a resolution, and help
884 co-ordinate the release of patches to mitigate or fix the problem across all
885 platforms on which Perl is supported. Please only use this address for
886 security issues in the Perl core, not for modules independently distributed on
891 The F<Changes> file for an explanation of how to view exhaustive details on
894 The F<INSTALL> file for how to build Perl.
896 The F<README> file for general stuff.
898 The F<Artistic> and F<Copying> files for copyright information.