5 perl51310delta - what is new for perl v5.13.10
9 This document describes differences between the 5.13.9 release and
12 If you are upgrading from an earlier release such as 5.13.8, first read
13 L<perl5139delta>, which describes differences between 5.13.8 and
16 =head1 Core Enhancements
18 =head2 The new regular expression modifiers available in suffix form
20 Various releases of the 5.13.x series have added new regular expression
21 modifiers, C</a>, C</d>, C</l>, and C</u>. They were only available in
22 infix form (e.g., C<(?a:...)>) until this release; now they are usable
23 in suffix form. This change was made too late to change all the
24 affected documentation, so there are a number of places that erroneously
25 say these must be used in infix form.
27 However, there is an ambiguity with the construct, C<s/foo/bar/le...>. Due
28 to backward compatibility constraints, in Perl 5.14 only, it will be
29 resolved as C<s/foo/bar/ le...>, that is, as meaning to take the result
30 of the substitution, and see if it is stringwise less-than-or-equal-to
31 what follows. In Perl 5.16 and later, it will instead be resolved as
32 meaning to do the pattern match using the rules of the current locale,
33 and evaluate the rhs as an expression when doing the substitution. In
34 5.14, if you want the latter interpretation, you can write "el" instead.
36 =head2 Add C<\p{Titlecase}> as a synonym for C<\p{Title}>
38 This synonym is added for symmetry with the Unicode property names
39 C<\p{Uppercase}> and C<\p{Lowercase}>.
41 =head2 New regular expression modifier option C</aa>
43 Doubling the C</a> regular expression modifier increases its effect,
44 so that in case-insensitive matching, no ASCII character will match a
45 non-ASCII character. For example, normally,
47 'k' =~ /\N{KELVIN SIGN}/i
49 will match; it won't under C</aa>.
51 =head2 New warnings categories for problematic (non-)Unicode code points.
53 Three new warnings subcategories of <utf8> have been added. These
54 allow you to turn off warnings for their covered events, while allowing
55 the other UTF-8 warnings to remain on. The three categories are:
56 C<surrogate> when UTF-16 surrogates are encountered;
57 C<nonchar> when Unicode non-character code points are encountered;
58 and C<non_unicode> when code points that are above the legal Unicode
59 maximum of 0x10FFFF are encountered.
61 =head1 Incompatible Changes
63 =head2 Most C<\p{}> properties are now immune from case-insensitive matching
65 For most Unicode properties, it doesn't make sense to have them match
66 differently under C</i> case-insensitive matching than not. And doing
67 so leads to unexpected results and potential security holes. For
70 m/\p{ASCII_Hex_Digit}+/i
72 could previously match non-ASCII characters because of the Unicode
73 matching rules. There were a number of bugs in this feature until an
74 earlier release in the 5.13 series. Now this release reverts, and
75 removes the feature completely except for the few properties where
76 people have come to expect it, namely the ones where casing is an
77 integral part of their functionality, such as C<m/\p{Uppercase}/i> and
78 C<m/\p{Lowercase}/i>, both of which match the exact same code points,
79 namely those matched by C<m/\p{Cased}/i>. Details are in
80 L<perlrecharclass/Unicode Properties>.
82 User-defined property handlers that need to match differently under
83 C</i> must change to read the new boolean parameter passed it which is
84 non-zero if case-insensitive matching is in effect; 0 if not. See
85 L<perluniprops/User-Defined Character Properties>.
87 =head2 regex: \p{} in pattern implies Unicode semantics
89 Now, a Unicode property match specified in the pattern will indicate
90 that the pattern is meant for matching according to Unicode rules
93 =head2 add GvCV_set() and GvGP_set() macros and change GvGP()
95 This allows a future commit to eliminate some backref magic between GV
96 and CVs, which will require complete control over assignment to the
99 If you've been using GvGP() in lvalue context this change will break
100 your code, you should use GvGP_set() instead. (c43ae56)
102 =head2 _swash_inversion_hash is no longer exported as part of the API
104 This function shouldn't be called from XS code. (4c2e113)
106 =head2 Unreferenced objects in global destruction
108 The fix for [perl #36347], which made sure that destructors were called on
109 unreferenced objects, broke the tests for three CPAN modules, which
110 apparently rely on the bug.
112 To provide more time for fixing them (as this is such a minor bug), we
113 have reverted the fix until after perl 5.14.0.
115 This resolves [perl #82542] and other related tickets.
117 =head2 C<close> on shared pipes
119 The C<close> function no longer waits for the child process to exit if the
120 underlying file descriptor is still in use by another thread, to avoid
121 deadlocks. It returns true in such cases.
127 =item Deprecated Modules
129 The following modules will be removed from the core distribution in a
130 future release, and should be installed from CPAN instead. Distributions
131 on CPAN which require these should add them to their prerequisites. The
132 core versions of these modules warnings will issue a deprecation warning.
134 If you ship a packaged version of Perl, either alone or as part of a
135 larger system, then you should carefully consider the repercussions of
136 core module deprecations. You may want to consider shipping your default
137 build of Perl with packages for some or all deprecated modules which
138 install into C<vendor> or C<site> perl library directories. This will
139 inhibit the deprecation warnings.
141 Alternatively, you may want to consider patching F<lib/deprecate.pm>
142 to provide deprecation warnings specific to your packaging system
143 or distribution of Perl, consistent with how your packaging system
144 or distribution manages a staged transition from a release where the
145 installation of a single package provides the given functionality, to
146 a later release where the system administrator needs to know to install
147 multiple packages to get that same functionality.
149 You can silence these deprecation warnings by installing the modules
150 in question from CPAN. To install the latest version of all of them,
151 just install C<Task::Deprecations::5_14>.
155 =item L<Devel::DProf>
157 We strongly recommend that you install and used L<Devel::NYTProf> in
158 preference, as it offers significantly improved profiling and reporting.
164 =head2 User-defined case-mapping
166 This feature is being deprecated due to its many issues, as documented in
167 L<perlunicode/User-Defined Case Mappings (for serious hackers only)>.
168 It is planned to remove this feature in Perl 5.16. A CPAN module
169 providing improved functionality is being prepared for release by the
172 =head1 Modules and Pragmata
174 =head2 New Modules and Pragmata
180 C<CPAN::Meta> version 2.110440 has been added as a dual-life module. It
181 provides a standard library to read, interpret and write CPAN distribution
182 metadata files (e.g. META.json and META.yml) which describes a
183 distribution, its contents, and the requirements for building it and
184 installing it. The latest CPAN distribution metadata specification is
185 included as C<CPAN::Meta::Spec> and notes on changes in the specification
186 over time are given in C<CPAN::Meta::History>.
190 C<Version::Requirements> version 0.101020 has been added as a dual-life
191 module. It provides a standard library to model and manipulates module
192 prerequisites and version constraints as defined in the L<CPAN::Meta::Spec>.
196 =head2 Updated Modules and Pragmata
202 C<B> has been upgraded from version 1.27 to 1.28.
206 C<Carp> has been upgraded from version 1.19 to 1.20.
208 [perl #82854] It now avoids using regular expressions that cause perl to
209 load its Unicode tables, in order to avoid the 'BEGIN not safe after
210 errors' error that will ensue if there has been a syntax error.
214 C<CGI> has been upgraded from version 3.51 to 3.52
218 C<CPAN> has been upgraded from version 1.94_64 to 1.94_65
220 Includes support for META.json and MYMETA.json.
224 C<CPANPLUS> has been upgraded from version 0.9011 to 0.9101
226 Includes support for META.json and MYMETA.json and a change to
227 using Digest::SHA for CPAN checksums.
231 C<deprecate> has been upgraded from version 0.01 to 0.02.
235 C<diagnostics> has been upgraded from version 1.21 to 1.22.
237 It now renders pod links slightly better, and has been taught to find
238 descriptions for messages that share their descriptions with other
243 C<Devel::DProf> has been upgraded from version 20080331.00 to 20110217.00.
245 Merely loading C<Devel::DProf> now no longer triggers profiling to start.
246 C<use Devel::DProf> and C<perl -d:DProf ...> still behave as before and start
249 NOTE: C<Devel::DProf> is deprecated and will be removed from a future
250 version of Perl. We strongly recommend that you install and use
251 L<Devel::NYTProf> instead, as it offers significantly improved
252 profiling and reporting.
256 C<DynaLoader> has been upgraded from version 1.12 to 1.13.
258 [perl #84358] It no longer inherits from AutoLoader; hence it no longer
259 produces weird error messages for unsuccessful method calls on classes that
260 inherit from DynaLoader.
264 C<IO::Select> has been upgraded from version 1.17 to 1.18.
266 It now allows IO::Handle objects (and objects in derived classes) to be
267 removed from an IO::Select set even if the underlying file descriptor is
272 C<IPC::Cmd> has been upgraded from version 0.68 to 0.70
276 C<HTTP::Tiny> has been upgraded from version 0.009 to 0.010
280 C<Math::BigInt> has been upgraded from version 1.99_04 to 1.992.
284 C<Module::Build> has been upgraded from version 0.3607 to 0.37_05.
286 A notable change is the deprecation of several modules.
287 Module::Build::Version has been deprecated and Module::Build now relies
288 directly upon L<version>. Module::Build::ModuleInfo has been deprecated in
289 favor of a standalone copy of it called L<Module::Metadata>.
290 Module::Build::YAML has been deprecated in favor of L<CPAN::Meta::YAML>.
292 Module::Build now also generates META.json and MYMETA.json files
293 in accordance with version 2 of the CPAN distribution metadata specification,
294 L<CPAN::Meta::Spec>. The older format META.yml and MYMETA.yml files are
295 still generated, as well.
299 C<Module::Load::Conditional> has been upgraded from version 0.40 to 0.44
303 C<Module::Metadata> has been upgraded from version 1.000003 to 1.000004.
307 C<overload> has been upgraded from version 1.12 to 1.13.
309 The documentation has greatly improved. See L</Documentation> below.
313 C<Parse::CPAN::Meta> has been upgraded from version 1.40 to 1.4401.
315 The latest Parse::CPAN::Meta can now read YAML or JSON files using
316 L<CPAN::Meta::YAML> and L<JSON::PP>, which are now part of the Perl core.
320 C<re> has been upgraded from version 0.16 to 0.17.
322 It now supports the double-a flag: C<use re '/aa';>
324 The C<regmust> function used to crash when called on a regular expression
325 belonging to a pluggable engine. Now it has been disabled for those.
327 C<regmust> no longer leaks memory.
331 C<Term::UI> has been upgraded from version 0.24 to 0.26
335 C<Unicode::Collate> has been upgraded from version 0.68 to 0.72
337 This also sees the switch from using the pure-perl version of this
338 module to the XS version.`
342 C<VMS::DCLsym> has been upgraded from version 1.04 to 1.05.
344 Two bugs have been fixed [perl #84086]:
346 The symbol table name was lost when tying a hash, due to a thinko in
347 C<TIEHASH>. The result was that all tied hashes interacted with the
350 Unless a symbol table name had been explicitly specified in the call
351 to the constructor, querying the special key ':LOCAL' failed to
352 identify objects connected to the local symbol table.
356 Added new function C<Unicode::UCD::num()>. This function will return the
357 numeric value of the string passed it; C<undef> if the string in its
358 entirety has no safe numeric value.
360 To be safe, a string must be a single character which has a numeric
361 value, or consist entirely of characters that match \d, coming from the
362 same Unicode block of digits. Thus, a mix of Bengali and Western
363 digits would be considered unsafe, as well as a mix of half- and
364 full-width digits, but strings consisting entirely of Devanagari digits
365 or of "Mathematical Bold" digits would would be safe.
369 C<CPAN> has been upgraded from version 1.94_63 to 1.94_64.
375 =head2 Changes to Existing Documentation
383 L<overload>'s documentation has practically undergone a rewrite. It
384 is now much more straightforward and clear.
388 =head3 L<perlhack> and perlrepository
394 The L<perlhack> and perlrepository documents have been heavily edited and
395 split up into several new documents.
397 The L<perlhack> document is now much shorter, and focuses on the Perl 5
398 development process and submitting patches to Perl. The technical content has
399 been moved to several new documents, L<perlsource>, L<perlinterp>,
400 L<perlhacktut>, and L<perlhacktips>. This technical content has only been
403 The perlrepository document has been renamed to L<perlgit>. This new document
404 is just a how-to on using git with the Perl source code. Any other content
405 that used to be in perlrepository has been moved to perlhack.
415 The documentation for the C<map> function now contains more examples,
416 see B<perldoc -f map> (f947627)
426 Examples in L<perlfaq4> have been updated to show the use of
427 L<Time::Piece>. (9243591)
437 Many POD related RT bugs and other issues which are too numerous to
438 enumerate have been solved by Michael Stevens.
444 The following additions or changes have been made to diagnostic output,
445 including warnings and fatal error messages. For the complete list of
446 diagnostic messages, see L<perldiag>.
448 =head2 New Diagnostics
452 =item "\b{" is deprecated; use "\b\{" instead
454 =item "\B{" is deprecated; use "\B\{" instead
456 Use of an unescaped "{" immediately following a C<\b> or C<\B> is now
457 deprecated so as to reserve its use for Perl itself in a future release.
459 =item regcomp: Add warning if \p is used under locale. (fb2e24c)
461 C<\p> implies Unicode matching rules, which are likely going to be
462 different than the locale's.
464 =item panic: gp_free failed to free glob pointer - something is repeatedly re-creating entries
466 This new error is triggered if a destructor called on an object in a
467 typeglob that is being freed creates a new typeglob entry containing an
468 object with a destructor that creates a new entry containing an object....
470 =item refcnt: fd %d%s
472 This new error only occurs if a internal consistency check fails when a
473 pipe is about to be closed.
477 =head2 Changes to Existing Diagnostics
483 The warning message about regex unrecognized escapes passed through is
484 changed to include any literal '{' following the 2-char escape. e.g.,
485 "\q{" will include the { in the message as part of the escape
490 C<binmode $fh, ':scalar'> no longer warns (8250589)
492 Perl will now no longer produce this warning:
494 $ perl -we 'open my $f, ">", \my $x; binmode $f, "scalar"'
495 Use of uninitialized value in binmode at -e line 1.
499 =head1 Utility Changes
507 [perl #82996] Use the user's from address as return-path in perlbug
509 Many systems these days don't have a valid Internet domain name and
510 perlbug@perl.org does not accept email with a return-path that does
511 not resolve. Therefore pass the user's address to sendmail so it's
512 less likely to get stuck in a mail queue somewhere. (019cfd2)
516 =head1 Configuration and Compilation
522 make reg_eval_scope.t TODOs consistently fail (daaf7ac)
524 Some of the TODO tests in reg_eval_scope.t spuriously passed under
525 non-threaded builds. Make the tests harder so they always fail.
527 Since one of the key bugs in (?{..}) is the trashing of the parent pad,
528 add some extra lexical vars to the parent scope and check they're still
533 Stop EU::CBuilder's tests from failing in parallel (cbf59d5)
535 It used to use the same paths for temporary files in all tests. This
536 blew up randomly when the tests were run in parallel.
546 F<porting/FindExt.t> now skips all tests on a static (-Uusedl) build
551 F<porting/FindExt.t> now passes on non-Win32 platforms when some
552 extensions are built statically.
556 =head1 Platform Support
558 =head2 Platform-Specific Notes
568 The C<test-prep> build target now depends on F<pod/perltoc.pod> to allow the
569 F<t/porting/buildtoc.t> test to run successfully.
579 [perl #82988] Skip hanging taint.t test on MirBSD 10 (1fb83d0)
581 Skip a hanging test under MirBSD that was already being skipped under
586 Previously if you build perl with a shared libperl.so on MirBSD (the
587 default config), it will work up to the installation; however, once
588 installed, it will be unable to find libperl. Treat path handling
589 like in the other BSD dialects.
595 =head1 Internal Changes
601 Fix harmless invalid read in Perl_re_compile() (f6d9469)
603 [perl #2460] described a case where electric fence reported an invalid
604 read. This could be reproduced under valgrind with blead and -e'/x/',
605 but only on a non-debugging build.
607 This was because it was checking for certain pairs of nodes (e.g. BOL + END)
608 and wasn't allowing for EXACT nodes, which have the string at the next
609 node position when using a naive NEXTOPER(first). In the non-debugging
610 build, the nodes aren't initialised to zero, and a 1-char EXACT node isn't
611 long enough to spill into the type field of the "next node".
613 Fix this by only using NEXTOPER(first) when we know the first node is
618 Break out the generated function Perl_keywords() into F<keywords.c>, a new file. (26ea9e1)
620 As it and Perl_yylex() both need FEATURE_IS_ENABLED, feature_is_enabled() is
621 no longer static, and the two macro definitions move from toke.c to perl.h
623 Previously, one had to cut and paste the output of perl_keywords.pl into the
624 middle of toke.c, and it was not clear that it was generated code.
628 A lot of tests have been ported from Test to Test::More, e.g. in
633 Increase default PerlIO buffer size. (b83080d)
635 The previous default size of a PerlIO buffer (4096 bytes) has been increased
636 to the larger of 8192 bytes and your local BUFSIZ. Benchmarks show that doubling
637 this decade-old default increases read and write performance in the neighborhood
638 of 25% to 50% when using the default layers of perlio on top of unix. To choose
639 a non-default size, such as to get back the old value or to obtain and even
640 larger value, configure with:
642 ./Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N
644 where N is the desired size in bytes; it should probably be a multiple of
649 =head1 Selected Bug Fixes
655 A Unicode C<\p{}> property match in a regular expression pattern will
656 now force Unicode rules for the rest of the regular expression
660 [perl #38456] binmode FH, ":crlf" only modifies top crlf layer (7826b36)
662 When pushed on top of the stack, crlf will no longer enable crlf layers
663 lower in the stack. This will prevent unexpected results.
667 Fix 'raw' layer for RT #80764 (ecfd064)
669 Made a ':raw' open do what it advertises to do (first open the file,
670 then binmode it), instead of leaving off the top layer.
674 Use PerlIOBase_open for pop, utf8 and bytes layers (c0888ac)
676 Three of Perl's builtin PerlIO layers (C<:pop>, C<:utf8> and
677 C<:bytes>) didn't allow stacking when opening a file. For example
680 open FH, '>:pop:perlio', 'some.file' or die $!;
682 Would throw an error: "Invalid argument". This has been fixed in this
687 An issue present since 5.13.1, where s/A/B/ with A utf8 and B
688 non-utf8, could cause corruption or segfaults has been
693 String evals will no longer fail after 2 billion scopes have been
694 compiled (d1bfb64, 2df5bdd, 0d311cd and 6012dc8)
698 [perl #81750] When strict 'refs' mode is off,
699 C<%{...}> in rvalue context returns C<undef> if
700 its argument is undefined. An optimisation introduced in perl 5.12.0 to
701 make C<keys %{...}> faster when used as a boolean did not take this into
702 account, causing C<keys %{+undef}> (and C<keys %$foo> when C<$foo> is
703 undefined) to be an error, which it should only be in strict mode.
707 [perl #83194] Combining the vector (%v) flag and dynamic precision would
708 cause sprintf to confuse the order of its arguments, making it treat the
709 string as the precision and vice versa.
713 [perl #77692] Sometimes the UTF8 length cache would not be reset on a value
714 returned by substr, causing C<length(substr($uni_string,...))> to give
715 wrong answers. With C<${^UTF8CACHE}> set to -1, it would produce a 'panic'
720 During the restoration of a localised typeglob on scope exit, any
721 destructors called as a result would be able to see the typeglob in an
722 inconsistent state, containing freed entries, which could result in a
723 crash. This would affect code like this:
726 eval { die bless [] }; # puts an object in $@
731 Now the glob entries are cleared before any destructors are called. This
732 also means that destructors can vivify entries in the glob. So perl tries
733 again and, if the entries are re-created too many times, dies with a
734 'panic: gp_free...' error message.
738 [perl #78494] When pipes are shared between threads, the C<close> function
739 (and any implicit close, such as on thread exit) no longer blocks.
743 Several contexts no longer allow a Unicode character to begin a word
744 that should never begin words, for an example an accent that must follow
745 another character previously could precede all other characters.
749 Case insensitive matching in regular expressions compiled under C<use
750 locale> now works much more sanely when the pattern and/or target string
751 are encoded in UTF-8. Previously, under these conditions the localeness
752 was completely lost. Now, code points above 255 are treated as Unicode,
753 but code points between 0 and 255 are treated using the current locale
754 rules, regardless of whether the pattern or string are encoded in UTF-8.
755 The few case insensitive matches that cross the 255/256 boundary are not
756 allowed. For example, 0xFF does not caselessly match the character at
757 0x178, LATIN CAPITAL LETTER Y WITH DIAERESIS, because 0xFF may not be
758 LATIN SMALL LETTER Y in the current locale, and Perl has no way of
759 knowing if that character even exists in the locale, much less what code
764 =head1 Acknowledgements
766 Perl 5.13.10 represents approximately one month of development since
767 Perl 5.13.9 and contains approximately 63000 lines of changes across
768 609 files from 38 authors and committers:
770 Abigail, Alexander Hartmaier, brian d foy, Charles Bailey, Chip
771 Salzenberg, Chris 'BinGOs' Williams, Craig A. Berry, Curtis Jewell,
772 Dave Rolsky, David Golden, David Leadbeater, David Mitchell, David
773 Wheeler, Father Chrysostomos, Florian Ragwitz, Franz Fasching, George
774 Greer, H.Merijn Brand, Hongwen Qiu, Hugo van der Sanden, Jay Hannah,
775 Jesse Vincent, Karl Williamson, Larwan Berke, Leon Timmermans, Michael
776 Breen, Michael Stevens, Nicholas Clark, Noirin Shirley, Paul Evans,
777 Peter John Acklam, Ricardo Signes, Robin Barker, Steven Schubiger, Tom
778 Christiansen, Tony Cook, Zsbán Ambrus and Ævar Arnfjörð Bjarmason
780 =head1 Reporting Bugs
782 If you find what you think is a bug, you might check the articles
783 recently posted to the comp.lang.perl.misc newsgroup and the perl
784 bug database at http://rt.perl.org/perlbug/ . There may also be
785 information at http://www.perl.org/ , the Perl Home Page.
787 If you believe you have an unreported bug, please run the L<perlbug>
788 program included with your release. Be sure to trim your bug down
789 to a tiny but sufficient test case. Your bug report, along with the
790 output of C<perl -V>, will be sent off to perlbug@perl.org to be
791 analysed by the Perl porting team.
793 If the bug you are reporting has security implications, which make it
794 inappropriate to send to a publicly archived mailing list, then please send
795 it to perl5-security-report@perl.org. This points to a closed subscription
796 unarchived mailing list, which includes all the core committers, who be able
797 to help assess the impact of issues, figure out a resolution, and help
798 co-ordinate the release of patches to mitigate or fix the problem across all
799 platforms on which Perl is supported. Please only use this address for
800 security issues in the Perl core, not for modules independently
805 The F<Changes> file for an explanation of how to view exhaustive details
808 The F<INSTALL> file for how to build Perl.
810 The F<README> file for general stuff.
812 The F<Artistic> and F<Copying> files for copyright information.