5 perl5192delta - what is new for perl v5.19.2
9 This document describes differences between the 5.19.1 release and the 5.19.2
12 If you are upgrading from an earlier release such as 5.19.0, first read
13 L<perl5191delta>, which describes differences between 5.19.0 and 5.19.1.
15 =head1 Core Enhancements
17 =head2 More consistent prototype parsing
19 Multiple semicolons in subroutine prototypes have long been tolerated and
20 treated as a single semicolon. There was one case where this did not
21 happen. A subroutine whose prototype begins with "*" or ";*" can affect
22 whether a bareword is considered a method name or sub call. This now
23 applies also to ";;;*".
25 Whitespace has long been allowed inside subroutine prototypes, so
26 C<sub( $ $ )> is equivalent to C<sub($$)>, but until now it was stripped
27 when the subroutine was parsed. Hence, whitespace was I<not> allowed in
28 prototypes set by C<Scalar::Util::set_prototype>. Now it is permitted,
29 and the parser no longer strips whitespace. This means
30 C<prototype &mysub> returns the original prototype, whitespace and all.
32 =head1 Performance Enhancements
38 Precomputed hash values are now used in more places during method lookup.
42 =head1 Modules and Pragmata
44 =head2 Updated Modules and Pragmata
50 L<autodie> has been upgraded from version 2.19 to 2.20.
54 L<B> has been upgraded from version 1.43 to 1.44.
58 L<B::Concise> has been upgraded from version 0.96 to 0.98.
62 L<B::Deparse> has been upgraded from version 1.21 to 1.22.
66 L<base> has been upgraded from version 2.18 to 2.19.
70 L<Benchmark> has been upgraded from version 1.16 to 1.17.
74 L<Class::Struct> has been upgraded from version 0.64 to 0.65.
78 L<Data::Dumper> has been upgraded from version 2.146 to 2.147.
82 L<DB_File> has been upgraded from version 1.828 to 1.829.
86 L<DBM_Filter> has been upgraded from version 0.05 to 0.06.
90 L<Devel::Peek> has been upgraded from version 1.11 to 1.12.
94 L<Digest::MD5> has been upgraded from version 2.52 to 2.53.
98 L<Digest::SHA> has been upgraded from version 5.84 to 5.85.
102 L<English> has been upgraded from version 1.06 to 1.07.
106 L<Errno> has been upgraded from version 1.18 to 1.19.
110 L<ExtUtils::Embed> has been upgraded from version 1.30 to 1.31
112 The generated C<C> code now incorporates bug fixes present in
113 F<miniperlmain.c>, and has whitespace changes. It now uses
114 C<#include "..."> for header files instead of C<< #include <...> >>.
115 This should not make any difference, unless programs embedding C<libperl>
116 happen to have local and incompatible files named F<EXTERN.h>, F<XSUB.h> or
117 F<perl.h>, as these will now be picked up instead of the installed Perl
120 The C<canon()> function now correctly handles packages with multiple C<::>
121 separators when the I<$as> parameter is not I</>. Given that it used to
122 generate strings which would likely be syntax errors or pathnames instead of
123 filenames, we infer that from the complete lack of bug reports no-one was
124 using this functionality. (C<ExtUtils::Miniperl> is now using it.)
128 L<ExtUtils::Miniperl> has been upgraded and given a version of 1.
129 Previously it did not have a version number.
131 C<writemain()> now takes an optional first argument. A reference to a scalar
132 is treated as a filename to be opened and written to. Any other reference is
133 used as the filehandle to write to. Otherwise the existing default remains,
134 to write to C<STDOUT>.
136 C<writemain()> has been refactored to use functions from L<ExtUtils::Embed>,
137 reducing code size and duplication. The internal function C<canon()> has been
142 L<ExtUtils::ParseXS> has been upgraded from version 3.19 to 3.21.
146 L<File::Basename> has been upgraded from version 2.84 to 2.85.
150 L<Getopt::Long> has been upgraded from version 2.4 to 2.41.
154 L<Getopt::Std> has been upgraded from version 1.08 to 1.09.
158 L<Hash::Util::FieldHash> has been upgraded from version 1.11 to 1.12.
162 L<HTTP::Tiny> has been upgraded from version 0.031 to 0.034.
166 L<I18N::Langinfo> has been upgraded from version 0.10 to 0.11.
170 L<if> has been upgraded from version 0.0602 to 0.0603.
174 L<IPC::Cmd> has been upgraded from version 0.80 to 0.82.
178 L<MIME::Base64> has been upgraded from version 3.13 to 3.14.
182 L<Module::CoreList> has been upgraded from version 2.92 to 2.94.
186 L<Params::Check> has been upgraded from version 0.36 to 0.38.
190 L<Parse::CPAN::Meta> has been upgraded from version 1.4404 to 1.4405.
194 L<Pod::Functions> has been upgraded from version 1.06 to 1.07.
198 L<Pod::Html> has been upgraded from version 1.19 to 1.2.
202 L<POSIX> has been upgraded from version 1.33 to 1.34.
204 C<POSIX::AUTOLOAD> will no longer infinitely recurse if the shared
205 object fails to load.
209 L<Safe> has been upgraded from version 2.36 to 2.37.
213 L<Socket> has been upgraded from version 2.009 to 2.010.
217 L<Storable> has been upgraded from version 2.43 to 2.45.
219 Calling C<STORABLE_attach> hooks no longer leaks memory. [perl #118829]
223 L<Text::ParseWords> has been upgraded from version 3.28 to 3.29.
227 L<Tie::Hash> has been upgraded from version 1.04 to 1.05.
231 L<Time::Piece> has been upgraded from version 1.2002 to 1.21.
237 =head2 Changes to Existing Documentation
239 =head3 L<perlexperiment>
245 Code in regular expressions, regular expression backtracking verbs,
246 and lvalue subroutines are no longer listed as experimental. (This
247 also affects L<perlre> and L<perlsub>.)
257 Since Perl v5.10, it has been possible for subroutines in @INC to return
258 a reference to a scalar holding initial source code to prepend to the file.
259 This is now documented.
269 The language design of Perl has always called for monomorphic operators.
270 This is now mentioned explicitly.
280 The fact that the regexp engine makes no effort to call (?{}) and (??{})
281 constructs any specified number of times (although it will basically DWIM
282 in case of a successful match) has been documented.
288 The following additions or changes have been made to diagnostic output,
289 including warnings and fatal error messages. For the complete list of
290 diagnostic messages, see L<perldiag>.
292 =head2 New Diagnostics
300 L<Missing ']' in prototype for %s : %s|perldiag/"Missing ']' in prototype
303 (W illegalproto) A grouping was started with C<[> but never closed with
308 =head2 Changes to Existing Diagnostics
314 Under rare circumstances, one could get a "Can't coerce readonly REF to
315 string" instead of the customary "Modification of a read-only value". This
316 alternate error message has been removed.
320 "Ambiguous use of * resolved as operator *": This and similar warnings
321 about "%" and "&" used to occur in some circumstances where there was no
322 operator of the type cited, so the warning was completely wrong. This has
323 been fixed [perl #117535, #76910].
327 Warnings about malformed subroutine prototypes are now more consistent in
328 how the prototypes are rendered. Some of these warnings would truncate
329 prototypes containing nulls. In other cases one warning would suppress
330 another. The warning about illegal characters in prototypes no longer says
331 "after '_'" if the bad character came before the underscore.
335 L<Perl folding rules are not up-to-date for 0x%X; please use the perlbug
336 utility to report; in regex; marked by <-- HERE in
337 mE<sol>%sE<sol>|perldiag/"Perl folding rules are not up-to-date for 0x%X;
338 please use the perlbug utility to report; in regex; marked by <-- HERE in
341 This message is now only in the regexp category, and not in the deprecated
342 category. It is still a default (i.e., severe) warning [perl #89648].
346 The debugger's "n" command now respects lvalue subroutines and steps over
351 =head1 Configuration and Compilation
357 F<installperl> and F<installman>'s option handling has been refactored to use
358 L<Getopt::Long>. Both are used by the F<Makefile> C<install> targets, and
359 are not installed, so these changes are only likely to affect custom
360 installation scripts.
366 single letter options now also have long names
370 invalid options are now rejected
374 command line arguments that are not options are now rejected
378 Each now has a C<--help> option to display the usage message.
382 The behaviour for all valid documented invocations is unchanged.
386 =head1 Platform Support
388 =head2 Platform-Specific Notes
394 C<objformat> was removed from version 0.4-RELEASE of MidnightBSD and had been
395 deprecated on earlier versions. This caused the build environment to be
396 erroneously configured for C<a.out> rather than C<elf>. This has been now
401 =head1 Internal Changes
407 The Makefile shortcut targets for many rarely (or never) used testing and
408 profiling targets have been removed, or merged into the only other Makefile
409 target that uses them. Specifically, these targets are gone, along with
410 documentation that referenced them or explained how to use them:
412 check.third check.utf16 check.utf8 coretest minitest.prep
413 minitest.utf16 perl.config.dashg perl.config.dashpg
414 perl.config.gcov perl.gcov perl.gprof perl.gprof.config
415 perl.pixie perl.pixie.atom perl.pixie.config perl.pixie.irix
416 perl.third perl.third.config perl.valgrind.config purecovperl
417 pureperl quantperl test.deparse test.taintwarn test.third
418 test.torture test.utf16 test.utf8 test_notty.deparse
419 test_notty.third test_notty.valgrind test_prep.third
420 test_prep.valgrind torturetest ucheck ucheck.third ucheck.utf16
421 ucheck.valgrind utest utest.third utest.utf16 utest.valgrind
423 It's still possible to run the relevant commands by "hand" - no underlying
424 functionality has been removed.
428 It is now possible to keep Perl from initializing locale handling.
429 For the most part, Perl doesn't pay attention to locale. (See
430 L<perllocale>.) Nonetheless, until now, on startup, it has always
431 initialized locale handling to the system default, just in case the
432 program being executed ends up using locales. (This is one of the first
433 things a locale-aware program should do, long before Perl knows if it
434 will actually be needed or not.) This works well except when Perl is
435 embedded in another application which wants a locale that isn't the
436 system default. Now, if the environment variable
437 C<PERL_SKIP_LOCALE_INIT> is set at the time Perl is started, this
438 initialization step is skipped. Prior to this, on Windows platforms,
439 the only workaround for this deficiency was to use a hacked-up copy of
440 internal Perl code. Applications that need to use older Perls can
441 discover if the embedded Perl they are using needs the workaround by
442 testing that the C preprocessor symbol C<HAS_SKIP_LOCALE_INIT> is not
447 C<BmRARE> and C<BmPREVIOUS> have been removed. They were not used anywhere
448 and are not part of the API. For XS modules, they are now #defined as 0.
452 C<sv_force_normal>, which usually croaks on read-only values, used to allow
453 read-only values to be modified at compile time. This has been changed to
454 croak on read-only values regardless. This change uncovered several core
459 =head1 Selected Bug Fixes
465 There have been several fixes related to Perl's handling of locales. perl
466 #38193 was described above in L</Internal Changes>.
467 Also fixed is #112208 in which the error string in C<$!> displayed as
468 garbage in many UTF-8 locales;
469 #118197, where the radix (decimal point) character had to be an ASCII
470 character (which doesn't work for some non-Western languages);
471 and #115808, in which C<POSIX::setlocale()> on failure returned an
472 C<undef> which didn't warn about not being defined even if those
473 warnings were enabled.
477 The dtrace sub-entry probe now works with lexical subs, instead of
478 crashing [perl #118305].
482 Compiling a C<split> operator whose third argument is a named constant
483 evaulating to 0 no longer causes the constant's value to change.
487 A named constant used as the second argument to C<index> no longer gets
488 coerced to a string if it is a reference, regular expression, dualvar, etc.
492 A named constant evaluating to the undefined value used as the second
493 argument to C<index> no longer produces "uninitialized" warnings at compile
494 time. It will still produce them at run time.
498 When a scalar was returned from a subroutine in @INC, the referenced scalar
499 was magically converted into an IO thingy, possibly resulting in "Bizarre
500 copy" errors if that scalar continued to be used elsewhere. Now Perl uses
501 an internal copy of the scalar instead.
505 Undefining an inlinable lexical subroutine (C<my sub foo() { 42 } undef
506 &foo>) would result in a crash if warnings were turned on.
510 Certain uses of the C<sort> operator are optimised to modify an array in
511 place, such as C<@a = sort @a>. During the sorting, the array is made
512 read-only. If a sort block should happen to die, then the array remained
513 read-only even outside the C<sort>. This has been fixed.
517 C<$a> and C<$b> inside a sort block are aliased to the actual arguments to
518 C<sort>, so they can be modified through those two variables. This did not
519 always work, e.g., for lvalue subs and C<$#ary>, and probably many other
520 operators. It works now.
524 The arguments to C<sort> are now all in list context. If the C<sort>
525 itself were called in void or scalar context, then I<some>, but not all, of
526 the arguments used to be in void or scalar context.
530 Subroutine prototypes with Unicode characters above U+00FF were getting
531 mangled during closure cloning. This would happen with subroutines closing
532 over lexical variables declared outside, and with lexical subs.
536 In regular expressions containing multiple code blocks, the values of
537 C<$1>, C<$2>, etc., set by nested regular expression calls would leak from
538 one block to the next. Now these variables always refer to the outer
539 regular expression at the start of an embedded block [perl #117917].
543 C<UNIVERSAL::can> now treats its first argument the same way that method
544 calls do: Typeglobs and glob references with non-empty IO slots are treated
545 as handles, and strings are treated as filehandles, rather than packages,
546 if a handle with that name exists [perl #113932].
550 Method calls on typeglobs (e.g., C<< *ARGV->getline >>) used to stringify
551 the typeglob and then look it up again. Combined with changes in Perl
552 5.18.0, this allowed C<< *foo->bar >> to call methods on the "foo" package
553 (like C<< foo->bar >>). In some cases it could cause the method to be
554 called on the wrong handle. Now a typeglob argument is treated as a
555 handle (just like C<< (\*foo)->bar >>), or, if its IO slot is empty, an
560 Under copy-on-write builds (the default as of 5.19.1) C<< ${'_<-e'}[0] >>
561 no longer gets mangled. This is the first line of input saved for the
562 debugger's use for one-liners [perl #118627].
566 Assigning a vstring to a tied variable or to a subroutine argument aliased
567 to a nonexistent hash or array element now works, without flattening the
568 vstring into a regular string.
572 C<pos>, C<tie>, C<tied> and C<untie> did not work
573 properly on subroutine arguments aliased to nonexistent
574 hash and array elements [perl #77814, #27010].
578 The C<< => >> fat arrow operator can now quote built-in keywords even if it
579 occurs on the next line, making it consistent with how it treats other
584 =head1 Known Problems
590 One of the bug fixes has accidentally thrown line numbers off in rare
591 cases, causing test failures for some CPAN modules. This will hopefully be
592 fixed soon [perl #118931].
596 =head1 Acknowledgements
598 Perl 5.19.2 represents approximately 4 weeks of development since Perl 5.19.1
599 and contains approximately 15,000 lines of changes across 400 files from 40
602 Perl continues to flourish into its third decade thanks to a vibrant community
603 of users and developers. The following people are known to have contributed the
604 improvements that became Perl 5.19.2:
606 Abhijit Menon-Sen, Alexandr Ciornii, Andy Dougherty, Aristotle Pagaltzis, Brian
607 Fraser, Brian Gottreu, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari
608 Mannsåker, Daniel Dragan, David Golden, David Mitchell, Ed Avis, Father
609 Chrysostomos, Graham Knop, H.Merijn Brand, Hojung Youn, James E Keenan, Johan
610 Vromans, Karl Williamson, Keedi Kim, Kent Fredric, Lukas Mai, Moritz Lenz,
611 Nathan Trapuzzano, Neil Bowers, Nicholas Clark, Niels Thykier, Niko Tyni,
612 Olivier Mengué, Peter Martini, Petr Písař, Reini Urban, Ricardo Signes,
613 Ruslan Zakirov, Slaven Rezic, Steffen Müller, Tony Cook, Vladimir Timofeev,
616 The list above is almost certainly incomplete as it is automatically generated
617 from version control history. In particular, it does not include the names of
618 the (very much appreciated) contributors who reported issues to the Perl bug
621 Many of the changes included in this version originated in the CPAN modules
622 included in Perl's core. We're grateful to the entire CPAN community for
623 helping Perl to flourish.
625 For a more complete list of all of Perl's historical contributors, please see
626 the F<AUTHORS> file in the Perl source distribution.
628 =head1 Reporting Bugs
630 If you find what you think is a bug, you might check the articles recently
631 posted to the comp.lang.perl.misc newsgroup and the perl bug database at
632 http://rt.perl.org/perlbug/ . There may also be information at
633 http://www.perl.org/ , the Perl Home Page.
635 If you believe you have an unreported bug, please run the L<perlbug> program
636 included with your release. Be sure to trim your bug down to a tiny but
637 sufficient test case. Your bug report, along with the output of C<perl -V>,
638 will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
640 If the bug you are reporting has security implications, which make it
641 inappropriate to send to a publicly archived mailing list, then please send it
642 to perl5-security-report@perl.org. This points to a closed subscription
643 unarchived mailing list, which includes all the core committers, who will be
644 able to help assess the impact of issues, figure out a resolution, and help
645 co-ordinate the release of patches to mitigate or fix the problem across all
646 platforms on which Perl is supported. Please only use this address for
647 security issues in the Perl core, not for modules independently distributed on
652 The F<Changes> file for an explanation of how to view exhaustive details on
655 The F<INSTALL> file for how to build Perl.
657 The F<README> file for general stuff.
659 The F<Artistic> and F<Copying> files for copyright information.