5 [ this is a template for a new perldelta file. Any text flagged as
6 XXX needs to be processed before release. ]
8 perldelta - what is new for perl v5.13.6
12 This document describes differences between the 5.13.5 release and
15 If you are upgrading from an earlier release such as 5.13.4, first read
16 L<perl5135delta>, which describes differences between 5.13.4 and
21 XXX Any important notices here
23 =head1 Core Enhancements
25 XXX New core language features go here. Summarise user-visible core language
26 enhancements. Particularly prominent performance optimisations could go
27 here, but most should go in the L</Performance Enhancements> section.
29 [ List each enhancement as a =head2 entry ]
31 =head2 C<(?^...)> regex construct added to signify default modifiers
33 A caret (also called a "cirumflex accent") C<"^"> immediately following
34 a C<"(?"> in a regular expression now means that the subexpression is to
35 not inherit the surrounding modifiers such as C</i>, but to revert to the
36 Perl defaults. Any modifiers following the caret override the defaults.
38 The stringification of regular expressions now uses this notation. The
39 main purpose of this is to allow tests that rely on the stringification
40 to not have to change when new modifiers are added. See
41 L<perlre/Extended Patterns>.
43 =head2 C<"d">, C<"l">, and C<"u"> regex modifiers added
45 These modifiers are currently only available within a C<(?...)> construct.
47 The C<"l"> modifier says to compile the regular expression as if it were
48 in the scope of C<use locale>, even if it is not.
50 The C<"u"> modifier currently does nothing.
52 The C<"d"> modifier is used in the scope of C<use locale> to compile the
53 regular expression as if it were not in that scope.
54 See L<perlre/(?dlupimsx-imsx)>.
56 =head2 C<\N{...}> now handles Unicode named character sequences
58 Unicode has a number of named character sequences, in which particular sequences
59 of code points are given names. C<\N{...}> now recognizes these.
62 =head2 New function C<charnames::string_vianame()>
64 This function is a run-time version of C<\N{...}>, returning the string
65 of characters whose Unicode name is its parameter. It can handle
66 Unicode named character sequences, whereas the pre-existing
67 C<charnames::vianame()> cannot, as the latter returns a single code
71 =head2 Custom per-subroutine check hooks
73 XS code in an extension module can now annotate a subroutine (whether
74 implemented in XS or in Perl) so that nominated XS code will be called
75 at compile time (specifically as part of op checking) to change the op
76 tree of that subroutine. The compile-time check function (supplied by
77 the extension module) can implement argument processing that can't be
78 expressed as a prototype, generate customised compile-time warnings,
79 perform constant folding for a pure function, inline a subroutine
80 consisting of sufficiently simple ops, replace the whole call with a
81 custom op, and so on. This was previously all possible by hooking the
82 C<entersub> op checker, but the new mechanism makes it easy to tie the
83 hook to a specific subroutine. See L<perlapi/cv_set_call_checker>.
85 To help in writing custom check hooks, several subtasks within standard
86 C<entersub> op checking have been separated out and exposed in the API.
90 XXX Any security-related notices go here. In particular, any security
91 vulnerabilities closed should be noted here rather than in the
92 L</Selected Bug Fixes> section.
94 [ List each security issue as a =head2 entry ]
96 =head1 Incompatible Changes
98 =head2 Stringification of regexes has changed
100 Default regular expression modifiers are now notated by using
101 C<(?^...)>. Code relying on the old stringification will fail. The
102 purpose of this is so that when new modifiers are added, such code will
103 not have to change (after this one time), as the stringification will
104 automatically incorporate the new modifiers.
106 Code that needs to work properly with both old- and new-style regexes
107 can avoid the whole issue by using (for Perls since 5.9.5):
109 use re qw(regexp_pattern);
110 my ($pat, $mods) = regexp_pattern($re_ref);
112 where C<$re_ref> is a reference to a compiled regular expression. Upon
113 return, C<$mods> will be a string containing all the non-default
114 modifiers used when the regular expression was compiled, and C<$pattern>
117 If the actual stringification is important, or older Perls need to be
118 supported, you can use something like the following:
120 # Accept both old and new-style stringification
121 my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
123 And then use C<$modifiers> instead of C<-xism>.
125 =head2 Regular expressions retain their localeness when interpolated
127 Regular expressions compiled under C<"use locale"> now retain this when
128 interpolated into a new regular expression compiled outside a
129 C<"use locale">, and vice-versa.
131 Previously, a regular expression interpolated into another one inherited
132 the localeness of the surrounding one, losing whatever state it
133 originally had. This is considered a bug fix, but may trip up code that
134 has come to rely on the incorrect behavior.
136 =head2 Directory handles not copied to threads
138 On systems that do not have a C<fchdir> function, newly-created threads no
139 longer inherit directory handles from their parent threads. Such programs
140 would probably have crashed anyway
141 L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>.
143 =head2 Negation treats strings differently from before
145 The unary negation operator C<-> now treats strings that look like numbers
147 L<[perl #57706]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=57706>.
151 Negative zero (-0.0), when converted to a string, now becomes "0" on all
152 platforms. It used to become "-0" on some, but "0" on others.
154 If you still need to determine whether a zero is negative, use
155 C<sprintf("%g", $zero) =~ /^-/> or the L<Data::Float> module on CPAN.
159 XXX Any deprecated features, syntax, modules etc. should be listed here.
160 In particular, deprecated modules should be listed here even if they are
161 listed as an updated module in the L</Modules and Pragmata> section.
163 [ List each deprecation as a =head2 entry ]
165 =head1 Performance Enhancements
167 XXX Changes which enhance performance without changing behaviour go here. There
168 may well be none in a stable release.
170 [ List each enhancement as a =item entry ]
180 =head1 Modules and Pragmata
182 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
183 go here. If Module::CoreList is updated, generate an initial draft of the
184 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
185 entries to STDOUT. Results can be pasted in place of the '=head2' entries
186 below. A paragraph summary for important changes should then be added by hand.
187 In an ideal world, dual-life modules would have a F<Changes> file that could be
190 [ Within each section, list entries as a =item entry ]
192 =head2 New Modules and Pragmata
202 =head2 Updated Modules and Pragmata
208 C<Archive::Extract> has been upgraded from version 0.42 to 0.44
212 C<Carp> has been upgraded from version 1.18 to 1.19.
214 It no longer autovivifies the C<*CORE::GLOBAL::caller> glob, something it
215 started doing in 1.18, which was released with perl 5.13.4
216 L<[perl #78082]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=78082>
220 C<Data::Dumper> has been upgraded from version 2.128 to 2.129.
222 C<Dumpxs> no longer crashes with globs returned by C<*$io_ref>
223 L<[perl #72332]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72332>.
227 C<Digest::MD5> has been upgraded from version 2.40 to 2.51.
229 It is now safe to use this module in combination with threads.
233 C<File::DosGlob> has been upgraded from version 1.02 to 1.03.
235 It allows patterns containing literal parentheses (they no longer need to
236 be escaped). On Windows, it no longer adds an extra F<./> to the file names
237 returned when the pattern is a relative glob with a drive specification,
239 L<[perl #71712]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71712>.
243 C<File::Find> has been upgraded from version 1.17 to 1.18.
245 It improves handling of backslashes on Windows, so that paths such as
246 F<c:\dir\/file> are no longer generated
247 L<[perl #71710]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71710>.
251 C<if> has been upgraded from version 0.05 to 0.06
255 C<IPC::Open3> has been upgraded from version 1.06 to 1.07.
257 The internal C<xclose> routine now knows how to handle file descriptors, as
258 documented, so duplicating STDIN in a child process using its file
260 L<[perl #76474]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71710>.
264 C<Locale::Maketext> has been upgraded from version 1.15 to 1.16.
266 It fixes an infinite loop in C<Locale::Maketext::Guts::_compile()> when
267 working with tainted values
268 (L<CPAN RT #40727|https://rt.cpan.org/Public/Bug/Display.html?id=40727>).
270 C<< ->maketext >> calls will now backup and restore C<$@> so that error
271 messages are not supressed
272 (L<CPAN RT #34182|https://rt.cpan.org/Public/Bug/Display.html?id=34182>).
276 C<Math::BigInt> has been upgraded from version 1.95 to 1.97.
278 This prevents C<sqrt($int)> from crashing under C<use bigrat;>
279 L<[perl #73534]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73534>.
283 C<NEXT> has been upgraded from version 0.64 to 0.65.
287 C<overload> has been upgraded from version 1.10 to 1.11.
289 C<overload::Method> can now handle subroutines that are themselves blessed
290 into overloaded classes
291 L<[perl #71998]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71998>.
295 C<PathTools> has been upgraded from version 3.31_01 to 3.34.
299 C<sigtrap> has been upgraded from version 1.04 to 1.05.
301 It no longer tries to modify read-only arguments when generating a
303 L<[perl #72340]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72340>.
307 C<threads> has been upgraded from version 1.77_03 to 1.81
311 C<threads::shared> has been upgrade from version 1.33_03 to 1.34
315 C<Unicode::Collate> has been upgraded from version 0.59 to 0.62
317 U::C::Locale newly supports locales: ar, de__phonebook, hu, hy, nso, om,
318 tn, vi, hr, ig, sq, se to and uk
322 C<Unicode::Normalize> has been upgraded from version 1.06 to 1.07
326 =head2 Removed Modules and Pragmata
338 XXX Changes to files in F<pod/> go here. Consider grouping entries by
339 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
341 =head2 New Documentation
343 XXX Changes which create B<new> files in F<pod/> go here.
347 XXX Description of the purpose of the new file here
349 =head2 Changes to Existing Documentation
351 XXX Changes which significantly change existing files in F<pod/> go here.
352 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
361 The documentation for the C<SvTRUE> macro was simply wrong in stating that
362 get-magic is not processed. It has been corrected.
368 The following additions or changes have been made to diagnostic output,
369 including warnings and fatal error messages. For the complete list of
370 diagnostic messages, see L<perldiag>.
372 XXX New or changed warnings emitted by the core's C<C> code go here. Also
373 include any changes in L<perldiag> that reconcile it to the C<C> code.
375 [ Within each section, list entries as a =item entry ]
377 =head2 New Diagnostics
379 XXX Newly added diagnostic messages go here
389 =head2 Changes to Existing Diagnostics
391 XXX Changes (i.e. rewording) of diagnostic messages go here
397 The 'Layer does not match this perl' error message has been replaced with
398 these more helpful messages:
404 PerlIO layer function table size (%d) does not match size expected by this
409 PerlIO layer instance size (%d) does not match size expected by this perl
414 L<[perl #73754]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73754>
418 =head1 Utility Changes
420 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
421 here. Most of these are built within the directories F<utils> and F<x2p>.
423 [ List utility changes as a =head3 entry for each utility and =item
424 entries for each change
425 Use L<XXX> with program names to get proper documentation linking. ]
437 =head1 Configuration and Compilation
439 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
440 go here. Any other changes to the Perl build process should be listed here.
441 However, any platform-specific changes should be listed in the
442 L</Platform Support> section, instead.
444 [ List changes as a =item entry ].
456 XXX Any significant changes to the testing of a freshly built perl should be
457 listed here. Changes which create B<new> files in F<t/> go here as do any
458 large changes to the testing harness (e.g. when parallel testing was added).
459 Changes to existing files in F<t/> aren't worth summarising, although the bugs
460 that they represent may be covered elsewhere.
462 [ List each test improvement as a =item entry ]
468 The script F<t/op/threads-dirh.t> has been added, which tests interaction
469 of threads and directory handles.
473 =head1 Platform Support
475 XXX Any changes to platform support should be listed in the sections below.
477 [ Within the sections, list each platform as a =item entry with specific
478 changes as paragraphs below it. ]
482 XXX List any platforms that this version of perl compiles on, that previous
483 versions did not. These will either be enabled by new files in the F<hints/>
484 directories, or new subdirectories and F<README> files at the top level of the
489 =item XXX-some-platform
495 =head2 Discontinued Platforms
497 XXX List any platforms that this version of perl no longer compiles on.
501 =item XXX-some-platform
507 =head2 Platform-Specific Notes
509 XXX List any changes for specific platforms. This could include configuration
510 and compilation changes or changes in portability/compatibility. However,
511 changes within modules for platforms should generally be listed in the
512 L</Modules and Pragmata> section.
518 Conversion of strings to floating-point numbers is now more accurate on
520 L<[perl #32380]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=32380>.
524 Early versions of Mac OS X (Darwin) had buggy implementations of the
525 C<setregid>, C<setreuid>, C<setrgid> and C<setruid> functions, so perl
526 would pretend they did not exist.
528 These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and
529 higher, as they have been fixed
530 L<[perl #72990]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72990>.
534 perl now builds again with OpenVOS (formerly known as Stratus VOS)
535 L<[perl #78132]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=78132>.
539 C<$Config{gccversion}> is now set correctly when perl is built using the
540 mingw64 compiler from L<http://mingw64.org>
541 L<[perl #73754]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73754>.
543 The build process proceeds more smoothly with mingw and dmake when
544 F<C:\MSYS\bin> is in the PATH, due to a C<Cwd> fix.
548 =head1 Internal Changes
550 XXX Changes which affect the interface available to C<XS> code go here.
551 Other significant internal changes for future core maintainers should
554 [ List each test improvement as a =item entry ]
560 See L</Regular expressions retain their localeness when interpolated>,
565 The C<sv_cmp_flags>, C<sv_cmp_locale_flags>, C<sv_eq_flags> and
566 C<sv_collxfrm_flags> functions have been added. These are like their
567 non-_flags counterparts, but allow one to specify whether get-magic is
570 The C<sv_cmp>, C<sv_cmp_locale>, C<sv_eq> and C<sv_collxfrm> functions have
571 been replaced with wrappers around the new functions.
575 A new C<sv_2bool_flags> function has been added.
577 This is like C<sv_2bool>, but it lets the calling code decide whether
578 get-magic is handled. C<sv_2bool> is now a macro that calls the new
583 A new macro, C<SvTRUE_nomg>, has been added.
585 This is like C<SvTRUE>, except that it does not process magic. It uses the
586 new C<sv_2bool_flags> function.
590 C<sv_catsv_flags> no longer calls C<mg_get> on its second argument (the
591 source string) if the flags passed to it do not include SV_GMAGIC. So it
592 now matches what the documentation says it does.
596 A new interface has been added for custom check hooks on subroutines. See
597 L/Custom per-subroutine check hooks>, above.
601 List op building functions have been added to the
602 API. See L<op_append_elem|perlapi/op_append_elem>,
603 L<op_append_list|perlapi/op_append_list>, and
604 L<op_prepend_elem|perlapi/op_prepend_elem>.
608 The L<LINKLIST|perlapi/LINKLIST> macro, part of op building that
609 constructs the execution-order op chain, has been added to the API.
613 =head1 Selected Bug Fixes
615 XXX Important bug fixes in the core language are summarised here.
616 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
617 L</Modules and Pragmata>.
619 [ List each fix as a =item entry ]
625 A regular expression match in the right-hand side of a global substitution
626 (C<s///g>) that is in the same scope will no longer cause match variables
627 to have the wrong values on subsequent iterations. This can happen when an
628 array or hash subscript is interpolated in the right-hand side, as in
629 C<s|(.)|@a{ print($1), /./ }|g>
630 L<[perl #19078]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=19078>.
634 Constant-folding used to cause
636 $text =~ ( 1 ? /phoo/ : /bear/)
642 at compile time. Now it correctly matches against C<$_>
643 L<[perl #20444]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=20444>.
647 Parsing Perl code (either with string C<eval> or by loading modules) from
648 within a C<UNITCHECK> block no longer causes the interpreter to crash
649 L<[perl #70614]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=70614>.
653 When C<-d> is used on the shebang (C<#!>) line, the debugger now has access
654 to the lines of the main program. In the past, this sometimes worked and
655 sometimes did not, depending on what order things happened to be arranged
657 L<[perl #71806]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71806>.
661 The C<y///> or C<tr///> operator now calls get-magic (e.g., the C<FETCH>
662 method of a tie) on its left-hand side just once, not twice
663 L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
667 String comparison (C<eq>, C<ne>, C<lt>, C<gt>, C<le>, C<ge> and
668 C<cmp>) and logical not (C<not> and C<!>) operators no longer call magic
669 (e.g., tie methods) twice on their operands
670 L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
672 This bug was introduced in an earlier 5.13 release, and does not affect
677 When a tied (or other magic) variable is used as, or in, a regular
678 expression, it no longer has its C<FETCH> method called twice
679 L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
681 This bug was introduced in an earlier 5.13 release, and does not affect
686 The C<-C> command line option can now be followed by other options
687 L<[perl #72434]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72434>.
691 Assigning a glob to a PVLV used to convert it to a plain string. Now it
692 works correctly, and a PVLV can hold a glob. This would happen when a
693 nonexistent hash or array element was passed to a subroutine:
695 sub { $_[0] = *foo }->($hash{key});
696 # $_[0] would have been the string "*main::foo"
698 It also happened when a glob was assigned to, or returned from, an element
699 of a tied array or hash
700 L<[perl #36051]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=36051>.
704 Creating a new thread when directory handles were open used to cause a
705 crash, because the handles were not cloned, but simply passed to the new
706 thread, resulting in a double free.
708 Now directory handles are properly, on systems that have a C<fchdir>
709 function. On other systems, new threads simply do not inherit directory
710 handles from their parent threads
711 L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>.
715 The regular expression parser no longer hangs when parsing C<\18> and
718 This bug was introduced in version 5.13.5 and did not affect earlier
720 L<[perl #78058]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78058>.
724 Subroutine redefinition works once more in the debugger
725 L<[perl #48332]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=48332>.
729 The C<&> C<|> C<^> bitwise operators no longer coerce read-only arguments
730 L<[perl #20661]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=20661>.
734 Stringifying a scalar containing -0.0 no longer has the affect of turning
736 L<[perl #45133]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=45133>.
740 Aliasing packages by assigning to globs or deleting packages by deleting
741 their containing stash elements used to have erratic effects on method
742 resolution, because the internal 'isa' caches were not reset. This has been
747 =head1 Known Problems
749 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
750 tests that had to be C<TODO>ed for the release would be noted here, unless
751 they were specific to a particular platform (see below).
753 This is a list of some significant unfixed bugs, which are regressions
754 from either 5.XXX.XXX or 5.XXX.XXX.
756 [ List each fix as a =item entry ]
768 XXX If any significant core contributor has died, we've added a short obituary
777 Fixed a typo in L<perl5135delta> regarding array slices and smart matching
781 =head1 Acknowledgements
783 XXX The list of people to thank goes here.
785 =head1 Reporting Bugs
787 If you find what you think is a bug, you might check the articles
788 recently posted to the comp.lang.perl.misc newsgroup and the perl
789 bug database at http://rt.perl.org/perlbug/ . There may also be
790 information at http://www.perl.org/ , the Perl Home Page.
792 If you believe you have an unreported bug, please run the B<perlbug>
793 program included with your release. Be sure to trim your bug down
794 to a tiny but sufficient test case. Your bug report, along with the
795 output of C<perl -V>, will be sent off to perlbug@perl.org to be
796 analysed by the Perl porting team.
798 If the bug you are reporting has security implications, which make it
799 inappropriate to send to a publicly archived mailing list, then please send
800 it to perl5-security-report@perl.org. This points to a closed subscription
801 unarchived mailing list, which includes all the core committers, who be able
802 to help assess the impact of issues, figure out a resolution, and help
803 co-ordinate the release of patches to mitigate or fix the problem across all
804 platforms on which Perl is supported. Please only use this address for
805 security issues in the Perl core, not for modules independently
810 The F<Changes> file for an explanation of how to view exhaustive details
813 The F<INSTALL> file for how to build Perl.
815 The F<README> file for general stuff.
817 The F<Artistic> and F<Copying> files for copyright information.