5 perl5154delta - what is new for perl v5.15.4
9 This document describes differences between the 5.15.3 release and
12 If you are upgrading from an earlier release such as 5.15.3, first read
13 L<perl5153delta>, which describes differences between 5.15.3 and
16 =head1 Core Enhancements
18 =head2 $^X converted to an absolute path on FreeBSD, OS X and Solaris
20 C<$^X> is now converted to an absolute path on OS X, FreeBSD (without
21 needing F</proc> mounted) and Solaris 10 and 11. This augments the
22 previous approach of using F</proc> on Linux, FreeBSD and NetBSD
23 (in all cases, where mounted).
25 This makes relocatable perl installations more useful on these platforms.
26 (See "Relocatable @INC" in F<INSTALL>)
28 =head2 Unicode Symbol Names
30 Perl now has proper support for Unicode in symbol names. It used to be
31 that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of
32 the underlying representation to look up the symbol. That meant that
33 C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All
34 these parts of Perl have been fixed to account for Unicode:
40 Method names (including those passed to C<use overload>)
44 Typeglob names (including names of variables, subroutines and filehandles)
52 Constant subroutine names (not null-clean yet)
60 Symbolic dereferencing
64 Second argument to C<bless()> and C<tie()>
68 Return value of C<ref()>
72 Package names returned by C<caller()>
84 Various warnings and error messages that mention variable names or values,
89 In addition, a parsing bug has been fixed that prevented C<*{é}> from
90 implicitly quoting the name, but instead interpreted it as C<*{+é}>, which
91 would cause a strict violation.
93 C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII
94 letter. That has been extended to all Unicode identifier characters.
96 C<$é> is now subject to "Used only once" warnings. It used to be exempt,
97 as it was treated as a punctuation variable.
99 Also, single-character Unicode punctuation variables (like $‰) are now
100 supported [perl #69032]. They are also supported with C<our> and C<my>,
101 but that is a mistake that will be fixed before 5.16.
103 =head2 Support for Embedded Nulls
105 Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in
106 strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would
107 call the "a" method, instead of the actual method name contained in $m.
108 These parts of perl have been fixed to support nulls:
118 Typeglob names (including filehandle names)
130 Return value of C<ref()>
134 Package names returned by C<caller()>
142 Typeglob elements (C<*foo{"THING\0stuff"}>)
150 Various warnings and error messages that mention variable names or values,
155 One side effect of these changes is that blessing into "\0" no longer
156 causes C<ref()> to return false.
158 =head2 Autoloaded sort Subroutines
160 Custom sort subroutines can now be autoloaded [perl #30661]:
163 @sorted = sort foo @list; # uses AUTOLOAD
165 =head2 Improved typemaps for Some Builtin Types
167 Most XS authors will be aware that there is a longstanding bug
168 in the OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>),
169 T_CVREF (C<CV*>), and T_SVREF (C<SVREF> or C<\$foo>) that requires
170 manually decrementing the reference count of the return value
171 instead of the typemap taking care of this. For
172 backwards-compatibility, this cannot be changed in the default
173 typemaps. But we now provide additional typemaps
174 C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug.
175 Using them in your extension is as simple as having one line
176 in your C<TYPEMAP> section:
178 HV* T_HVREF_REFCOUNT_FIXED
180 =head1 Performance Enhancements
186 C<substr> no longer calculates a value to return when called in void
191 =head1 Modules and Pragmata
193 =head2 Updated Modules and Pragmata
199 L<Archive::Tar> has been upgraded from version 1.78 to version 1.80.
203 L<base> has been upgraded from version 2.17 to version 2.18.
205 C<base> no longer sets a module's C<$VERSION> to "-1" when a module it loads
206 does not define a C<$VERSION>. This change has been made because "-1" is not
207 a valid version number under the new "lax" criteria used internally by
208 C<UNIVERSAL::VERSION>. (See L<version> for more on "lax" version criteria.)
210 C<base> no longer internally skips loading modules it has already loaded and
211 instead relies on C<require> to inspect C<%INC>. This fixes a bug when C<base>
212 is used with code that clear C<%INC> to force a module to be reloaded.
216 L<Digest> has been upgraded from version 1.16 to version 1.17.
220 L<DynaLoader> has been upgraded from version 1.13 to 1.14.
222 It stopped exporting its symbols with the ExtUtils::ParseXS changes in
223 5.15.2. Now it exports them once more.
227 L<ExtUtils::MakeMaker> has been upgraded from version 6.59 to version 6.61_01.
231 L<ExtUtils::ParseXS> has been upgraded from version 3.04_04 to version 3.05.
235 L<Module::CoreList> has been upgraded from version 2.56 to 2.57.
239 L<Module::Load> has been upgraded from version 0.20 to version 0.22.
241 Resolve possible security problem [http://goo.gl/YzHRU] where a '::' prefixed
242 module can 'jump' out of @INC
246 L<perlfaq> has been upgraded from version 5.0150034 to version 5.0150035.
250 L<Unicode::Collate> has been upgraded from version 0.78 to version 0.80.
252 Locales updated to CLDR 2.0: ar, be, bg, ha, hr, kk, lt.
253 Newly supported locales: as, fi__phonebook, gu, hi, kn, kok and ln.
259 =head2 Changes to Existing Documentation
261 =head3 L<perlfunc>, L<open>
267 As an accident of history, C<open $fh, "<:", ...> applies the default
268 layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring
269 whatever is declared by L<open.pm|open>. This seems such a useful feature
270 it has been documented in L<perlfunc|perlfunc/open> and L<open>.
280 The HV API has long accepted negative lengths to indicate that the key is
281 in UTF8. Now this is documented.
285 The C<boolSV()> macro is now documented.
295 A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>,
296 has been added, which explains the two APIs for accessing the name of the
303 The following additions or changes have been made to diagnostic output,
304 including warnings and fatal error messages. For the complete list of
305 diagnostic messages, see L<perldiag>.
307 =head2 Changes to Existing Diagnostics
314 "Code point 0x%X is not Unicode, no properties match it; all inverse
315 prop erties do" has been changed to "Code point 0x%X is not Unicode, all
316 \p{} matches fail; all \P{} matches succeed"
326 F<t/porting/checkcfgvar.t> now tests that all config.sh-style files are
327 complete. These are used by the various non-*nix to generate their
328 F<config.h>, and an incomplete input file will generate invalid output.
332 =head1 Internal Changes
338 These new functions have been added as part of the work on Unicode symbols:
350 gv_fetchmeth_pv_autoload
351 gv_fetchmeth_pvn_autoload
352 gv_fetchmeth_sv_autoload
353 gv_fetchmethod_pv_flags
354 gv_fetchmethod_pvn_flags
355 gv_fetchmethod_sv_flags
370 The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are
371 experimental and may change in a future release.
375 The following functions were added. These are I<not> part of the API:
387 There is also a C<HEKf> macro corresponding to C<SVf>, for
388 interpolating HEKs in formatted strings.
392 C<sv_catpvn_flags> takes a couple of new internal-only flags,
393 C<SV_CATBYTES> and C<SV_CATUTF8>, which tell it whether the char array to
394 be concatenated is UTF8. This allows for more efficient concatenation than
395 creating temporary SVs to pass to C<sv_catsv>.
399 For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. This
400 is in addition to setting C<SvPVX(cv)>, for compatibility with 5.8 to 5.14.
401 See L<perlguts/Autoloading with XSUBs>.
405 Perl now checks whether the array (the linearised isa) returned by a MRO
406 plugin begins with the name of the class itself, for which the array was
407 created, instead of assuming that it does. This prevents the first element
408 from being skipped during method lookup. It also means that
409 C<mro::get_linear_isa> may return an array with one more element than the
410 MRO plugin provided [perl #94306].
414 =head1 Selected Bug Fixes
420 In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes
421 it would erroneously fail (when C<$tainted> contained a string that occurs
422 in the array I<after> the first element) or erroneously succeed (when
423 C<undef> occurred after the first element) [perl #93590].
427 Perl 5.15.0 introduced a minor regression, in that an object referenced by
428 a deleted hash element would be able to access the freed element from its
429 DESTROY method, causing panic errors [perl #99660].
433 Functions in the CORE package can now be called as methods. That used to
434 work only when they had been called or referenced already. So
435 C<< "foo"->CORE::ucfirst >> returns Foo.
439 C<use> and C<require> are no longer affected by the I/O layers active in
440 the caller's scope (enabled by L<open.pm|open>) [perl #96008].
444 Errors that occur when methods cannot be found during overloading now
445 mention the correct package name, as they did in 5.8.x, instead of
446 erroneously mentioning the "overload" package, as they have since 5.10.0.
450 Undefining C<%overload::> no longer causes a crash.
454 C<our $::é; $é> (which is invalid) no longer produces the "Compilation
455 error at lib/utf8_heavy.pl..." error message, which it started emitting in
456 5.10.0 [perl #99984].
460 A minor regression, introduced Perl 5.15.0, has been fixed in which some
461 regular expression Unicode property matches (C<\p{...}>) matched
462 non-Unicode code points.
466 In case-insensitive regular expression pattern matching, no longer on
467 UTF-8 encoded strings does the scan for the start of match only look at
468 the first possible position. This caused matches such as
469 C<"f\x{FB00}" =~ /ff/i> to fail.
473 On 64-bit systems, C<read()> now understands large string offsets beyond
478 Errors that occur when processing subroutine attributes no longer cause the
479 subroutine's op tree to leak.
483 C<sort> now works once more with custom sort routines that are XSUBs. It
484 stopped working in 5.10.0.
488 C<sort> with a constant for a custom sort routine, although it produces
489 unsorted results, no longer crashes. It started crashing in 5.10.0.
493 Warnings produced when a custom sort routine returns a non-numeric value
494 now contain "in sort"; e.g., "Use of uninitialized value in sort".
498 C<< sort { $a <=> $b } >>, which is optimised internally, now produces
499 "uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >>
500 returns C<undef> for those. This brings it in line with
501 S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not
502 optimised [perl #94390].
506 C<..> and C<...> in list context now call FETCH only once on tied
507 arguments, instead of three or four times [perl #53554].
511 C<..> and C<...> in list context now mention the name of the variable in
512 "uninitialized" warnings for string (as opposed to numeric) ranges.
516 =head1 Acknowledgements
518 Perl 5.15.4 represents approximately 1 month of development since Perl 5.15.3
519 and contains approximately 31,000 lines of changes across 350 files from 23
522 Perl continues to flourish into its third decade thanks to a vibrant community
523 of users and developers. The following people are known to have contributed the
524 improvements that became Perl 5.15.4:
526 Alan Haggai Alavi, Brian Fraser, Chip Salzenberg, Chris 'BinGOs' Williams, Dave
527 Rolsky, David Golden, David Mitchell, Dennis Kaarsemaker, Eric Brine, Father
528 Chrysostomos, Florian Ragwitz, George Greer, Gerard Goossen, H.Merijn Brand,
529 Jim Cromie, John P. Linderman, Karl Williamson, Nicholas Clark, Reini Urban,
530 Steffen Müller, Stevan Little, Thorsten Glaser, Tony Cook.
532 The list above is almost certainly incomplete as it is automatically generated
533 from version control history. In particular, it does not include the names of
534 the (very much appreciated) contributors who reported issues to the Perl bug
537 Many of the changes included in this version originated in the CPAN modules
538 included in Perl's core. We're grateful to the entire CPAN community for
539 helping Perl to flourish.
541 For a more complete list of all of Perl's historical contributors, please see
542 the F<AUTHORS> file in the Perl source distribution.
544 =head1 Reporting Bugs
546 If you find what you think is a bug, you might check the articles
547 recently posted to the comp.lang.perl.misc newsgroup and the perl
548 bug database at http://rt.perl.org/perlbug/ . There may also be
549 information at http://www.perl.org/ , the Perl Home Page.
551 If you believe you have an unreported bug, please run the L<perlbug>
552 program included with your release. Be sure to trim your bug down
553 to a tiny but sufficient test case. Your bug report, along with the
554 output of C<perl -V>, will be sent off to perlbug@perl.org to be
555 analysed by the Perl porting team.
557 If the bug you are reporting has security implications, which make it
558 inappropriate to send to a publicly archived mailing list, then please send
559 it to perl5-security-report@perl.org. This points to a closed subscription
560 unarchived mailing list, which includes
561 all the core committers, who will be able
562 to help assess the impact of issues, figure out a resolution, and help
563 co-ordinate the release of patches to mitigate or fix the problem across all
564 platforms on which Perl is supported. Please only use this address for
565 security issues in the Perl core, not for modules independently
570 The F<Changes> file for an explanation of how to view exhaustive details
573 The F<INSTALL> file for how to build Perl.
575 The F<README> file for general stuff.
577 The F<Artistic> and F<Copying> files for copyright information.