4 This has been completed up to e7d0a3fbd9, except for
5 e032854 khw [perl #32080] is_utf8_string() reads too far
6 b0f2e9e nwclark Fix two bugs related to pod files outside of pod/ (important enough?)
10 [ this is a template for a new perldelta file. Any text flagged as
11 XXX needs to be processed before release. ]
13 perldelta - what is new for perl v5.15.6
17 This document describes differences between the 5.15.5 release and
20 If you are upgrading from an earlier release such as 5.15.4, first read
21 L<perl5155delta>, which describes differences between 5.15.4 and
26 XXX Any important notices here
28 =head1 Core Enhancements
30 XXX New core language features go here. Summarise user-visible core language
31 enhancements. Particularly prominent performance optimisations could go
32 here, but most should go in the L</Performance Enhancements> section.
34 [ List each enhancement as a =head2 entry ]
38 The new C<__SUB__> token, available under the "current_sub" feature (see
39 L<feature>) or C<use v5.15>, returns a reference to the current subroutine,
40 making it easier to write recursive closures.
42 =head2 New option for the debugger's B<t> command
44 The B<t> command in the debugger, which toggles tracing mode, now accepts a
45 numerical argument that determines how many levels of subroutine calls to
48 =head2 Return value of C<tied>
50 The value returned by C<tied> on a tied variable is now the actual scalar
51 that holds the object to which the variable is tied. This allows ties to
52 be weakened with C<Scalar::Util::weaken(tied $tied_variable)>.
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.
60 [ List each security issue as a =head2 entry ]
62 =head1 Incompatible Changes
64 XXX For a release on a stable branch, this section aspires to be:
66 There are no changes intentionally incompatible with 5.XXX.XXX
67 If any exist, they are bugs and reports are welcome.
69 [ List each incompatible change as a =head2 entry ]
71 =head2 C<substr> lvalue revamp
73 When C<substr> is called in lvalue or potential lvalue context with two or
74 three arguments, a special lvalue scalar is returned that modifies the
75 original string (the first argument) when assigned to.
77 Previously, the offsets (the second and third arguments) passed to
78 C<substr> would be converted immediately to match the string, negative
79 offsets being translated to positive and offsets beyond the end of the
80 string being truncated.
82 Now, the offsets are recorded without modification in the special lvalue
83 scalar that is returned, and the original string is not even looked at by
84 C<substr> itself, but only when the returned lvalue is read or modified.
86 These changes result in several incompatible changes and bug fixes:
92 If the original string changes length after the call to C<substr> but
93 before assignment to its return value, negative offsets will remember
94 their position from the end of the string, affecting code like this:
96 my $string = "string";
97 my $lvalue = \substr $string, -4, 2;
98 print $lvalue, "\n"; # prints "ri"
99 $string = "bailing twine";
100 print $lvalue, "\n"; # prints "wi"; used to print "il"
102 The same thing happens with an omitted third argument. The returned lvalue
103 will always extend to the end of the string, even if the string becomes
108 Tied (and otherwise magical) variables are no longer exempt from the
109 "Attempt ot use reference as lvalue in substr" warning.
113 That warning now occurs when the returned lvalue is assigned to, not when
114 C<substr> itself is called. This only makes a difference if the return
115 value of C<substr> is referenced and assigned to later.
119 The order in which "uninitialized" warnings occur for arguments to
120 C<substr> has changed.
124 Passing a substring of a read-only value or a typeglob to a function (potential lvalue context) no longer causes an immediate "Can't coerce" or "Modification of a read-only value" error. That error only occurs if and
125 when the value passed is assigned to.
127 The same thing happens with the "substr outside of string" error. If the
128 lvalue is only read, not written to, it is now just a warning, as with
133 C<substr> assignments no longer call FETCH twice if the first argument is a
134 tied variable, but just once.
138 It was impossible to fix all the bugs without an incompatible change, and
139 the behaviour of negative offsets was never specified, so the change was
144 The C<newCONSTSUB_flags> C-level function, added in 5.15.4, now has a
149 XXX Any deprecated features, syntax, modules etc. should be listed here.
150 In particular, deprecated modules should be listed here even if they are
151 listed as an updated module in the L</Modules and Pragmata> section.
153 [ List each deprecation as a =head2 entry ]
155 =head1 Performance Enhancements
157 XXX Changes which enhance performance without changing behaviour go here. There
158 may well be none in a stable release.
160 [ List each enhancement as a =item entry ]
166 Perl 5.12.0 sped up the destruction of objects whose classes define empty
167 C<DESTROY> methods (to prevent autoloading), simply by not calling such
168 empty methods. This release takes this optimisation a step further, by not
169 calling any C<DESTROY> method that begins with an C<return> statement.
170 This can be useful for destructors that are only used for debugging:
172 use constant DEBUG => 1;
173 sub DESTROY { return unless DEBUG; ... }
175 Constant-folding will reduce the first statement to C<return;> if DEBUG is
176 set to 0, triggering this optimisation.
180 Assign to a variable that holds a typeglob or copy-on-write scalar is now
181 much faster. Previously the typeglob would be stringified or the
182 copy-on-write scalar would be copied before being clobbered.
186 Assignment to a substring in void context is now more than twice its
187 previous speed. Instead of creating and returning a special lvalue scalar
188 that is then assigned to, C<substr> modifies the original string itself.
192 =head1 Modules and Pragmata
194 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
195 go here. If Module::CoreList is updated, generate an initial draft of the
196 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
197 entries to STDOUT. Results can be pasted in place of the '=head2' entries
198 below. A paragraph summary for important changes should then be added by hand.
199 In an ideal world, dual-life modules would have a F<Changes> file that could be
202 [ Within each section, list entries as a =item entry ]
204 =head2 New Modules and Pragmata
214 =head2 Updated Modules and Pragmata
220 L<Archive::Tar> has been upgraded from version 1.80 to version 1.82.
222 Adjustments to handle files >8gb (>0777777777777 octal) and a feature to
223 return the MD5SUM of files in the archive.
227 L<AutoLoader> has been upgraded from version 5.71 to version 5.72.
231 L<B::Debug> has been upgraded from version 1.16 to version 1.17.
235 L<B::Deparse> has been upgraded from version 1.09 to 1.10.
237 C<sort(foo(bar))> is now deparsed correctly. (C<sort foo(bar)>, how it used
238 to deparse, makes foo the sort routine, rather than a regular function
243 L<Compress::Raw::Zlib> has been upgraded from version 2.042 to version 2.045.
247 L<Compress::Raw::Bzip2> has been upgraded from version 2.042 to version 2.045.
251 L<CPANPLUS> has been upgraded from version 0.9112 to version 0.9113.
255 L<Data::Dumper> has been upgraded from version 2.134 to 2.135.
257 The XS implementation has been updated to account for the Unicode symbol
258 changes in Perl 5.15.4. It also knows how to output typeglobs with nulls
263 L<ExtUtils::ParseXS> has been upgraded from version 3.05 to version 3.07.
267 L<IO::Compress::Base> has been upgraded from version 2.042 to version 2.045.
269 Added zipdetails utility.
273 L<Locale::Codes> has been upgraded from version 3.18 to version 3.20.
275 The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now support retired codes.
276 All codesets may be specified by a constant or by their name now. Previously,
277 they were specified only by a constant.
278 The alias_code function exists for backward compatibility. It has been replaced by rename_country_code.
279 The alias_code function will be removed sometime after September, 2013.
280 All work is now done in the central module (Locale::Codes). Previously, some was still done in the
281 wrapper modules (Locale::Codes::*) but that is gone now.
282 Added Language Family codes (langfam) as defined in ISO 639-5.
286 L<Module::Loaded> has been uprgaded from version 0.06 to version 0.08.
290 L<Pod::LaTeX> has been upgraded from version 0.59 to version 0.60.
292 Added another LaTeX escape: --- => -{}-{}-
294 Pod::LaTeX doesn't handle -- in PODs specially, passing it directly to
295 LaTeX, which then proceeds to replace it with a single -. This patch
296 replaces ----- with -{}-{}-{}-{}-
300 L<POSIX> has been upgraded from version 1.26 to 1.27.
302 It no longer produces a "Constant subroutine TCSANOW redefined" warning on
305 XXX When did it start producing that warning? Was it post-5.15.5? Even if
306 it was not, adding a note will help whoever compiles perl5160delta.
310 L<Socket> has been upgraded from version 1.94_02 to version 1.96.
314 L<Unicode::Collate> has been upgraded from version 0.85 to version 0.87.
316 Tailored compatibility ideographs as well as unified ideographs for
317 the locales: ja, ko, zh__big5han, zh__gb2312han, zh__pinyin, zh__stroke.
319 Now Locale/*.pl files are searched in @INC.
323 L<UNIVERSAL> has been upgraded from version 1.10 to 1.11.
325 Documentation change clarifies return values from UNIVERSAL::VERSION.
329 =head2 Removed Modules and Pragmata
341 XXX Changes to files in F<pod/> go here. Consider grouping entries by
342 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
344 =head2 New Documentation
346 XXX Changes which create B<new> files in F<pod/> go here.
350 XXX Description of the purpose of the new file here
352 =head2 Changes to Existing Documentation
354 XXX Changes which significantly change existing files in F<pod/> go here.
355 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
364 XXX Description of the change here
370 The following additions or changes have been made to diagnostic output,
371 including warnings and fatal error messages. For the complete list of
372 diagnostic messages, see L<perldiag>.
374 XXX New or changed warnings emitted by the core's C<C> code go here. Also
375 include any changes in L<perldiag> that reconcile it to the C<C> code.
377 [ Within each section, list entries as a =item entry that links to perldiag,
382 L<Invalid version object|perldiag/"Invalid version object">
385 =head2 New Diagnostics
387 XXX Newly added diagnostic messages go here
395 XXX L<message|perldiag/"message">
405 XXX L<message|perldiag/"message">
409 =head2 Changes to Existing Diagnostics
411 XXX Changes (i.e. rewording) of diagnostic messages go here
417 Redefinition warnings for constant subroutines used to be mandatory, even
418 occurring under C<no warnings>. Now they respect the L<warnings> pragma.
422 The "Attempt to free non-existent shared string" has had the spelling of
423 "non-existent" corrected to "nonexistent". It was already listed with the
424 correct spelling in L<perldiag>.
428 The 'Use of "foo" without parentheses is ambiguous' warning has been
429 extended to apply also to user-defined subroutines with a (;$) prototype,
430 and not just to built-in functions.
434 =head1 Utility Changes
436 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
437 here. Most of these are built within the directories F<utils> and F<x2p>.
439 [ List utility changes as a =head3 entry for each utility and =item
440 entries for each change
441 Use L<XXX> with program names to get proper documentation linking. ]
449 L<zipdetails> displays information about the internal record structure of the zip file.
450 It is not concerned with displaying any details of the compressed data stored in the zip file.
454 =head1 Configuration and Compilation
456 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
457 go here. Any other changes to the Perl build process should be listed here.
458 However, any platform-specific changes should be listed in the
459 L</Platform Support> section, instead.
461 [ List changes as a =item entry ].
467 F<pod/roffitall> is now build by F<pod/buildtoc>, instead of being shipped
468 with the distribution. Its list of manpages is now generated (and therefore
469 current). See also RT #103202 for an unresolved related issue.
473 Perl 5.15.5 had a bug in its installation script, which did not install
474 F<unicore/Name.pm>. This has been corrected [perl #104226].
476 XXX Is that Perl version correct? Is the file path correct?
482 XXX Any significant changes to the testing of a freshly built perl should be
483 listed here. Changes which create B<new> files in F<t/> go here as do any
484 large changes to the testing harness (e.g. when parallel testing was added).
485 Changes to existing files in F<t/> aren't worth summarising, although the bugs
486 that they represent may be covered elsewhere.
488 [ List each test improvement as a =item entry ]
494 The F<substr.t> and F<substr_thr.t> scripts for testing C<substr> have been
495 moved under F<t/op/>, where they were originally. They had been moved
496 under F<t/re/> along with the substitution tests when that directory was
501 =head1 Platform Support
503 XXX Any changes to platform support should be listed in the sections below.
505 [ Within the sections, list each platform as a =item entry with specific
506 changes as paragraphs below it. ]
510 XXX List any platforms that this version of perl compiles on, that previous
511 versions did not. These will either be enabled by new files in the F<hints/>
512 directories, or new subdirectories and F<README> files at the top level of the
517 =item XXX-some-platform
523 =head2 Discontinued Platforms
525 XXX List any platforms that this version of perl no longer compiles on.
529 =item XXX-some-platform
535 =head2 Platform-Specific Notes
537 XXX List any changes for specific platforms. This could include configuration
538 and compilation changes or changes in portability/compatibility. However,
539 changes within modules for platforms should generally be listed in the
540 L</Modules and Pragmata> section.
544 =item XXX-some-platform
550 =head1 Internal Changes
552 XXX Changes which affect the interface available to C<XS> code go here.
553 Other significant internal changes for future core maintainers should
556 [ List each change as a =item entry ]
566 =head1 Selected Bug Fixes
568 XXX Important bug fixes in the core language are summarised here.
569 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
570 L</Modules and Pragmata>.
572 [ List each fix as a =item entry ]
578 A constant subroutine assigned to a glob whose name contains a null will no
579 longer cause extra globs to pop into existence when the constant is
580 referenced under its new name.
584 C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when such
585 a sub was provided as the comparison routine. It used to croak on
590 Subroutines from the C<autouse> namespace are once more exempt from
591 redefinition warnings. This used to work in 5.005, but was broken in 5.6
592 for most subroutines. For subs created via XS that redefine subroutines
593 from the C<autouse> package, this stopped working in 5.10.
597 New XSUBs now produce redefinition warnings if they overwrite existing
598 subs, as they did in 5.8.x. (The C<autouse> logic was reversed in 5.10-14.
599 Only subroutines from the C<autouse> namespace would warn when clobbered.)
603 Redefinition warnings triggered by the creation of XSUBs now respect
604 Unicode glob names, instead of using the internal representation. This was
605 missed in 5.15.4, partly because this warning was so hard to trigger. (See
610 C<newCONSTSUB> used to use compile-time warning hints, instead of run-time
611 hints. The following code should never produce a redefinition warning, but
612 it used to, if C<newCONSTSUB> redefine and existing subroutine:
617 some_XS_function_that_calls_new_CONSTSUB();
622 Redefinition warnings for constant subroutines are on by default (what are
623 known as severe warnings in L<perldiag>). This was only the case when it
624 was a glob assignment or declaration of a Perl subroutine that caused the
625 warning. If the creation of XSUBs triggered the warning, it was not a
626 default warning. This has been corrected.
630 The internal check to see whether a redefinition warning should occur used
631 to emit "uninitialized" warnings in cases like this:
633 use warnings "uninitialized";
634 use constant {u=>undef,v=>undef};
635 sub foo(){u} sub foo(){v}
639 A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized"
640 warnings to report the wrong variable if the operator in question has
641 two operands and one is C<%{...}> or C<@{...}>. This has been fixed
646 C<< version->new("version") >> and C<printf "%vd", "version"> no longer
647 crash [perl #102586].
651 C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> now call FETCH just
652 once when $tied holds a reference.
656 Four-argument C<select> now always calls FETCH on tied arguments. It used
657 to skip the call if the tied argument happened to hold C<undef> or a
662 Four-argument C<select> no longer produces its "Non-string passed as
663 bitmask" warning on tied or tainted variables that are strings.
667 C<sysread> now always calls FETCH on the buffer passed to it if it is tied.
668 It used to skip the call if the tied variable happened to hold a typeglob.
672 C<< $tied .= <> >> now calls FETCH once on C<$tied>. It used to call it
673 multiple times if the last value assigned to or returned from the tied
674 variable was anything other than a string or typeglob.
678 The C<evalbytes> keyword added in 5.15.5 was respecting C<use utf8>
679 declarations from the outer scope, when it should have been ignoring them.
683 C<goto &func> no longers crashes, but produces an error message, when the
684 unwinding of the current subroutine's scope fires a destructor that
685 undefines the subroutine being "goneto" [perl #99850].
689 Arithmetic assignment (C<$left += $right>) involving overloaded objects that
690 rely on the 'nomethod' override no longer segfault when the left operand is not
695 Assigning C<__PACKAGE__> or any other shared hash key scalar to a stash
696 element no longer causes a double free. Regardless of this change, the
697 results of such assignments are still undefined.
701 Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and
702 C<%!> from working some of the time [perl #105024].
706 Assigning C<__PACKAGE__> or another shared hash key string to a variable no
707 longer stops that variable from being tied if it happens to be a PVMG or
712 =head1 Known Problems
714 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
715 tests that had to be C<TODO>ed for the release would be noted here, unless
716 they were specific to a particular platform (see below).
718 This is a list of some significant unfixed bugs, which are regressions
719 from either 5.XXX.XXX or 5.XXX.XXX.
721 [ List each fix as a =item entry ]
733 XXX If any significant core contributor has died, we've added a short obituary
736 =head1 Acknowledgements
738 XXX Generate this with:
740 perl Porting/acknowledgements.pl v5.15.5..HEAD
742 =head1 Reporting Bugs
744 If you find what you think is a bug, you might check the articles
745 recently posted to the comp.lang.perl.misc newsgroup and the perl
746 bug database at http://rt.perl.org/perlbug/ . There may also be
747 information at http://www.perl.org/ , the Perl Home Page.
749 If you believe you have an unreported bug, please run the L<perlbug>
750 program included with your release. Be sure to trim your bug down
751 to a tiny but sufficient test case. Your bug report, along with the
752 output of C<perl -V>, will be sent off to perlbug@perl.org to be
753 analysed by the Perl porting team.
755 If the bug you are reporting has security implications, which make it
756 inappropriate to send to a publicly archived mailing list, then please send
757 it to perl5-security-report@perl.org. This points to a closed subscription
758 unarchived mailing list, which includes
759 all the core committers, who will be able
760 to help assess the impact of issues, figure out a resolution, and help
761 co-ordinate the release of patches to mitigate or fix the problem across all
762 platforms on which Perl is supported. Please only use this address for
763 security issues in the Perl core, not for modules independently
768 The F<Changes> file for an explanation of how to view exhaustive details
771 The F<INSTALL> file for how to build Perl.
773 The F<README> file for general stuff.
775 The F<Artistic> and F<Copying> files for copyright information.