Max Maischein > perl-5.15.8 > perl5160delta


Annotate this POD


Source   Latest Release: perl-5.15.9


perl5160delta - what is new for perl v5.16.0


This document describes differences between the 5.14.0 release and the 5.16.0 release.

If you are upgrading from an earlier release such as 5.12.0, first read perl5140delta, which describes differences between 5.12.0 and 5.14.0.

Notice ^

XXX Any important notices here

Core Enhancements ^

use charnames no longer needed for \N{name}

The charnames module is now automatically loaded when needed as if the :full and :short options had been specified. See charnames.

Improved performance for Unicode properties in regular expressions

Matching a code point against a Unicode property is now done via a binary search instead of linear. This means for example that the worst case for a 1000 item property is 10 probes instead of 1000. This inefficiency has been compensated for in the past by permanently storing in a hash the results of a given probe plus the results for the adjacent 64 code points, under the theory that near-by code points are likely to be searched for. A separate hash was used for each mention of a Unicode property in each regular expression. Thus, qr/\p{foo}abc\p{foo}/ would generate two hashes. Any probes in one instance would be unknown to the other, and the hashes could expand separately to be quite large if the regular expression were used on many different widely-separated code points. This can lead to running out of memory in extreme cases. Now, however, there is just one hash shared by all instances of a given property. This means that if \p{foo} is matched against "A" in one regular expression in a thread, the result will be known immediately to all regular expressions, and the relentless march of using up memory is slowed considerably.


The XS-callable function is_utf8_char(), when presented with malformed UTF-8 input, can read up to 12 bytes beyond the end of the string. This cannot be fixed without changing its API. It is not called from CPAN. The documentation now describes how to use it safely.

Other is_utf8_foo() functions, as well as utf8_to_foo(), etc.

Most of the other XS-callable functions that take UTF-8 encoded input implicitly assume that the UTF-8 is valid (not malformed) in regards to buffer length. Do not do things such as change a character's case or see if it is alphanumeric without first being sure that it is valid UTF-8. This can be safely done for a whole string by using one of the functions is_utf8_string(), is_utf8_string_loc(), and is_utf8_string_loclen().


As of this release, version declarations like use v5.16 now disable all features before enabling the new feature bundle. This means that the following holds true:

    use 5.016;
    # 5.16 features enabled here
    use 5.014;
    # 5.16 features disabled here

use v5.12 and higher continue to enable strict, but explicit use strict and no strict now override the version declaration, even when they come first:

    no strict;
    use 5.012;
    # no strict here

There is a new ":default" feature bundle that represents the set of features enabled before any version declaration or use feature has been seen. Version declarations below 5.10 now enable the ":default" feature set. This does not actually change the behaviour of use v5.8, because features added to the ":default" set are those that were traditionally enabled by default, before they could be turned off.

$[ is now disabled under use v5.16. It is part of the default feature set and can be turned on or off explicitly with use feature 'array_base'.


The change to UNIVERSAL::VERSION in 5.15.2 has been reverted. It now returns a stringified version object once more.

substr lvalue revamp

When substr is called in lvalue or potential lvalue context with two or three arguments, a special lvalue scalar is returned that modifies the original string (the first argument) when assigned to.

Previously, the offsets (the second and third arguments) passed to substr would be converted immediately to match the string, negative offsets being translated to positive and offsets beyond the end of the string being truncated.

Now, the offsets are recorded without modification in the special lvalue scalar that is returned, and the original string is not even looked at by substr itself, but only when the returned lvalue is read or modified.

These changes result in several incompatible changes and bug fixes:

It was impossible to fix all the bugs without an incompatible change, and the behaviour of negative offsets was never specified, so the change was deemed acceptable.

Return value of eval

eval returns undef in scalar context or an empty list in list context when there is a run-time error. When eval was passed a string in list context and a syntax error occurred, it used to return a list containing a single undefined element. Now it returns an empty list in list context for all errors [perl #80630].

Anonymous handles

Automatically generated file handles are now named __ANONIO__ when the variable name cannot be determined, rather than $__ANONIO__.

Last-accessed filehandle

Perl has an internal variable that stores the last filehandle to be accessed. It is used by $. and by tell and eof without arguments.

It used to be possible to set this internal variable to a glob copy and then modify that glob copy to be something other than a glob, and still have the last-accessed filehandle associated with the variable after assigning a glob to it again:

    my $foo = *STDOUT;  # $foo is a glob copy
    <$foo>;             # $foo is now the last-accessed handle
    $foo = 3;           # no longer a glob
    $foo = *STDERR;     # still the last-accessed handle

Now the $foo = 3 assignment unsets that internal variable, so there is no last-accessed filehandle, just as if <$foo> had never happened.


The new __SUB__ token, available under the "current_sub" feature (see feature) or use v5.15, returns a reference to the current subroutine, making it easier to write recursive closures.

New option for the debugger's t command

The t command in the debugger, which toggles tracing mode, now accepts a numeric argument that determines how many levels of subroutine calls to trace.

Return value of tied

The value returned by tied on a tied variable is now the actual scalar that holds the object to which the variable is tied. This allows ties to be weakened with Scalar::Util::weaken(tied $tied_variable).

More consistent eval

The eval operator sometimes treats a string argument as a sequence of characters and sometimes as a sequence of bytes, depending on the internal encoding. The internal encoding is not supposed to make any difference, but there is code that relies on this inconsistency.

Under use v5.15 and higher, the unicode_eval and evalbytes features resolve this. The unicode_eval feature causes eval $string to treat the string always as Unicode. The evalbytes features provides a function, itself called evalbytes, which evaluates its argument always as a string of bytes.

These features also fix oddities with source filters leaking to outer dynamic scopes.

See feature for more detail.

$^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:

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:

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:


Performance Enhancements ^

CORE:: works on all keywords

The CORE:: prefix can now be used on keywords enabled by, even outside the scope of use feature. Relevant documentation files CORE, feature, perlfunc, perlsub, and perlsyn have been updated.

Perl 5.15.2 introduced subroutines in the CORE namespace. Most of them could only be called as barewords; i.e., they could be aliased at compile time and then inlined under new names.

Almost all of these functions can now be called through references and via &foo() syntax, bypassing the prototype. See CORE for a list of the exceptions.

continue no longer requires the "switch" feature

The continue keyword has two meanings. It can introduce a continue block after a loop, or it can exit the current when block. Up till now, the latter meaning was only valid with the "switch" feature enabled, and was a syntax error otherwise. Since the main purpose of is to avoid conflicts with user-defined subroutines, there is no reason for continue to depend on it.

New debugger commands

The debugger now has disable and enable commands for disabling existing breakpoints and reënabling them. See perldebug.

$$ can be assigned to

$$ was made read-only in Perl 5.8.0. But only sometimes: local $$ would make it writable again. Some CPAN modules were using local $$ or XS code to bypass the read-only check, so there is no reason to keep $$ read-only. (This change also allowed a bug to be fixed while maintaining backward compatibility.)

Features inside the debugger

The current Perl's feature bundle is now enabled for commands entered in the interactive debugger.

\N{...} can now have Unicode loose name matching

This is described in the charnames item in "Updated Modules and Pragmata" below.

Breakpoints with file names

The debugger's "b" command for setting breakpoints now allows a line number to be prefixed with a file name. See "b [file]:[line] [condition]" in perldebug.

splice() doesn't warn when truncating

You can now limit the size of an array using splice(@a,MAX_LEN) without worrying about warnings.

The \$ prototype accepts any scalar lvalue

The \$ and \[$] subroutine prototypes now accept any scalar lvalue argument. Previously they only accepted scalars beginning with $ and hash and array elements. This change makes them consistent with the way the built-in read and recv functions (among others) parse their arguments. This means that one can override the built-in functions with custom subroutines that parse their arguments the same way.

You can now study more than one string

The restriction that you can only have one study active at a time has been removed. You can now usefully study as many strings as you want (until you exhaust memory).

The Unicode Script_Extensions property is now supported.

New in Unicode 6.0, this is an improved Script property. Details are in "Scripts" in perlunicode.

DTrace probes for interpreter phase change

The phase-change probes will fire when the interpreter's phase changes, which tracks the ${^GLOBAL_PHASE} variable. arg0 is the new phase name; arg1 is the old one. This is useful mostly for limiting your instrumentation to one or more of: compile time, run time, destruct time.

New Pad API

Many new functions have been added to the API for manipulating lexical pads. See "Pad Data Structures" in perlapi for more information.

Subroutines in the CORE namespace

Many Perl keywords are now available as subroutines in the CORE namespace. Most of these cannot be called through references or via &foo syntax yet, but must be called as barewords. In other words, you can now do this:

    BEGIN { *entangle = \&CORE::tie }
    entangle $variable, $package, @args;

This currently works for overridable keywords other than dump and the infix operators. Calling through references only works for functions that take no arguments (like wantarray).

Work is under way to allow more of these subroutines to be called through references.

__FILE__() Syntax

The __FILE__, __LINE__ and __PACKAGE__ tokens can now be written with an empty pair of parentheses after them. This makes them parse the same way as time, fork and other built-in functions.

Security ^

Privileges are now set correctly when assigning to $(

A hypothetical bug (probably non-exploitable in practice) due to the incorrect setting of the effective group ID while setting $( has been fixed. The bug would only have affected systems that have setresgid() but not setregid(), but no such systems are known of.

File::Glob::bsd_glob() memory error with GLOB_ALTDIRFUNC (CVE-2011-2728).

Calling File::Glob::bsd_glob with the unsupported flag GLOB_ALTDIRFUNC would cause an access violation / segfault. A Perl program that accepts a flags value from an external source could expose itself to denial of service or arbitrary code execution attacks. There are no known exploits in the wild. The problem has been corrected by explicitly disabling all unsupported flags and setting unused function pointers to null. Bug reported by Clément Lecigne.

Incompatible Changes ^

Certain deprecated Unicode properties are no longer supported by default

Perl should never have exposed certain Unicode properties that are used by Unicode internally and not meant to be publicly available. Use of these has generated deprecated warning messages since Perl 5.12. The removed properties are Other_Alphabetic, Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend, Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and Other_Uppercase.

Perl may be recompiled to include any or all of them; instructions are given in "Unicode character properties that are NOT accepted by Perl" in perluniprops.

Dereferencing IO thingies as typeglobs

The *{...} operator, when passed a reference to an IO thingy (as in *{*STDIN{IO}}), creates a new typeglob containing just that IO object.

Previously, it would stringify as an empty string, but some operators would treat it as undefined, producing an "uninitialized" warning.

Having a typeglob appear as an empty string is a side effect of the implementation that has caused various bugs over the years.

The solution was to make it stringify like a normal anonymous typeglob, like those produced by open($foo->{bar}, ...) [perl #96326].

User-defined case changing operations.

This feature was deprecated in Perl 5.14, and has now been removed. The CPAN module Unicode::Casing provides better functionality without the drawbacks that this feature had, as are detailed in the 5.14 documentation:

XSUBs are now 'static'

XSUB C functions are now 'static', that is, they are not visible from outside the compilation unit. Users can use the new XS_EXTERNAL(name) and XS_INTERNAL(name) macros to pick the desired linking behaviour. The ordinary XS(name) declaration for XSUBs will continue to declare non-'static' XSUBs for compatibility, but the XS compiler, ExtUtils::ParseXS (xsubpp) will emit 'static' XSUBs by default. ExtUtils::ParseXS's behaviour can be reconfigured from XS using the EXPORT_XSUB_SYMBOLS keyword, see perlxs for details.

Borland compiler

All support for the Borland compiler has been dropped. The code had not worked for a long time anyway.

Weakening read-only references

Weakening read-only references is no longer permitted. It should never hove worked anyway, and in some cases could result in crashes.

Tying scalars that hold typeglobs

Attempting to tie a scalar after a typeglob was assigned to it would instead tie the handle in the typeglob's IO slot. This meant that it was impossible to tie the scalar itself. Similar problems affected tied and untie: tied $scalar would return false on a tied scalar if the last thing returned was a typeglob, and untie $scalar on such a tied scalar would do nothing.

We fixed this problem before Perl 5.14.0, but it caused problems with some CPAN modules, so we put in a deprecation cycle instead.

Now the deprecation has been removed and this bug has been fixed. So tie $scalar will always tie the scalar, not the handle it holds. To tie the handle, use tie *$scalar (with an explicit asterisk). The same applies to tied *$scalar and untie *$scalar.

IPC::Open3 no longer provides xfork(), xclose_on_exec() and xpipe_anon()

All three functions were private, undocumented and unexported. They do not appear to be used by any code on CPAN. Two have been inlined and one deleted entirely.

$$ no longer caches PID

Previously, if one embeds Perl or uses XS and calls fork(3) from C, Perls notion of $$ could go out of sync with what getpid() returns. By always fetching the value of $$ via getpid(), this potential bug is eliminated. Code that depends on the caching behavior will break. As described in "Core Enhancements", $$ is now writable, but it will be reset during a fork.

Deprecations ^

Don't read the Unicode data base files in lib/unicore

It is now deprecated to directly read the Unicode data base files. These are stored in the lib/unicore directory. Instead, you should use the new functions in Unicode::UCD. These provide a stable API, and give complete information. (This API is, however, subject to change somewhat during the 5.15 development cycle, as we gain experience and get feedback from using it.)

Perl may at some point in the future change or remove the files. The file most likely for applications to have used is lib/unicore/ "prop_invmap()" in Unicode::UCD can be used to get at its data instead.

Future Deprecations ^

This section serves as a notice of feature that are likely to be deprecated in the next release of perl (5.18.0). If your code depends on these features, you should contact the Perl 5 Porters via the mailing list or perlbug to explain your use case and inform the deprecation process.

Core Modules

These modules may be marked as deprecated from the core. This only means that they will no longer be installed by default with the core distribution, but will remain available on the CPAN.

Pod::Parser, Pod::LaTeX
Platforms with no supporting programmers:

Other Future Deprecations

Swapping of $< and $>

sfio, stdio

Performance Enhancements ^

Modules and Pragmata ^

XXX All changes to installed files in cpan/, dist/, ext/ and lib/ go here. If Module::CoreList is updated, generate an initial draft of the following sections using Porting/, which prints stub entries to STDOUT. Results can be pasted in place of the '=head2' entries below. A paragraph summary for important changes should then be added by hand. In an ideal world, dual-life modules would have a Changes file that could be cribbed.

[ Within each section, list entries as a =item entry ]

Deprecated Modules


Version::Requirements is now DEPRECATED, use CPAN::Meta::Requirements, which is a drop-in replacement. It will be deleted from perl.git blead in v5.17.0.

New Modules and Pragmata

Updated Modules and Pragmata

Removed Modules and Pragmata

As promised in Perl 5.14.0's release notes, the following modules have been removed from the core distribution, and if needed should be installed from CPAN instead.

Documentation ^

New Documentation


This a new OO tutorial. It focuses on basic OO concepts, and then recommends that readers choose an OO framework from CPAN.


perldtrace describes Perl's DTrace support, listing the provided probes and gives examples of their use.


This document is intended to provide a list of experimental features in Perl. It is still a work in progress.

Changes to Existing Documentation


perlop and perlsyn

"Laundering and Detecting Tainted Data" in perlsec

perlfunc, open















Removed Documentation

Old OO Documentation

All the old OO tutorials, perltoot, perltooc, and perlboot, have been removed. The perlbot (bag of object tricks) document has been removed as well.

Development Deltas

The old perldelta files for development cycles prior to 5.15 have been removed.

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.

XXX New or changed warnings emitted by the core's C code go here. Also include any changes in perldiag that reconcile it to the C code.

[ Within each section, list entries as a =item entry that links to perldiag, e.g.

  =item *

  L<Invalid version object|perldiag/"Invalid version object">

New Diagnostics

XXX Newly added diagnostic messages go here

New Errors

New Warnings

Removed Warnings

Changes to Existing Diagnostics

Utility Changes ^




Configuration and Compilation ^

Testing ^

XXX Any significant changes to the testing of a freshly built perl should be listed here. Changes which create new files in t/ go here as do any large changes to the testing harness (e.g. when parallel testing was added). Changes to existing files in t/ aren't worth summarising, although the bugs that they represent may be covered elsewhere.

[ List each test improvement as a =item entry ]

Platform Support ^

XXX Any changes to platform support should be listed in the sections below.

[ Within the sections, list each platform as a =item entry with specific changes as paragraphs below it. ]

New Platforms

XXX List any platforms that this version of perl compiles on, that previous versions did not. These will either be enabled by new files in the hints/ directories, or new subdirectories and README files at the top level of the source tree.



Discontinued Platforms

XXX List any platforms that this version of perl no longer compiles on.



Platform-Specific Notes



Numerous build and test failures on GNU/Hurd have been resolved with hints for building DBM modules, detection of the library search path, and enabling of large file support.


Perl is now built with dynamic linking on OpenVOS, the minimum supported version of which is now Release 17.1.0.


The CC workshop C++ compiler is now detected and used on systems that ship without cc.

Internal Changes ^

Selected Bug Fixes ^

Regular expressions and character classes


Copy-on-write scalars

Copy-on-write scalars were introduced in 5.8.0, but most Perl code did not encounter them (they were used mostly internally). Perl 5.10.0 extended them, such that assigning __PACKAGE__ or a hash key to a scalar would make it copy-on-write. Several parts of Perl were not updated to account for them, but have now been fixed.

lvalue subroutines

There have been various fixes to lvalue subroutines.

Fixes related to hashes

Other notable fixes

Known Problems ^

Obituary ^

XXX If any significant core contributor has died, we've added a short obituary here.

Acknowledgements ^

XXX Generate this with:

  perl Porting/ v5.15.8..HEAD

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 . There may also be information at , 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 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 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.


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.

syntax highlighting: