5 perl5135delta - what is new for perl v5.13.5
9 This document describes differences between the 5.13.4 release and
12 If you are upgrading from an earlier release such as 5.13.3, first read
13 L<perl5134delta>, which describes differences between 5.13.3 and
16 =head1 Core Enhancements
18 =head2 Adjacent pairs of nextstate opcodes are now optimized away
20 Previously, in code such as
22 use constant DEBUG => 0;
29 the ops for C<warn if DEBUG;> would be folded to a C<null> op (C<ex-const>), but
30 the C<nextstate> op would remain, resulting in a runtime op dispatch of
31 C<nextstate>, C<nextstate>, ...
33 The execution of a sequence of C<nextstate> ops is indistinguishable from just
34 the last C<nextstate> op so the peephole optimizer now eliminates the first of
35 a pair of C<nextstate> ops, except where the first carries a label, since labels
36 must not be eliminated by the optimizer and label usage isn't conclusively known
39 =head2 API function to parse statements
41 The C<parse_fullstmt> function has been added to allow parsing of a single
42 complete Perl statement. See L<perlapi> for details.
44 =head2 API functions for accessing the runtime hinthash
46 A new C API for introspecting the hinthash C<%^H> at runtime has been added.
47 See C<cop_hints_2hv>, C<cop_hints_fetchpvn>, C<cop_hints_fetchpvs>,
48 C<cop_hints_fetchsv>, and C<hv_copy_hints_hv> in L<perlapi> for details.
50 =head2 C interface to C<caller()>
52 The C<caller_cx> function has been added as an XSUB-writer's equivalent of
53 C<caller()>. See L<perlapi> for details.
55 =head1 Incompatible Changes
57 =head2 Magic variables outside the main package
59 In previous versions of Perl, magic variables like C<$!>, C<%SIG>, etc. would
60 'leak' into other packages. So C<%foo::SIG> could be used to access signals,
61 C<${"foo::!"}> (with strict mode off) to access C's C<errno>, etc.
63 This was a bug, or an 'unintentional' feature, which caused various ill effects,
64 such as signal handlers being wiped when modules were loaded, etc.
66 This has been fixed (or the feature has been removed, depending on how you see
69 =head2 Smart-matching against array slices
71 Previously, the following code resulted in a successful match:
77 This odd behaviour has now been fixed
78 L<[perl #77468]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=77468>.
82 The first argument of the C API function C<Perl_fetch_cop_label> has changed
83 from C<struct refcounted he *> to C<COP *>, to better insulate the user from
84 implementation details.
86 This API function was marked as "may change", and likely isn't in use outside
87 the core. (Neither an unpacked CPAN, nor Google's codesearch, finds any other
92 =head2 Use of qw(...) as parentheses
94 Historically the parser fooled itself into thinking that C<qw(...)> literals
95 were always enclosed in parentheses, and as a result you could sometimes omit
96 parentheses around them:
98 for $x qw(a b c) { ... }
100 The parser no longer lies to itself in this way. Wrap the list literal in
103 for $x (qw(a b c)) { ... }
105 =head1 Performance Enhancements
111 Scalars containing regular expressions now only allocate the part of the C<SV>
112 body they actually use, saving some space.
116 Compiling regular expressions has been made faster for the case where upgrading
117 the regex to utf8 is necessary but that isn't known when the compilation begins.
121 =head1 Modules and Pragmata
123 =head2 Updated Modules and Pragmata
129 Upgraded from version 0.23 to 0.25.
133 Upgraded from version 1.05 to 1.06.
137 Upgraded from version 1.07 to 1.08.
139 =item C<threads-shared>
141 Upgraded from version 1.33_02 to 1.33_03.
143 =item C<warnings> and C<warnings::register>
145 Upgraded from version 1.10 to 1.11 and from version 1.01 to 1.02 respectively.
147 It is now possible to register warning categories other than the names of
148 packages using C<warnings::register>. See L<perllexwarn> for more information.
152 Upgraded from version 1.12 to 1.16.
154 =item C<CPANPLUS::Dist::Build>
156 Upgraded from version 0.46 to 0.48.
158 =item C<Data::Dumper>
160 Upgraded from version 2.126 to 2.128.
162 This fixes a crash when using custom sort functions that might cause the stack
167 Upgraded from version 2.39 to 2.40.
171 Upgraded from version 1.12 to 1.13.
173 On some platforms with unusual header files, like Win32/gcc using mingw64
174 headers, some constants which weren't actually error numbers have been exposed
175 by C<Errno>. This has been fixed
176 L<[perl #77416]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=77416>.
178 =item C<ExtUtils::MakeMaker>
180 Upgraded from version 6.5601 to 6.57_05.
182 =item C<Filter::Simple>
184 Upgraded from version 0.84 to 0.85.
188 Upgraded from version 0.08 to 0.09.
190 =item C<Math::BigInt>
192 Upgraded from version 1.89_01 to 1.95.
194 This fixes, among other things, incorrect results when computing binomial
196 L<[perl #77640]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77640>.
198 =item C<Math::BigInt::FastCalc>
200 Upgraded from version 0.19 to 0.22.
202 =item C<Math::BigRat>
204 Upgraded from version 0.24 to 0.26.
206 =item C<Module::CoreList>
208 Upgraded from version 2.37 to 2.38.
210 =item C<PerlIO::scalar>
212 Upgraded from version 0.08 to 0.09.
216 Upgraded from version 1.19 to 1.20.
218 It now includes constants for POSIX signal constants.
222 Upgraded from version 2.27 to 2.28.
224 This fixes a possible infinite loop when looking for coderefs.
226 =item C<Test::Simple>
228 Upgraded from version 0.96 to 0.97_01.
232 Upgraded from version 1.03 to 1.04.
234 Calling C<< Tie::Hash-E<gt>TIEHASH() >> used to loop forever. Now it C<croak>s.
236 =item C<Unicode::Collate>
238 Upgraded from version 0.56 to 0.59.
242 Upgraded from version 0.10 to 0.11.
248 =head2 Changes to Existing Documentation
256 Many of the optree construction functions are now documented.
266 Expanded to cover many more popular books.
276 L<perlfaq>, L<perlfaq2>, L<perlfaq4>, L<perlfaq5>, L<perlfaq6>, L<perlfaq8>, and
277 L<perlfaq9> have seen various updates and modernizations.
283 The following additions or changes have been made to diagnostic output,
284 including warnings and fatal error messages. For the complete list of
285 diagnostic messages, see L<perldiag>.
287 =head2 New Diagnostics
293 Parsing code internal error (%s)
295 New fatal error produced when parsing code supplied by an extension violated the
296 parser's API in a detectable way.
300 Use of qw(...) as parentheses is deprecated
302 See L</"Use of qw(...) as parentheses"> for details.
306 =head2 Changes to Existing Diagnostics
312 C<warn> and C<die> now produce 'Wide character' warnings when fed a
313 character outside the byte range if STDERR is a byte-sized handle.
317 =head1 Utility Changes
325 The use of a deprecated C<goto> construct has been removed
326 L<[perl #74404]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=74404>.
336 The new F<t/lib/universal.t> script tests the Internal::* functions and other
337 things in F<universal.c>.
341 A rare race condition in F<t/op/while_readdir.t> has been fixed, stopping it
342 from failing randomly when running tests in parallel.
346 The new F<t/op/leaky-magic.t> script tests that magic applied to variables in
347 the main packages does not affect other packages.
351 =head1 Platform Support
353 =head2 Platform-Specific Notes
363 Make C<PerlIOUnix_open> honour default permissions on VMS.
365 When C<perlio> became the default and C<unixio> became the default bottom layer,
366 the most common path for creating files from Perl became C<PerlIOUnix_open>,
367 which has always explicitly used C<0666> as the permission mask.
369 To avoid this, C<0777> is now passed as the permissions to C<open()>. In the
370 VMS CRTL, C<0777> has a special meaning over and above intersecting with the
371 current umask; specifically, it allows Unix syscalls to preserve native default
378 =head1 Internal Changes
384 C<CALL_FPTR> and C<CPERLscope> have been deprecated.
386 Those are left from an old implementation of C<MULTIPLICITY> using C++ objects,
387 which was removed in Perl 5.8. Nowadays these macros do exactly nothing, so
388 they shouldn't be used anymore.
390 For compatibility, they are still defined for external C<XS> code. Only
391 extensions defining C<PERL_CORE> must be updated now.
395 C<lex_stuff_pvs()> has been added as a convenience macro wrapping
396 C<lex_stuff_pvn()> for literal strings.
400 The recursive part of the peephole optimizer is now hookable.
402 In addition to C<PL_peepp>, for hooking into the toplevel peephole optimizer, a
403 C<PL_rpeepp> is now available to hook into the optimizer recursing into
404 side-chains of the optree.
408 =head1 Selected Bug Fixes
414 A regression introduced in Perl 5.12.0, making
415 C<< my $x = 3; $x = length(undef) >> result in C<$x> set to C<3> has been
416 fixed. C<$x> will now be C<undef>.
420 A fatal error in regular expressions when processing UTF-8 data has been fixed
421 L<[perl #75680]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75680>.
425 An erroneous regular expression engine optimization that caused regex verbs like
426 C<*COMMIT> to sometimes be ignored has been removed.
430 The Perl debugger now also works in taint mode
431 L<[perl #76872]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=76872>.
435 Several memory leaks in cloning and freeing threaded Perl interpreters have been
436 fixed L<[perl #77352]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77352>.
440 A possible string corruption when doing regular expression matches on overloaded
441 objects has been fixed
442 L<[perl #77084]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77084>.
446 Magic applied to variables in the main package no longer affects other packages.
447 See L</Magic variables outside the main package> above
448 L<[perl #76138]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=76138>.
452 Opening a glob reference via C<< open $fh, "E<gt>", \*glob >> will no longer
453 cause the glob to be corrupted when the filehandle is printed to. This would
454 cause perl to crash whenever the glob's contents were accessed
455 L<[perl #77492]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77492>.
459 The postincrement and postdecrement operators, C<++> and C<-->, used to cause
460 leaks when being used on references. This has now been fixed.
464 A bug when replacing the glob of a loop variable within the loop has been fixed
465 L<[perl #21469]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=21469>. This
466 means the following code will no longer crash:
474 Perl would segfault if the undocumented C<Internals> functions that used
475 reference prototypes were called with the C<&foo()> syntax, e.g.
476 C<&Internals::SvREADONLY(undef)>
477 L<[perl #77776]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77776>.
479 These functions now call C<SvROK> on their arguments before dereferencing them
480 with C<SvRV>, and we test for this case in F<t/lib/universal.t>.
484 When assigning a list with duplicated keys to a hash, the assignment used to
485 return garbage and/or freed values:
487 @a = %h = (list with some duplicate keys);
489 This has now been fixed
490 L<[perl #31865]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=31865>.
494 An earlier release of the 5.13 series of Perl changed the semantics of opening a
495 reference to a copy of a glob:
498 open my $fh, '>', \$var;
500 This was a mistake, and the previous behaviour from Perl 5.10 and 5.12, which is
501 to treat \$var as a scalar reference, has now been restored.
505 The regular expression bracketed character class C<[\8\9]> was effectively the
506 same as C<[89\000]>, incorrectly matching a NULL character. It also gave
507 incorrect warnings that the C<8> and C<9> were ignored. Now C<[\8\9]> is the
508 same as C<[89]> and gives legitimate warnings that C<\8> and C<\9> are
509 unrecognized escape sequences, passed-through.
513 C<warn()> and C<die()> now respect utf8-encoded scalars
514 L<[perl #45549]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=45549>.
518 =head1 Known Problems
524 The upgrade to Encode-2.40 has caused some tests in the libwww-perl distribution
525 on CPAN to fail. (Specifically, F<base/message-charset.t> tests 33-36 in version
526 5.836 of that distribution now fail.)
530 The upgrade to ExtUtils-MakeMaker-6.57_05 has caused some tests in the
531 Module-Install distribution on CPAN to fail. (Specifically, F<02_mymeta.t> tests
532 5 and 21, F<18_all_from.t> tests 6 and 15, F<19_authors.t> tests 5, 13, 21 and
533 29, and F<20_authors_with_special_characters.t> tests 6, 15 and 23 in version
534 1.00 of that distribution now fail.)
538 =head1 Acknowledgements
540 Perl 5.13.5 represents approximately one month of development since
541 Perl 5.13.4 and contains 74558 lines of changes across 549 files
542 from 45 authors and committers:
544 Abigail, Alexander Alekseev, Aristotle Pagaltzis, Ben Morrow, Bram, brian d foy,
545 Chas. Owens, Chris 'BinGOs' Williams, Craig A. Berry, Curtis Jewell, Dagfinn
546 Ilmari Mannsåker, David Golden, David Leadbeater, David Mitchell, Eric Brine,
547 Father Chrysostomos, Florian Ragwitz, Gisle Aas, Jan Dubois, Jerry D. Hedden,
548 Jesse Vincent, Jim Cromie, Jirka Hruška, Karl Williamson, Michael G. Schwern,
549 Nicholas Clark, Paul Johnson, Philippe Bruhat (BooK), Piotr Fusik, Rafael
550 Garcia-Suarez, Rainer Tammer, Reini Urban, Ricardo Signes, Rob Hoelz, Robin
551 Barker, Steffen Mueller, Steve Hay, Steve Peters, Todd Rinaldo, Tony Cook,
552 Vincent Pit, Yves Orton, Zefram, Zsbán Ambrus, Ævar Arnfjörð Bjarmason.
554 Many of the changes included in this version originated in the CPAN
555 modules included in Perl's core. We're grateful to the entire CPAN
556 community for helping Perl to flourish.
558 =head1 Reporting Bugs
560 If you find what you think is a bug, you might check the articles
561 recently posted to the comp.lang.perl.misc newsgroup and the perl
562 bug database at http://rt.perl.org/perlbug/ . There may also be
563 information at http://www.perl.org/ , the Perl Home Page.
565 If you believe you have an unreported bug, please run the B<perlbug>
566 program included with your release. Be sure to trim your bug down
567 to a tiny but sufficient test case. Your bug report, along with the
568 output of C<perl -V>, will be sent off to perlbug@perl.org to be
569 analysed by the Perl porting team.
571 If the bug you are reporting has security implications, which make it
572 inappropriate to send to a publicly archived mailing list, then please send
573 it to perl5-security-report@perl.org. This points to a closed subscription
574 unarchived mailing list, which includes all the core committers, who be able
575 to help assess the impact of issues, figure out a resolution, and help
576 co-ordinate the release of patches to mitigate or fix the problem across all
577 platforms on which Perl is supported. Please only use this address for
578 security issues in the Perl core, not for modules independently
583 The F<Changes> file for an explanation of how to view exhaustive details
586 The F<INSTALL> file for how to build Perl.
588 The F<README> file for general stuff.
590 The F<Artistic> and F<Copying> files for copyright information.