4 This has been completed up to 1881532246, except for
5 b0f2e9e nwclark Fix two bugs related to pod files outside of pod/ (important enough?)
6 4b476da craigb Skip Perl_my_symlink on old VMS systems
7 9b9f19d craigb Another vms bug
8 c29067d Carl Hayter Make sitecustomize relocatableinc aware
9 fc81b71 nwclark Avoid attacks on sitecustomize by using NUL delimiters
13 [ this is a template for a new perldelta file. Any text flagged as
14 XXX needs to be processed before release. ]
16 perldelta - what is new for perl v5.15.6
20 This document describes differences between the 5.15.5 release and
23 If you are upgrading from an earlier release such as 5.15.4, first read
24 L<perl5155delta>, which describes differences between 5.15.4 and
29 XXX Any important notices here
31 =head1 Core Enhancements
33 XXX New core language features go here. Summarise user-visible core language
34 enhancements. Particularly prominent performance optimisations could go
35 here, but most should go in the L</Performance Enhancements> section.
37 [ List each enhancement as a =head2 entry ]
41 The new C<__SUB__> token, available under the "current_sub" feature (see
42 L<feature>) or C<use v5.15>, returns a reference to the current subroutine,
43 making it easier to write recursive closures.
45 =head2 New option for the debugger's B<t> command
47 The B<t> command in the debugger, which toggles tracing mode, now accepts a
48 numerical argument that determines how many levels of subroutine calls to
51 =head2 Return value of C<tied>
53 The value returned by C<tied> on a tied variable is now the actual scalar
54 that holds the object to which the variable is tied. This allows ties to
55 be weakened with C<Scalar::Util::weaken(tied $tied_variable)>.
59 XXX Any security-related notices go here. In particular, any security
60 vulnerabilities closed should be noted here rather than in the
61 L</Selected Bug Fixes> section.
63 =head2 C<is_utf8_char()>
65 The XS-callable function C<is_utf8_char()> when presented with malformed
66 UTF-8 input can read up to 12 bytes beyond the end of the string. This
67 cannot be fixed without changing its API. It is not called from CPAN.
68 The documentation for it now describes how to use it safely.
70 =head2 Other C<is_utf8_foo()> functions, as well as C<utf8_to_foo()>, etc.
72 Most of the other XS-callable functions that take UTF-8 encoded input
73 implicitly assume that the UTF-8 is valid (not malformed) in regards to
74 buffer length. Do not do things such as change a character's case or
75 see if it is alphanumeric without first being sure that it is valid
76 UTF-8. This can be safely done for a whole string by using one of the
77 functions C<is_utf8_string()>, C<is_utf8_string_loc()>, and
78 C<is_utf8_string_loclen()>.
80 =head1 Incompatible Changes
82 XXX For a release on a stable branch, this section aspires to be:
84 There are no changes intentionally incompatible with 5.XXX.XXX
85 If any exist, they are bugs and reports are welcome.
87 [ List each incompatible change as a =head2 entry ]
89 =head2 C<substr> lvalue revamp
91 When C<substr> is called in lvalue or potential lvalue context with two or
92 three arguments, a special lvalue scalar is returned that modifies the
93 original string (the first argument) when assigned to.
95 Previously, the offsets (the second and third arguments) passed to
96 C<substr> would be converted immediately to match the string, negative
97 offsets being translated to positive and offsets beyond the end of the
98 string being truncated.
100 Now, the offsets are recorded without modification in the special lvalue
101 scalar that is returned, and the original string is not even looked at by
102 C<substr> itself, but only when the returned lvalue is read or modified.
104 These changes result in several incompatible changes and bug fixes:
110 If the original string changes length after the call to C<substr> but
111 before assignment to its return value, negative offsets will remember
112 their position from the end of the string, affecting code like this:
114 my $string = "string";
115 my $lvalue = \substr $string, -4, 2;
116 print $lvalue, "\n"; # prints "ri"
117 $string = "bailing twine";
118 print $lvalue, "\n"; # prints "wi"; used to print "il"
120 The same thing happens with an omitted third argument. The returned lvalue
121 will always extend to the end of the string, even if the string becomes
126 Tied (and otherwise magical) variables are no longer exempt from the
127 "Attempt ot use reference as lvalue in substr" warning.
131 That warning now occurs when the returned lvalue is assigned to, not when
132 C<substr> itself is called. This only makes a difference if the return
133 value of C<substr> is referenced and assigned to later.
137 The order in which "uninitialized" warnings occur for arguments to
138 C<substr> has changed.
142 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
143 when the value passed is assigned to.
145 The same thing happens with the "substr outside of string" error. If the
146 lvalue is only read, not written to, it is now just a warning, as with
151 C<substr> assignments no longer call FETCH twice if the first argument is a
152 tied variable, but just once.
156 It was impossible to fix all the bugs without an incompatible change, and
157 the behaviour of negative offsets was never specified, so the change was
160 =head2 Return value of C<eval>
162 C<eval> returns C<undef> in scalar context or an empty list in list context
163 when there is a run-time error. For syntax errors (when C<eval> is passed
164 a string), in list context it used to return a list containing a single
165 undefined element. Now it returns an empty list in list context for all
166 errors [perl #80630].
170 The C<newCONSTSUB_flags> C-level function, added in 5.15.4, now has a
175 XXX Any deprecated features, syntax, modules etc. should be listed here.
176 In particular, deprecated modules should be listed here even if they are
177 listed as an updated module in the L</Modules and Pragmata> section.
179 [ List each deprecation as a =head2 entry ]
181 =head1 Performance Enhancements
183 XXX Changes which enhance performance without changing behaviour go here. There
184 may well be none in a stable release.
186 [ List each enhancement as a =item entry ]
192 Perl 5.12.0 sped up the destruction of objects whose classes define empty
193 C<DESTROY> methods (to prevent autoloading), simply by not calling such
194 empty methods. This release takes this optimisation a step further, by not
195 calling any C<DESTROY> method that begins with an C<return> statement.
196 This can be useful for destructors that are only used for debugging:
198 use constant DEBUG => 1;
199 sub DESTROY { return unless DEBUG; ... }
201 Constant-folding will reduce the first statement to C<return;> if DEBUG is
202 set to 0, triggering this optimisation.
206 Assign to a variable that holds a typeglob or copy-on-write scalar is now
207 much faster. Previously the typeglob would be stringified or the
208 copy-on-write scalar would be copied before being clobbered.
212 Assignment to a substring in void context is now more than twice its
213 previous speed. Instead of creating and returning a special lvalue scalar
214 that is then assigned to, C<substr> modifies the original string itself.
218 =head1 Modules and Pragmata
220 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
221 go here. If Module::CoreList is updated, generate an initial draft of the
222 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
223 entries to STDOUT. Results can be pasted in place of the '=head2' entries
224 below. A paragraph summary for important changes should then be added by hand.
225 In an ideal world, dual-life modules would have a F<Changes> file that could be
228 [ Within each section, list entries as a =item entry ]
230 =head2 New Modules and Pragmata
240 =head2 Updated Modules and Pragmata
246 L<Archive::Tar> has been upgraded from version 1.80 to version 1.82.
248 Adjustments to handle files >8gb (>0777777777777 octal) and a feature to
249 return the MD5SUM of files in the archive.
253 L<AutoLoader> has been upgraded from version 5.71 to version 5.72.
257 L<B::Debug> has been upgraded from version 1.16 to version 1.17.
261 L<B::Deparse> has been upgraded from version 1.09 to 1.10.
263 C<sort(foo(bar))> is now deparsed correctly. (C<sort foo(bar)>, how it used
264 to deparse, makes foo the sort routine, rather than a regular function
269 L<Compress::Raw::Zlib> has been upgraded from version 2.042 to version 2.045.
273 L<Compress::Raw::Bzip2> has been upgraded from version 2.042 to version 2.045.
277 L<CPAN::Meta::YAML> has been upgraded from version 0.004 to version 0.005.
281 L<CPANPLUS> has been upgraded from version 0.9112 to version 0.9113.
285 L<Data::Dumper> has been upgraded from version 2.134 to 2.135.
287 The XS implementation has been updated to account for the Unicode symbol
288 changes in Perl 5.15.4. It also knows how to output typeglobs with nulls
293 L<ExtUtils::ParseXS> has been upgraded from version 3.05 to version 3.07.
297 L<IO::Compress::Base> has been upgraded from version 2.042 to version 2.045.
299 Added zipdetails utility.
303 L<Locale::Codes> has been upgraded from version 3.18 to version 3.20.
305 The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now support retired codes.
306 All codesets may be specified by a constant or by their name now. Previously,
307 they were specified only by a constant.
308 The alias_code function exists for backward compatibility. It has been replaced by rename_country_code.
309 The alias_code function will be removed sometime after September, 2013.
310 All work is now done in the central module (Locale::Codes). Previously, some was still done in the
311 wrapper modules (Locale::Codes::*) but that is gone now.
312 Added Language Family codes (langfam) as defined in ISO 639-5.
316 L<Module::Loaded> has been uprgaded from version 0.06 to version 0.08.
320 L<Pod::LaTeX> has been upgraded from version 0.59 to version 0.60.
322 Added another LaTeX escape: --- => -{}-{}-
324 Pod::LaTeX doesn't handle -- in PODs specially, passing it directly to
325 LaTeX, which then proceeds to replace it with a single -. This patch
326 replaces ----- with -{}-{}-{}-{}-
330 L<POSIX> has been upgraded from version 1.26 to 1.27.
332 It no longer produces a "Constant subroutine TCSANOW redefined" warning on
335 XXX When did it start producing that warning? Was it post-5.15.5? Even if
336 it was not, adding a note will help whoever compiles perl5160delta.
340 L<Socket> has been upgraded from version 1.94_02 to version 1.96.
344 L<Unicode::Collate> has been upgraded from version 0.85 to version 0.87.
346 Tailored compatibility ideographs as well as unified ideographs for
347 the locales: ja, ko, zh__big5han, zh__gb2312han, zh__pinyin, zh__stroke.
349 Now Locale/*.pl files are searched in @INC.
353 L<UNIVERSAL> has been upgraded from version 1.10 to 1.11.
355 Documentation change clarifies return values from UNIVERSAL::VERSION.
359 =head2 Removed Modules and Pragmata
371 XXX Changes to files in F<pod/> go here. Consider grouping entries by
372 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
374 =head2 New Documentation
376 XXX Changes which create B<new> files in F<pod/> go here.
380 XXX Description of the purpose of the new file here
382 =head2 Changes to Existing Documentation
384 XXX Changes which significantly change existing files in F<pod/> go here.
385 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
394 XXX Description of the change here
400 The following additions or changes have been made to diagnostic output,
401 including warnings and fatal error messages. For the complete list of
402 diagnostic messages, see L<perldiag>.
404 XXX New or changed warnings emitted by the core's C<C> code go here. Also
405 include any changes in L<perldiag> that reconcile it to the C<C> code.
407 [ Within each section, list entries as a =item entry that links to perldiag,
412 L<Invalid version object|perldiag/"Invalid version object">
415 =head2 New Diagnostics
417 XXX Newly added diagnostic messages go here
425 XXX L<message|perldiag/"message">
435 XXX L<message|perldiag/"message">
439 =head2 Changes to Existing Diagnostics
441 XXX Changes (i.e. rewording) of diagnostic messages go here
447 Redefinition warnings for constant subroutines used to be mandatory, even
448 occurring under C<no warnings>. Now they respect the L<warnings> pragma.
452 The "Attempt to free non-existent shared string" has had the spelling of
453 "non-existent" corrected to "nonexistent". It was already listed with the
454 correct spelling in L<perldiag>.
458 The 'Use of "foo" without parentheses is ambiguous' warning has been
459 extended to apply also to user-defined subroutines with a (;$) prototype,
460 and not just to built-in functions.
464 =head1 Utility Changes
466 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
467 here. Most of these are built within the directories F<utils> and F<x2p>.
469 [ List utility changes as a =head3 entry for each utility and =item
470 entries for each change
471 Use L<XXX> with program names to get proper documentation linking. ]
479 L<zipdetails> displays information about the internal record structure of the zip file.
480 It is not concerned with displaying any details of the compressed data stored in the zip file.
484 =head1 Configuration and Compilation
486 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
487 go here. Any other changes to the Perl build process should be listed here.
488 However, any platform-specific changes should be listed in the
489 L</Platform Support> section, instead.
491 [ List changes as a =item entry ].
497 F<pod/roffitall> is now build by F<pod/buildtoc>, instead of being shipped
498 with the distribution. Its list of manpages is now generated (and therefore
499 current). See also RT #103202 for an unresolved related issue.
503 Perl 5.15.5 had a bug in its installation script, which did not install
504 F<unicore/Name.pm>. This has been corrected [perl #104226].
506 XXX Is that Perl version correct? Is the file path correct?
512 XXX Any significant changes to the testing of a freshly built perl should be
513 listed here. Changes which create B<new> files in F<t/> go here as do any
514 large changes to the testing harness (e.g. when parallel testing was added).
515 Changes to existing files in F<t/> aren't worth summarising, although the bugs
516 that they represent may be covered elsewhere.
518 [ List each test improvement as a =item entry ]
524 The F<substr.t> and F<substr_thr.t> scripts for testing C<substr> have been
525 moved under F<t/op/>, where they were originally. They had been moved
526 under F<t/re/> along with the substitution tests when that directory was
531 =head1 Platform Support
533 XXX Any changes to platform support should be listed in the sections below.
535 [ Within the sections, list each platform as a =item entry with specific
536 changes as paragraphs below it. ]
540 XXX List any platforms that this version of perl compiles on, that previous
541 versions did not. These will either be enabled by new files in the F<hints/>
542 directories, or new subdirectories and F<README> files at the top level of the
547 =item XXX-some-platform
553 =head2 Discontinued Platforms
555 XXX List any platforms that this version of perl no longer compiles on.
559 =item XXX-some-platform
565 =head2 Platform-Specific Notes
567 XXX List any changes for specific platforms. This could include configuration
568 and compilation changes or changes in portability/compatibility. However,
569 changes within modules for platforms should generally be listed in the
570 L</Modules and Pragmata> section.
574 =item XXX-some-platform
580 =head1 Internal Changes
582 XXX Changes which affect the interface available to C<XS> code go here.
583 Other significant internal changes for future core maintainers should
586 [ List each change as a =item entry ]
596 =head1 Selected Bug Fixes
598 XXX Important bug fixes in the core language are summarised here.
599 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
600 L</Modules and Pragmata>.
602 [ List each fix as a =item entry ]
608 RT #78266: The regex engine has been leaking memory when accessing
609 named captures that weren't matched as part of a regex ever since 5.10
610 when they were introduced, e.g. this would consume over a hundred MB
613 for (1..10_000_000) {
614 if ("foo" =~ /(foo|(?<capture>bar))?/) {
615 my $capture = $+{capture}
618 system "ps -o rss $$"'
622 A constant subroutine assigned to a glob whose name contains a null will no
623 longer cause extra globs to pop into existence when the constant is
624 referenced under its new name.
628 C<sort> was not treating C<sub {}> and C<sub {()}> as equivalent when such
629 a sub was provided as the comparison routine. It used to croak on
634 Subroutines from the C<autouse> namespace are once more exempt from
635 redefinition warnings. This used to work in 5.005, but was broken in 5.6
636 for most subroutines. For subs created via XS that redefine subroutines
637 from the C<autouse> package, this stopped working in 5.10.
641 New XSUBs now produce redefinition warnings if they overwrite existing
642 subs, as they did in 5.8.x. (The C<autouse> logic was reversed in 5.10-14.
643 Only subroutines from the C<autouse> namespace would warn when clobbered.)
647 Redefinition warnings triggered by the creation of XSUBs now respect
648 Unicode glob names, instead of using the internal representation. This was
649 missed in 5.15.4, partly because this warning was so hard to trigger. (See
654 C<newCONSTSUB> used to use compile-time warning hints, instead of run-time
655 hints. The following code should never produce a redefinition warning, but
656 it used to, if C<newCONSTSUB> redefine and existing subroutine:
661 some_XS_function_that_calls_new_CONSTSUB();
666 Redefinition warnings for constant subroutines are on by default (what are
667 known as severe warnings in L<perldiag>). This was only the case when it
668 was a glob assignment or declaration of a Perl subroutine that caused the
669 warning. If the creation of XSUBs triggered the warning, it was not a
670 default warning. This has been corrected.
674 The internal check to see whether a redefinition warning should occur used
675 to emit "uninitialized" warnings in cases like this:
677 use warnings "uninitialized";
678 use constant {u=>undef,v=>undef};
679 sub foo(){u} sub foo(){v}
683 A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized"
684 warnings to report the wrong variable if the operator in question has
685 two operands and one is C<%{...}> or C<@{...}>. This has been fixed
690 C<< version->new("version") >> and C<printf "%vd", "version"> no longer
691 crash [perl #102586].
695 C<$tied =~ y/a/b/>, C<chop $tied> and C<chomp $tied> now call FETCH just
696 once when $tied holds a reference.
700 Four-argument C<select> now always calls FETCH on tied arguments. It used
701 to skip the call if the tied argument happened to hold C<undef> or a
706 Four-argument C<select> no longer produces its "Non-string passed as
707 bitmask" warning on tied or tainted variables that are strings.
711 C<sysread> now always calls FETCH on the buffer passed to it if it is tied.
712 It used to skip the call if the tied variable happened to hold a typeglob.
716 C<< $tied .= <> >> now calls FETCH once on C<$tied>. It used to call it
717 multiple times if the last value assigned to or returned from the tied
718 variable was anything other than a string or typeglob.
722 The C<evalbytes> keyword added in 5.15.5 was respecting C<use utf8>
723 declarations from the outer scope, when it should have been ignoring them.
727 C<goto &func> no longers crashes, but produces an error message, when the
728 unwinding of the current subroutine's scope fires a destructor that
729 undefines the subroutine being "goneto" [perl #99850].
733 Arithmetic assignment (C<$left += $right>) involving overloaded objects that
734 rely on the 'nomethod' override no longer segfault when the left operand is not
739 Assigning C<__PACKAGE__> or any other shared hash key scalar to a stash
740 element no longer causes a double free. Regardless of this change, the
741 results of such assignments are still undefined.
745 Creating a C<UNIVERSAL::AUTOLOAD> sub no longer stops C<%+>, C<%-> and
746 C<%!> from working some of the time [perl #105024].
750 Assigning C<__PACKAGE__> or another shared hash key string to a variable no
751 longer stops that variable from being tied if it happens to be a PVMG or
756 When presented with malformed UTF-8 input, the XS-callable functions
757 C<is_utf8_string()>, C<is_utf8_string_loc()>, and
758 C<is_utf8_string_loclen()> could read beyond the end of the input
759 string by up to 12 bytes. This no longer happens. [perl #32080].
760 However, currently, C<is_utf8_char()> still has this defect,
761 see L</is_utf8_char()> above.
765 Doing a substitution on a tied variable returning a copy-on-write scalar
766 used to cause an assertion failure or an "Attempt to free nonexistent
767 shared string" warning.
771 A change in perl 5.15.4 caused C<caller()> to produce malloc errors and a
772 crash with Perl's own malloc, and possibly with other malloc
773 implementations, too [perl #104034].
777 A bug fix in 5.15.5 could sometimes result in assertion failures under
778 debugging builds of perl for certain syntax errors in C<eval>, such as
779 C<eval(q|""!=!~//|);>
783 =head1 Known Problems
785 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
786 tests that had to be C<TODO>ed for the release would be noted here, unless
787 they were specific to a particular platform (see below).
789 This is a list of some significant unfixed bugs, which are regressions
790 from either 5.XXX.XXX or 5.XXX.XXX.
792 [ List each fix as a =item entry ]
804 XXX If any significant core contributor has died, we've added a short obituary
807 =head1 Acknowledgements
809 XXX Generate this with:
811 perl Porting/acknowledgements.pl v5.15.5..HEAD
813 =head1 Reporting Bugs
815 If you find what you think is a bug, you might check the articles
816 recently posted to the comp.lang.perl.misc newsgroup and the perl
817 bug database at http://rt.perl.org/perlbug/ . There may also be
818 information at http://www.perl.org/ , the Perl Home Page.
820 If you believe you have an unreported bug, please run the L<perlbug>
821 program included with your release. Be sure to trim your bug down
822 to a tiny but sufficient test case. Your bug report, along with the
823 output of C<perl -V>, will be sent off to perlbug@perl.org to be
824 analysed by the Perl porting team.
826 If the bug you are reporting has security implications, which make it
827 inappropriate to send to a publicly archived mailing list, then please send
828 it to perl5-security-report@perl.org. This points to a closed subscription
829 unarchived mailing list, which includes
830 all the core committers, who will be able
831 to help assess the impact of issues, figure out a resolution, and help
832 co-ordinate the release of patches to mitigate or fix the problem across all
833 platforms on which Perl is supported. Please only use this address for
834 security issues in the Perl core, not for modules independently
839 The F<Changes> file for an explanation of how to view exhaustive details
842 The F<INSTALL> file for how to build Perl.
844 The F<README> file for general stuff.
846 The F<Artistic> and F<Copying> files for copyright information.