NAME
perl5154delta - what is new for perl v5.15.4
DESCRIPTION
This document describes differences between the 5.15.3 release and the 5.15.4 release.
If you are upgrading from an earlier release such as 5.15.3, first read perl5153delta, which describes differences between 5.15.3 and 5.15.4.
Core Enhancements
$^X converted to an absolute path on FreeBSD, OS X and Solaris
$^X
is now converted to an absolute path on OS X, FreeBSD (without needing /proc mounted) and Solaris 10 and 11. This augments the previous approach of using /proc on Linux, FreeBSD and NetBSD (in all cases, where mounted).
This makes relocatable perl installations more useful on these platforms. (See "Relocatable @INC" in INSTALL)
Unicode Symbol Names
Perl now has proper support for Unicode in symbol names. It used to be that *{$foo}
would ignore the internal UTF8 flag and use the bytes of the underlying representation to look up the symbol. That meant that *{"\x{100}"}
and *{"\xc4\x80"}
would return the same thing. All these parts of Perl have been fixed to account for Unicode:
Method names (including those passed to
use overload
)Typeglob names (including names of variables, subroutines and filehandles)
Package names
Constant subroutine names (not null-clean yet)
goto
Symbolic dereferencing
Second argument to
bless()
andtie()
Return value of
ref()
Package names returned by
caller()
Subroutine prototypes
Attributes
Various warnings and error messages that mention variable names or values, methods, etc.
In addition, a parsing bug has been fixed that prevented *{é}
from implicitly quoting the name, but instead interpreted it as *{+é}
, which would cause a strict violation.
*{"*a::b"}
automatically strips off the * if it is followed by an ASCII letter. That has been extended to all Unicode identifier characters.
$é
is now subject to "Used only once" warnings. It used to be exempt, as it was treated as a punctuation variable.
Also, single-character Unicode punctuation variables (like $‰) are now supported [perl #69032]. They are also supported with our
and my
, but that is a mistake that will be fixed before 5.16.
Support for Embedded Nulls
Some parts of Perl did not work correctly with nulls (chr 0
) embedded in strings. That meant that, for instance, $m = "a\0b"; foo->$m
would call the "a" method, instead of the actual method name contained in $m. These parts of perl have been fixed to support nulls:
Method names
Typeglob names (including filehandle names)
Package names
Autoloading
Return value of
ref()
Package names returned by
caller()
Filehandle warnings
Typeglob elements (
*foo{"THING\0stuff"}
)Signal names
Various warnings and error messages that mention variable names or values, methods, etc.
One side effect of these changes is that blessing into "\0" no longer causes ref()
to return false.
Autoloaded sort Subroutines
Custom sort subroutines can now be autoloaded [perl #30661]:
sub AUTOLOAD { ... }
@sorted = sort foo @list; # uses AUTOLOAD
Improved typemaps for Some Builtin Types
Most XS authors will be aware that there is a longstanding bug in the OUTPUT typemap for T_AVREF (AV*
), T_HVREF (HV*
), T_CVREF (CV*
), and T_SVREF (SVREF
or \$foo
) that requires manually decrementing the reference count of the return value instead of the typemap taking care of this. For backwards-compatibility, this cannot be changed in the default typemaps. But we now provide additional typemaps T_AVREF_REFCOUNT_FIXED
, etc. that do not exhibit this bug. Using them in your extension is as simple as having one line in your TYPEMAP
section:
HV* T_HVREF_REFCOUNT_FIXED
Performance Enhancements
substr
no longer calculates a value to return when called in void context.
Modules and Pragmata
Updated Modules and Pragmata
Archive::Tar has been upgraded from version 1.78 to version 1.80.
base has been upgraded from version 2.17 to version 2.18.
base
no longer sets a module's$VERSION
to "-1" when a module it loads does not define a$VERSION
. This change has been made because "-1" is not a valid version number under the new "lax" criteria used internally byUNIVERSAL::VERSION
. (See version for more on "lax" version criteria.)base
no longer internally skips loading modules it has already loaded and instead relies onrequire
to inspect%INC
. This fixes a bug whenbase
is used with code that clear%INC
to force a module to be reloaded.Digest has been upgraded from version 1.16 to version 1.17.
DynaLoader has been upgraded from version 1.13 to 1.14.
It stopped exporting its symbols with the ExtUtils::ParseXS changes in 5.15.2. Now it exports them once more.
ExtUtils::MakeMaker has been upgraded from version 6.59 to version 6.61_01.
ExtUtils::ParseXS has been upgraded from version 3.04_04 to version 3.05.
Module::CoreList has been upgraded from version 2.56 to 2.57.
Module::Load has been upgraded from version 0.20 to version 0.22.
Resolve possible security problem [http://goo.gl/YzHRU] where a '::' prefixed module can 'jump' out of @INC
perlfaq has been upgraded from version 5.0150034 to version 5.0150035.
Unicode::Collate has been upgraded from version 0.78 to version 0.80.
Locales updated to CLDR 2.0: ar, be, bg, ha, hr, kk, lt. Newly supported locales: as, fi__phonebook, gu, hi, kn, kok and ln.
Documentation
Changes to Existing Documentation
perlfunc, open
As an accident of history,
open $fh, "<:", ...
applies the default layers for the platform (:raw
on Unix,:crlf
on Windows), ignoring whatever is declared by open.pm. This seems such a useful feature it has been documented in perlfunc and open.
perlapi
The HV API has long accepted negative lengths to indicate that the key is in UTF8. Now this is documented.
The
boolSV()
macro is now documented.
perlguts
A new section, Autoloading with XSUBs, has been added, which explains the two APIs for accessing the name of the autoloaded sub.
Diagnostics
The following additions or changes have been made to diagnostic output, including warnings and fatal error messages. For the complete list of diagnostic messages, see perldiag.
Changes to Existing Diagnostics
The message, "Code point 0x%X is not Unicode, no properties match it; all inverse prop erties do" has been changed to "Code point 0x%X is not Unicode, all \p{} matches fail; all \P{} matches succeed"
Testing
t/porting/checkcfgvar.t now tests that all config.sh-style files are complete. These are used by the various non-*nix to generate their config.h, and an incomplete input file will generate invalid output.
Internal Changes
These new functions have been added as part of the work on Unicode symbols:
HvNAMELEN HvNAMEUTF8 HvENAMELEN HvENAMEUTF8 gv_init_pv gv_init_pvn gv_init_pvsv gv_fetchmeth_pv gv_fetchmeth_pvn gv_fetchmeth_sv gv_fetchmeth_pv_autoload gv_fetchmeth_pvn_autoload gv_fetchmeth_sv_autoload gv_fetchmethod_pv_flags gv_fetchmethod_pvn_flags gv_fetchmethod_sv_flags gv_autoload_pv gv_autoload_pvn gv_autoload_sv newGVgen_flags sv_derived_from_pv sv_derived_from_pvn sv_derived_from_sv sv_does_pv sv_does_pvn sv_does_sv whichsig_pv whichsig_pvn whichsig_sv newCONSTSUB_flags
The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are experimental and may change in a future release.
The following functions were added. These are not part of the API:
GvNAMEUTF8 GvENAMELEN GvENAME_HEK CopSTASH_flags CopSTASH_flags_set PmopSTASH_flags PmopSTASH_flags_set sv_sethek HEKfARG
There is also a
HEKf
macro corresponding toSVf
, for interpolating HEKs in formatted strings.sv_catpvn_flags
takes a couple of new internal-only flags,SV_CATBYTES
andSV_CATUTF8
, which tell it whether the char array to be concatenated is UTF8. This allows for more efficient concatenation than creating temporary SVs to pass tosv_catsv
.For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. This is in addition to setting
SvPVX(cv)
, for compatibility with 5.8 to 5.14. See "Autoloading with XSUBs" in perlguts.Perl now checks whether the array (the linearised isa) returned by a MRO plugin begins with the name of the class itself, for which the array was created, instead of assuming that it does. This prevents the first element from being skipped during method lookup. It also means that
mro::get_linear_isa
may return an array with one more element than the MRO plugin provided [perl #94306].
Selected Bug Fixes
In Perl 5.14.0,
$tainted ~~ @array
stopped working properly. Sometimes it would erroneously fail (when$tainted
contained a string that occurs in the array after the first element) or erroneously succeed (whenundef
occurred after the first element) [perl #93590].Perl 5.15.0 introduced a minor regression, in that an object referenced by a deleted hash element would be able to access the freed element from its DESTROY method, causing panic errors [perl #99660].
Functions in the CORE package can now be called as methods. That used to work only when they had been called or referenced already. So
"foo"->CORE::ucfirst
returns Foo.use
andrequire
are no longer affected by the I/O layers active in the caller's scope (enabled by open.pm) [perl #96008].Errors that occur when methods cannot be found during overloading now mention the correct package name, as they did in 5.8.x, instead of erroneously mentioning the "overload" package, as they have since 5.10.0.
Undefining
%overload::
no longer causes a crash.our $::é; $é
(which is invalid) no longer produces the "Compilation error at lib/utf8_heavy.pl..." error message, which it started emitting in 5.10.0 [perl #99984].A minor regression, introduced Perl 5.15.0, has been fixed in which some regular expression Unicode property matches (
\p{...}
) matched non-Unicode code points.In case-insensitive regular expression pattern matching, no longer on UTF-8 encoded strings does the scan for the start of match only look at the first possible position. This caused matches such as
"f\x{FB00}" =~ /ff/i
to fail.On 64-bit systems,
read()
now understands large string offsets beyond the 32-bit range.Errors that occur when processing subroutine attributes no longer cause the subroutine's op tree to leak.
sort
now works once more with custom sort routines that are XSUBs. It stopped working in 5.10.0.sort
with a constant for a custom sort routine, although it produces unsorted results, no longer crashes. It started crashing in 5.10.0.Warnings produced when a custom sort routine returns a non-numeric value now contain "in sort"; e.g., "Use of uninitialized value in sort".
sort { $a <=> $b }
, which is optimised internally, now produces "uninitialized" warnings for NaNs (not-a-number values), since<=>
returnsundef
for those. This brings it in line withsort { 1; $a <=> $b }
and other more complex cases, which are not optimised [perl #94390]...
and...
in list context now call FETCH only once on tied arguments, instead of three or four times [perl #53554]...
and...
in list context now mention the name of the variable in "uninitialized" warnings for string (as opposed to numeric) ranges.
Acknowledgements
Perl 5.15.4 represents approximately 1 month of development since Perl 5.15.3 and contains approximately 31,000 lines of changes across 350 files from 23 authors.
Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.15.4:
Alan Haggai Alavi, Brian Fraser, Chip Salzenberg, Chris 'BinGOs' Williams, Dave Rolsky, David Golden, David Mitchell, Dennis Kaarsemaker, Eric Brine, Father Chrysostomos, Florian Ragwitz, George Greer, Gerard Goossen, H.Merijn Brand, Jim Cromie, John P. Linderman, Karl Williamson, Nicholas Clark, Reini Urban, Steffen Müller, Stevan Little, Thorsten Glaser, Tony Cook.
The list above is almost certainly incomplete as it is automatically generated from version control history. In particular, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker.
Many of the changes included in this version originated in the CPAN modules included in Perl's core. We're grateful to the entire CPAN community for helping Perl to flourish.
For a more complete list of all of Perl's historical contributors, please see the AUTHORS file in the Perl source distribution.
Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who will be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
SEE ALSO
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.