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
73 XXX Any security-related notices go here. In particular, any security
74 vulnerabilities closed should be noted here rather than in the
75 L</Selected Bug Fixes> section.
77 [ List each security issue as a =head2 entry ]
79 =head1 Incompatible Changes
81 =head2 Stringification of regexes has changed
83 Default regular expression modifiers are now notated by using
84 C<(?^...)>. Code relying on the old stringification will fail. The
85 purpose of this is so that when new modifiers are added, such code will
86 not have to change (after this one time), as the stringification will
87 automatically incorporate the new modifiers.
89 Code that needs to work properly with both old- and new-style regexes
90 can avoid the whole issue by using (for Perls since 5.9.5):
92 use re qw(regexp_pattern);
93 my ($pat, $mods) = regexp_pattern($re_ref);
95 where C<$re_ref> is a reference to a compiled regular expression. Upon
96 return, C<$mods> will be a string containing all the non-default
97 modifiers used when the regular expression was compiled, and C<$pattern>
100 If the actual stringification is important, or older Perls need to be
101 supported, you can use something like the following:
103 # Accept both old and new-style stringification
104 my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
106 And then use C<$modifiers> instead of C<-xism>.
108 =head2 Regular expressions retain their localeness when interpolated
110 Regular expressions compiled under C<"use locale"> now retain this when
111 interpolated into a new regular expression compiled outside a
112 C<"use locale">, and vice-versa.
114 Previously, a regular expression interpolated into another one inherited
115 the localeness of the surrounding one, losing whatever state it
116 originally had. This is considered a bug fix, but may trip up code that
117 has come to rely on the incorrect behavior.
119 [ List each incompatible change as a =head2 entry ]
121 =head2 Directory handles not copied to threads
123 On systems that do not have a C<fchdir> function, newly-created threads no
124 longer inherit directory handles from their parent threads. Such programs
125 would probably have crashed anyway
126 L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>.
130 XXX Any deprecated features, syntax, modules etc. should be listed here.
131 In particular, deprecated modules should be listed here even if they are
132 listed as an updated module in the L</Modules and Pragmata> section.
134 [ List each deprecation as a =head2 entry ]
136 =head1 Performance Enhancements
138 XXX Changes which enhance performance without changing behaviour go here. There
139 may well be none in a stable release.
141 [ List each enhancement as a =item entry ]
151 =head1 Modules and Pragmata
153 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
154 go here. If Module::CoreList is updated, generate an initial draft of the
155 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
156 entries to STDOUT. Results can be pasted in place of the '=head2' entries
157 below. A paragraph summary for important changes should then be added by hand.
158 In an ideal world, dual-life modules would have a F<Changes> file that could be
161 [ Within each section, list entries as a =item entry ]
163 =head2 New Modules and Pragmata
173 =head2 Updated Modules and Pragmata
179 C<Carp> has been upgraded from version 1.18 to 1.19.
181 It no longer autovivifies the C<*CORE::GLOBAL::caller> glob, something it
182 started doing in 1.18, which was released with perl 5.13.4
183 L<[perl #78082]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=78082>
187 C<Data::Dumper> has been upgraded from version 2.128 to 2.129.
189 C<Dumpxs> no longer crashes with globs returned by C<*$io_ref>
190 L<[perl #72332]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72332>.
194 C<Digest::MD5> has been upgraded from version 2.40 to 2.50.
196 It is now safe to use this module in combination with threads.
200 C<File::DosGlob> has been upgraded from version 1.02 to 1.03.
202 It allows patterns containing literal parentheses (they no longer need to
203 be escaped). On Windows, it no longer adds an extra F<./> to the file names
204 returned when the pattern is a relative glob with a drive specification,
206 L<[perl #71712]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71712>.
210 C<File::Find> has been upgraded from version 1.17 to 1.18.
212 It improves handling of backslashes on Windows, so that paths such as
213 F<c:\dir\/file> are no longer generated
214 L<[perl #71710]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71710>.
218 C<if> has been upgraded from version 0.05 to 0.06
222 C<IPC::Open3> has been upgraded from version 1.06 to 1.07.
224 The internal C<xclose> routine now knows how to handle file descriptors, as
225 documented, so duplicating STDIN in a child process using its file
227 L<[perl #76474]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71710>.
231 C<Locale::Maketext> has been upgraded from version 1.15 to 1.16.
233 It fixes an infinite loop in C<Locale::Maketext::Guts::_compile()> when
234 working with tainted values
235 (L<CPAN RT #40727|https://rt.cpan.org/Public/Bug/Display.html?id=40727>).
239 C<Math::BigInt> has been upgraded from version 1.95 to 1.96.
243 C<NEXT> has been upgraded from version 0.64 to 0.65.
247 C<PathTools> has been upgraded from version 3.31_01 to 3.33.
251 C<sigtrap> has been upgraded from version 1.04 to 1.05.
253 It no longer tries to modify read-only arguments when generating a
255 L<[perl #72340]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72340>.
259 C<threads> has been upgrade from version 1.77_03 to 1.81
263 C<Unicode::Collate> has been upgraded from version 0.59 to 0.60
267 C<Unicode::Normalize> has been upgraded from version 1.06 to 1.07
271 =head2 Removed Modules and Pragmata
283 XXX Changes to files in F<pod/> go here. Consider grouping entries by
284 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
286 =head2 New Documentation
288 XXX Changes which create B<new> files in F<pod/> go here.
292 XXX Description of the purpose of the new file here
294 =head2 Changes to Existing Documentation
296 XXX Changes which significantly change existing files in F<pod/> go here.
297 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
306 The documentation for the C<SvTRUE> macro was simply wrong in stating that
307 get-magic is not processed. It has been corrected.
313 The following additions or changes have been made to diagnostic output,
314 including warnings and fatal error messages. For the complete list of
315 diagnostic messages, see L<perldiag>.
317 XXX New or changed warnings emitted by the core's C<C> code go here. Also
318 include any changes in L<perldiag> that reconcile it to the C<C> code.
320 [ Within each section, list entries as a =item entry ]
322 =head2 New Diagnostics
324 XXX Newly added diagnostic messages go here
334 =head2 Changes to Existing Diagnostics
336 XXX Changes (i.e. rewording) of diagnostic messages go here
342 The 'Layer does not match this perl' error message has been replaced with
343 these more helpful messages:
349 PerlIO layer function table size (%d) does not match size expected by this
354 PerlIO layer instance size (%d) does not match size expected by this perl
359 L<[perl #73754]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73754>
363 =head1 Utility Changes
365 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
366 here. Most of these are built within the directories F<utils> and F<x2p>.
368 [ List utility changes as a =head3 entry for each utility and =item
369 entries for each change
370 Use L<XXX> with program names to get proper documentation linking. ]
382 =head1 Configuration and Compilation
384 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
385 go here. Any other changes to the Perl build process should be listed here.
386 However, any platform-specific changes should be listed in the
387 L</Platform Support> section, instead.
389 [ List changes as a =item entry ].
401 XXX Any significant changes to the testing of a freshly built perl should be
402 listed here. Changes which create B<new> files in F<t/> go here as do any
403 large changes to the testing harness (e.g. when parallel testing was added).
404 Changes to existing files in F<t/> aren't worth summarising, although the bugs
405 that they represent may be covered elsewhere.
407 [ List each test improvement as a =item entry ]
413 The script F<t/op/threads-dirh.t> has been added, which tests interaction
414 of threads and directory handles.
418 =head1 Platform Support
420 XXX Any changes to platform support should be listed in the sections below.
422 [ Within the sections, list each platform as a =item entry with specific
423 changes as paragraphs below it. ]
427 XXX List any platforms that this version of perl compiles on, that previous
428 versions did not. These will either be enabled by new files in the F<hints/>
429 directories, or new subdirectories and F<README> files at the top level of the
434 =item XXX-some-platform
440 =head2 Discontinued Platforms
442 XXX List any platforms that this version of perl no longer compiles on.
446 =item XXX-some-platform
452 =head2 Platform-Specific Notes
454 XXX List any changes for specific platforms. This could include configuration
455 and compilation changes or changes in portability/compatibility. However,
456 changes within modules for platforms should generally be listed in the
457 L</Modules and Pragmata> section.
463 Early versions of Mac OS X (Darwin) had buggy implementations of the
464 C<setregid>, C<setreuid>, C<setrgid> and C<setruid> functions, so perl
465 would pretend they did not exist.
467 These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and
468 higher, as they have been fixed
469 L<[perl #72990]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72990>.
473 C<$Config{gccversion}> is now set correctly when perl is built using the
474 mingw64 compiler from L<http://mingw64.org>
475 L<[perl #73754]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=73754>.
479 =head1 Internal Changes
481 XXX Changes which affect the interface available to C<XS> code go here.
482 Other significant internal changes for future core maintainers should
485 [ List each test improvement as a =item entry ]
491 See L</Regular expressions retain their localeness when interpolated>,
496 The C<sv_cmp_flags>, C<sv_cmp_locale_flags>, C<sv_eq_flags> and
497 C<sv_collxfrm_flags> functions have been added. These are like their
498 non-_flags counterparts, but allow one to specify whether get-magic is
501 The C<sv_cmp>, C<sv_cmp_locale>, C<sv_eq> and C<sv_collxfrm> functions have
502 been replaced with wrappers around the new functions.
506 A new C<sv_2bool_flags> function has been added.
508 This is like C<sv_2bool>, but it lets the calling code decide whether
509 get-magic is handled. C<sv_2bool> is now a macro that calls the new
514 A new macro, C<SvTRUE_nomg>, has been added.
516 This is like C<SvTRUE>, except that it does not process magic. It uses the
517 new C<sv_2bool_flags> function.
521 C<sv_catsv_flags> no longer calls C<mg_get> on its second argument (the
522 source string) if the flags passed to it do not include SV_GMAGIC. So it
523 now matches what the documentation says it does.
527 =head1 Selected Bug Fixes
529 XXX Important bug fixes in the core language are summarised here.
530 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
531 L</Modules and Pragmata>.
533 [ List each fix as a =item entry ]
539 A regular expression match in the right-hand side of a global substitution
540 (C<s///g>) that is in the same scope will no longer cause match variables
541 to have the wrong values on subsequent iterations. This can happen when an
542 array or hash subscript is interpolated in the right-hand side, as in
543 C<s|(.)|@a{ print($1), /./ }|g>
544 L<[perl #19078]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=19078>.
548 Constant-folding used to cause
550 $text =~ ( 1 ? /phoo/ : /bear/)
556 at compile time. Now it correctly matches against C<$_>
557 L<[perl #20444]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=20444>.
561 Parsing Perl code (either with string C<eval> or by loading modules) from
562 within a C<UNITCHECK> block no longer causes the interpreter to crash
563 L<[perl #70614]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=70614>.
567 When C<-d> is used on the shebang (C<#!>) line, the debugger now has access
568 to the lines of the main program. In the past, this sometimes worked and
569 sometimes did not, depending on what order things happened to be arranged
571 L<[perl #71806]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=71806>.
575 The C<y///> or C<tr///> operator now calls get-magic (e.g., the C<FETCH>
576 method of a tie) on its left-hand side just once, not twice
577 L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
581 String comparison (C<eq>, C<ne>, C<lt>, C<gt>, C<le>, C<ge> and
582 C<cmp>) and logical not (C<not> and C<!>) operators no longer call magic
583 (e.g., tie methods) twice on their operands
584 L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
586 This bug was introduced in an earlier 5.13 release, and does not affect
591 When a tied (or other magic) variable is used as, or in, a regular
592 expression, it no longer has its C<FETCH> method called twice
593 L<[perl #76814]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=76814>.
595 This bug was introduced in an earlier 5.13 release, and does not affect
600 The C<-C> command line option can now be followed by other options
601 L<[perl #72434]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=72434>.
605 Assigning a glob to a PVLV used to convert it to a plain string. Now it
606 works correctly, and a PVLV can hold a glob. This would happen when a
607 nonexistent hash or array element was passed to a subroutine:
609 sub { $_[0] = *foo }->($hash{key});
610 # $_[0] would have been the string "*main::foo"
612 It also happened when a glob was assigned to, or returned from, an element
613 of a tied array or hash
614 L<[perl #36051]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=36051>.
618 Creating a new thread when directory handles were open used to cause a
619 crash, because the handles were not cloned, but simply passed to the new
620 thread, resulting in a double free.
622 Now directory handles are properly, on systems that have a C<fchdir>
623 function. On other systems, new threads simply do not inherit directory
624 handles from their parent threads
625 L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>.
629 Assignment through a glob no longer triggers set-magic on the glob itself
630 L<[perl #77928]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77928>.
634 =head1 Known Problems
636 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
637 tests that had to be C<TODO>ed for the release would be noted here, unless
638 they were specific to a particular platform (see below).
640 This is a list of some significant unfixed bugs, which are regressions
641 from either 5.XXX.XXX or 5.XXX.XXX.
643 [ List each fix as a =item entry ]
655 XXX If any significant core contributor has died, we've added a short obituary
664 Fixed a typo in L<perl5135delta> regarding array slices and smart matching
668 =head1 Acknowledgements
670 XXX The list of people to thank goes here.
672 =head1 Reporting Bugs
674 If you find what you think is a bug, you might check the articles
675 recently posted to the comp.lang.perl.misc newsgroup and the perl
676 bug database at http://rt.perl.org/perlbug/ . There may also be
677 information at http://www.perl.org/ , the Perl Home Page.
679 If you believe you have an unreported bug, please run the B<perlbug>
680 program included with your release. Be sure to trim your bug down
681 to a tiny but sufficient test case. Your bug report, along with the
682 output of C<perl -V>, will be sent off to perlbug@perl.org to be
683 analysed by the Perl porting team.
685 If the bug you are reporting has security implications, which make it
686 inappropriate to send to a publicly archived mailing list, then please send
687 it to perl5-security-report@perl.org. This points to a closed subscription
688 unarchived mailing list, which includes all the core committers, who be able
689 to help assess the impact of issues, figure out a resolution, and help
690 co-ordinate the release of patches to mitigate or fix the problem across all
691 platforms on which Perl is supported. Please only use this address for
692 security issues in the Perl core, not for modules independently
697 The F<Changes> file for an explanation of how to view exhaustive details
700 The F<INSTALL> file for how to build Perl.
702 The F<README> file for general stuff.
704 The F<Artistic> and F<Copying> files for copyright information.