
perldelta - what is new for perl v5.15.0

This document describes differences between the 5.15.0 release and the 5.14.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.
Some of the changes have been included in Perl 5.14.1. These are indicated with a "(5.14.1)" marker.

CORE:: works on all keywordsThe CORE:: prefix can now be used on keywords enabled by feature.pm,
even outside the scope of use feature.
Relevant documentation files CORE,
feature,
perlfunc,
perlsub,
and perlsyn have been updated.
continue no longer requires the "switch" featureThe 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 feature.pm is to avoid conflicts with user-defined subroutines,
there is no reason for continue to depend on it.
$$ 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.)
The current Perl's feature bundle is now enabled for commands entered in the interactive debugger.
\N{...} can now have Unicode loose name matchingThis is described in the charnames item in "Updated Modules and Pragmata" below.
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.

No changes since 5.14.0.

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.
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 PIDPreviously,
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.

There have been no deprecations since 5.14.0.

There are no benchmarked enhancements since 5.14.0.

None.
charnames can now be invoked with a new option,
:loose,
which is like the existing :full option,
but enables Unicode loose name matching.
Details are in "LOOSE MATCHES" in charnames.
Includes a fix for FreeBSD to only use unzip if it is located in /usr/local/bin,
as FreeBSD 9.0 will ship with a limited unzip in /usr/bin.
It addresses two regressions in Perl 5.14.0:
glob operator and its diamond (<>) form now works again [perl #90898] (5.14.1).:::: or :::::: no longer causes B::Deparse to hang (5.14.1).Plus a few other bugs:
keys,
each and value with a scalar argument now works [perl #91008].readpipe followed by a complex expression (as opposed to a simple scalar variable) now works.CORE:: in front of overridable core keywords if they conflict with user-defined subroutines.$obj->$method = ...) used not to work [perl #62498].The DELETE HTTP verb is now supported.
Now understands specifying modules to install in the format 'Module/Type.pm'
Warnings are now in sync with perl's
No longer loads MIME::Base64 as this was unnecessary.
Its fill_mstats function no longer refuses to write to copy-on-write scalars.
Missing aliases added, a deep recursion error fixed and various documentation updates.
The new version appends CFLAGS and LDFLAGS to their Config.pm counterparts.
decrypt fixed to work with v5.14.0
It no longer returns a wrong result if a script of the same name as the current one exists in the path and is executable.
Fixed incr_parse decoding string more correctly.
Fix broken URLs for RFCs.
open3 on Windows when *STDIN,
*STDOUT or *STDERR had been localized.The numify method has been corrected to return a normalised Perl number (the result of 0 + $thing),
instead of a string [rt.cpan.org #66732].
It provides a new bsgn method that complements the babs method.
It fixes the internal objectify function's handling of "foreign objects" so they are converted to the appropriate class (Math::BigInt or Math::BigFloat).
Fixes include: correct copy constructor usage; fix polarwise formatting with numeric format specifier; and more stable great_circle_direction algorithm.
Updated for v5.12.4, v5.14.1 and v5.15.0
Eliminated use of exists on array elements which has been deprecated.
The XS code is now compiled with PERL_NO_GET_CONTEXT,
which will aid performance under ithreads.
It fixes a problem with open my $fh,
">",
\$scalar not working if $scalar is a copy-on-write scalar.
It also fixes a hang that occurs with readline or <$fh> if a typeglob has been assigned to $scalar [perl #92258].
It corrects the search paths on VMS [perl #90640]. (5.14.1)
It no longer turns copy-on-write scalars into read-only scalars when freezing and thawing.
Large number of Request Tickets resolved.
Portability fix, and avoiding some compiler warnings.
Updated to CLDR 1.9.1
Fixes for the removal of unicore/CompositionExclusions.txt from core.
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.
Devel::DProf has been removed from the Perl core.
Prior version was 20110228.00.Shell has been removed from the Perl core.
Prior version was 0.72_01.
None.
kill on forked process.use now includes a pointer to if.pm (5.14.1)given,
when and default are now listed in perlfunc (5.14.1).select function no longer use strings for file handles.push $scalar syntax introduced in Perl 5.14.0 (5.14.1).m//g have been added (5.14.1).<<\FOO here-doc syntax has been documented (5.14.1).(*COMMIT) directive is now listed in the right section (Verbs without an argument).undef,
which is not the case.
It was also unclear as to whether system calls set C's errno or Perl's $! [perl #91614].WIFEXITED,
WEXITSTATUS,
WIFSIGNALED,
WTERMSIG,
WIFSTOPPED,
and WSTOPSIG has been corrected (5.14.1).
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.
Assigning to a temporary returned from an XS lvalue subroutine now produces a warning [perl #31946].
None.

None.

USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC} have been added the output of perl -V as they have affect the behaviour of the interpreter binary (albeit only in a small area).IPC::Open2::open2() is implemented as a thin wrapper around IPC::Open3::_open3(),
and hence is very tightly coupled to it.PL_vtbl_bm and PL_vtbl_fm are now defined by the pre-processor as PL_vtbl_regexp,
instead of being distinct C variables.
PL_vtbl_sig has been removed.-DPERL_GLOBAL_STRUCT works again.
This configuration is not generally used.MADPROP structures when OPs are freed.
MADPROPs are now allocated with PerlMemShared_malloc()
There have been no significant changes to the process for testing a newly-built perl.
See the source code commit history for changes to individual test files.

None.
None.

mg_ptr of their PERL_MAGIC_fm.
Previously it was stored in the string buffer,
beyond SvLEN(),
the regular end of the string.
SvCOMPILED() and SvCOMPILED_{on,off}() now exist solely for compatibility for XS code.
The first is always 0,
the other two now no-ops.
(5.14.1)const,
members in the interpreter structure have been re-ordered,
and the opcodes have been re-ordered.
The op OP_AELEMFAST has been split into OP_AELEMFAST and OP_AELEMFAST_LEX.delete $h{$_} for keys %h.PERL_MAGIC_bm.
Previously they were PVGVs,
with the tables stored in the string buffer,
beyond SvLEN().
This eliminates the last place where the core stores data beyond SvLEN().Perl_sv_magic() introduces a small change of behaviour for error cases involving unknown magic types.
Previously,
if Perl_sv_magic() was passed a magic type unknown to it,
it would
Now it will always croak "Don't know how to handle magic of type \\%o", even on read only values, or SVs which already have the unknown magic type.

/a when repeated like /aa forbids the characters outside the ASCII range that match characters inside that range from matching under /i.
This did not work under some circumstances,
all involving alternation,
such as:
"\N{KELVIN SIGN}" =~ /k|foo/iaa;
succeeded inappropriately. This is now fixed.
[\w\s], which have now been fixed (5.14.1)/i in bracketed character classes that have characters with multi-character folds, and the target string to match against includes the first portion of the fold, followed by another character that has a multi-character fold that begins with the remaining portion of the fold, plus some more.
"s\N{U+DF}" =~ /[\x{DF}foo]/i
is one such case. \xDF folds to "ss". (5.14.1)
/i. The affected characters are: COMBINING GREEK YPOGEGRAMMENI, GREEK CAPITAL LETTER IOTA, GREEK CAPITAL LETTER UPSILON, GREEK PROSGEGRAMMENI, GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA, GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA, GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, LATIN SMALL LETTER LONG S, LATIN SMALL LIGATURE LONG S T, and LATIN SMALL LIGATURE ST.formline; in particular, where the format itself is potentially variable (such as with ties and overloading), and where the format and data differ in their encoding. In both these cases, it used to possible for the output to be corrupted [perl #91032].formline no longer converts its argument into a string in-place. So passing a reference to formline no longer destroys the reference [perl #79532].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.
utf8::decode had a nasty bug that would modify copy-on-write scalars' string buffers in place (i.e., skipping the copy). This could result in hashes having two elements with the same key [perl #91834].%hash = ()).There have been various fixes to lvalue subroutines.
Note: There are still some discrepancies between explicit and implicit return, which will hopefully be resolved soon. So the exact behaviour is not set in stone yet.
=) for the last statement and the arguments to return. Since lvalue subroutines are not always called in lvalue context, this restriction has been lifted.shift and delete and from other subroutines, but no longer does so [perl #71172].sub :lvalue {}) used to return @_ in list context. In fact, all subroutines used to, but regular subs were fixed in Perl 5.8.2. Now lvalue subroutines have been likewise fixed.($) prototype would cause an lvalue sub to copy its return value [perl #51408], and while(lvalue_sub() =~ m/.../g) { ... } would loop endlessly [perl #78680].for), an lvalue subroutine returning arrays or hashes used to bind the arrays (or hashes) to scalar variables--something that is not supposed to happen. This could result in "Bizarre copy of ARRAY" errors or print ignoring its arguments. It also made nonsensical code like @{\$_} "work". This was fixed in 5.14.0 if an array were the first thing returned from the subroutine (but not for $scalar, @array or hashes being returned). Now a more general fix has been applied [perl #23790]. sub :lvalue { $] } would not return $], but a copy of it.keys returned from an lvalue sub used not to work, but now it does.:lvalue attribute to an XSUB or to an aliased subroutine stub with sub foo :lvalue; syntax stopped working in Perl 5.12. This has been fixed.each) in void context used not to free it. The hash would continue to reference it until the next iteration. This has been fixed [perl #85026].index and formline no longer causes one or the other to fail [perl #89218]. (5.14.1)my ($x,@y) : blimp = (72,94)) stopped working in Perl 5.8.0. It has now been fixed.bless \$a[0]) or if a closure referenced a blessed variable (bless \my @a; sub foo { @a }).
Now there is an extra pass during global destruction to fire destructors on any objects that might be left after the usual passes that check for objects referenced by scalars [perl #36347].
This bug fix was added in Perl 5.13.9, but caused problems with some CPAN modules that were relying on the bug. Since it was so close to Perl 5.14.0, the fix was reverted in 5.13.10, to allow more time for the modules to adapt. Hopefully they will be fixed soon (see "Known Problems", below).
given was not calling set-magic on the implicit lexical $_ that it uses. This meant, for example, that pos would be remembered from one execution of the same given block to the next, even if the input were a different variable [perl #84526].POSIX::_SC_OPEN_MAX constant [perl #87740].study function could become confused if fed a string longer than 2**31 characters. Now it simply skips such strings.each(ARRAY) is now wrapped in defined(...), like each(HASH), inside a while condition [perl #90888].undef *_) would cause perl to crash. This has been fixed [perl #91880].MW PM, RI, and ST were previously unrecognized by \N{}, vianame(), and string_vianame().goto out of a tied handle method used to cause memory corruption or crashes. Now it produces an error message instead [perl #8611].delete, shift or splice, even if the result was referenced elsewhere. So \sub { delete $_[0] }->($x) would return a reference to $x. This has been fixed [perl #91844].
Gtk2 and Tk on some systems [perl #82542].tie cause test failures for the JS module.$$ cause test failures for the Event module.
Perl 5.15.0 represents approximatly five weeks of development since Perl 5.14.0 and contains approximately 54,000 lines of changes across 618 files from 57 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.0:
Alan Haggai Alavi, Bo Johansson, Bo Lindbergh, brian d foy, Chia-liang Kao, Chris 'BinGOs' Williams, Claudio Ramirez, Craig A. Berry, David Golden, David Leadbeater, David Mitchell, Dennis Kaarsemaker, Dominic Hargreaves, Eric Brine, Father Chrysostomos, Florian Ragwitz, George Greer, Gisle Aas, H.Merijn Brand, Hojung Yoon, Ian Goodacre, Jesse Vincent, Jim Cromie, Johan Vromans, John Hawkinson, John P. Linderman, Joshua ben Jore, Karl Williamson, Kevin J. Woolley, Leo Lapworth, Leon Brocard, Leon Timmermans, Louis Strous, Marcel Grünauer, Martin Hasch, Max Maischein, Michael Witten, Moritz Lenz, Nicholas Clark, Niko Tyni, Nuno Carvalho, Pau Amma, Peter John Acklam, Robin Barker, Salvador Fandiño, Samuel Thibault, Shawn M Moore, Shigeya Suzuki, Shlomi Fish, Sisyphus, Steffen Müller, Todd Rinaldo, Tom Christiansen, Tony Cook, Vladimir Timofeev, Zefram and Zsbán Ambrus.
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.

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.

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.