NAME
perl5160delta - what is new for perl v5.16.0
DESCRIPTION
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.
is_utf8_char()
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()
.
use VERSION
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'
.
UNIVERSAL::VERSION
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:
If the original string changes length after the call to
substr
but before assignment to its return value, negative offsets will remember their position from the end of the string, affecting code like this:my $string = "string"; my $lvalue = \substr $string, -4, 2; print $lvalue, "\n"; # prints "ri" $string = "bailing twine"; print $lvalue, "\n"; # prints "wi"; used to print "il"
The same thing happens with an omitted third argument. The returned lvalue will always extend to the end of the string, even if the string becomes longer.
Tied (and otherwise magical) variables are no longer exempt from the "Attempt to use reference as lvalue in substr" warning.
That warning now occurs when the returned lvalue is assigned to, not when
substr
itself is called. This only makes a difference if the return value ofsubstr
is referenced and assigned to later.The order in which "uninitialized" warnings occur for arguments to
substr
has changed.Passing a substring of a read-only value or a typeglob to a function (potential lvalue context) no longer causes an immediate "Can't coerce" or "Modification of a read-only value" error. That error only occurs if and when the value passed is assigned to.
The same thing happens with the "substr outside of string" error. If the lvalue is only read, not written to, it is now just a warning, as with rvalue
substr
.substr
assignments no longer call FETCH twice if the first argument is a tied variable, just once.
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.
__SUB__
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:
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
Version declarations with the
use
keyword (e.g.,use 5.012
) are now faster, as they enable features without loading feature.pm.local $_
is faster now, as it no longer iterates through magic that it is not going to copy anyway.Perl 5.12.0 sped up the destruction of objects whose classes define empty
DESTROY
methods (to prevent autoloading), by simply not calling such empty methods. This release takes this optimisation a step further, by not calling anyDESTROY
method that begins with areturn
statement. This can be useful for destructors that are only used for debugging:use constant DEBUG => 1; sub DESTROY { return unless DEBUG; ... }
Constant-folding will reduce the first statement to
return;
if DEBUG is set to 0, triggering this optimisation.Assigning to a variable that holds a typeglob or copy-on-write scalar is now much faster. Previously the typeglob would be stringified or the copy-on-write scalar would be copied before being clobbered.
Assignment to
substr
in void context is now more than twice its previous speed. Instead of creating and returning a special lvalue scalar that is then assigned to,substr
modifies the original string itself.substr
no longer calculates a value to return when called in void context.
CORE::
works on all keywords
The 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.
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 feature.pm 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: http://perldoc.perl.org/5.14.0/perlunicode.html#User-Defined-Case-Mappings-%28for-serious-hackers-only%29
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/ToDigit.pl. "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.
Other Future Deprecations
Performance Enhancements
Due to changes in File::Glob, Perl's
glob
function and its<...>
equivalent are now much faster. The splitting of the pattern into words has been rewritten in C, resulting in speed-ups of 20% in some cases.This does not affect VMS, as it does not use File::Glob.
The short-circuiting operators
&&
,||
, and//
, when chained (such as$a || $b || $c
), are now considerably faster to short-circuit, due to reduced optree traversal.The implementation of
s///r
makes one fewer copy of the scalar's value.If a studied scalar is
split
with a regex, the engine will now take advantage of thestudy
data.study
now uses considerably less memory for shorter strings. Strings shorter than 65535 characters use roughly half the memory than previously, strings shorter than 255 characters use roughly one quarter of the memory.Recursive calls to lvalue subroutines in lvalue scalar context use less memory.
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/corelist-perldelta.pl, 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
-
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
arybase -- this new module implements the
$[
variable.
Updated Modules and Pragmata
XXX has been upgraded from version 0.69 to version 0.70.
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.
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.
Documentation
New Documentation
perlootut
This a new OO tutorial. It focuses on basic OO concepts, and then recommends that readers choose an OO framework from CPAN.
perldtrace
perldtrace describes Perl's DTrace support, listing the provided probes and gives examples of their use.
perlexperiment
This document is intended to provide a list of experimental features in Perl. It is still a work in progress.
Changes to Existing Documentation
perlfunc
dbmopen
treats a 0 mode as a special case, that prevents a nonexistent file from being created. This has been the case since Perl 5.000, but was never documented anywhere. Now the perlfunc entry mentions it [perl #90064].The entry for
split
has been rewritten. It is now far clearer than before.
perlop and perlsyn
Documentation of the smartmatch operator has been reworked and moved from perlsyn to perlop where it belongs.
Documentation of the ellipsis statement (
...
) has been reworked and moved from perlop to perlsyn.
"Laundering and Detecting Tainted Data" in perlsec
The example function for checking for taintedness contained a subtle error.
$@
needs to be localized to prevent its changing this global's value outside the function. The preferred method to check for this remains "tainted" in Scalar::Util.
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.
perlobj
This document has been rewritten from scratch, and its coverage of various OO concepts has been expanded.
perlpragma
There is now a standard convention for naming keys in the
%^H
, documented under Key naming.
perlguts
Some of the function descriptions in perlguts were confusing, as it was not clear whether they referred to the function above or below the description. This has been clarified [perl #91790].
perllol
perllol has been expanded with examples using the new
push $scalar
syntax introduced in Perl 5.14.0 (5.14.1).
perlmod
perlmod now states explicitly that some types of explicit symbol table manipulation are not supported. This codifies what was effectively already the case [perl #78074].
perlop
The explanation of bitwise operators has been expanded to explain how they work on Unicode strings (5.14.1).
The section on the triple-dot or yada-yada operator has been moved up, as it used to separate two closely related sections about the comma operator (5.14.1).
More examples for
m//g
have been added (5.14.1).The
<<\FOO
here-doc syntax has been documented (5.14.1).
perlpodstyle
The tips on which formatting codes to use have been corrected and greatly expanded.
There are now a couple of example one-liners for previewing POD files after they have been edited.
perlsub
The "Lvalue subroutines" in perlsub section has been amended to reflect changes and bug fixes introduced in Perl 5.15.0.
The ($;) prototype syntax, which has existed for rather a long time, is now documented in perlsub. It allows a unary function to have the same precedence as a list operator.
perlre
The
(*COMMIT)
directive is now listed in the right section (Verbs without an argument).
perlrun
perlrun has undergone a significant clean-up. Most notably, the -0x... form of the -0 flag has been clarified, and the final section on environment variables has been corrected and expanded (5.14.1).
perltie
Documented the required syntax for tying handles.
perlvar
The documentation for $! has been corrected and clarified. It used to state that $! could be
undef
, which is not the case. It was also unclear as to whether system calls set C'serrno
or Perl's$!
[perl #91614].Documentation for $$ has been amended with additional cautions regarding changing the process ID.
perlxs was extended with documentation on inline typemaps.
perlref has a new Circular References section explaining how circularities may not be freed and how to solve that with weak references.
The documentation for smart match in perlsyn has been corrected for the case of
undef
on the left-hand side. The list of different smart match behaviours had an item in the wrong place.Parts of perlapi were clarified, and Perl equivalents of some C functions have been added as an additional mode of exposition.
A few parts of perlre and perlrecharclass were clarified.
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
-
This error occurs when
caller
tries to set@DB::args
but finds it tied. Before this error was added, it used to crash instead. -
This error is part of a safety check that the
tie
operator does before tying a special array like@_
. You should never see this message. Source filters apply only to byte streams
This new error occurs when you try to activate a source filter (usually by loading a source filter module) within a string passed to
eval
under theunicode_eval
feature.-
This previously removed error has been restored with the re-implementation of
$[
as a module. &CORE::%s cannot be called directly
(F) You tried to call a subroutine in the
CORE::
namespace with&foo
syntax or through a reference. The subroutines in this package cannot yet be called that way, but must be called as barewords. Something like this will work:BEGIN { *shove = \&CORE::push; } shove @array, 1,2,3; # pushes on to @array
New Warnings
-
The long-deprecated
defined(@array)
now also warns for package variables. Previously it only issued a warning for lexical variables. -
\E
does nothing unless preceded by\Q
,\L
or\U
. -
This warning, in the "overload" category, is produced when the overload pragma is given an argument it doesn't recognize, presumably a mistyped operator.
Useless assignment to a temporary
Assigning to a temporary returned from an XS lvalue subroutine now produces a warning [perl #31946].
-
This new warning occurs when
length
is used on an array or hash, instead ofscalar(@array)
orscalar(keys %hash)
. $[ used in %s (did you mean $] ?)
This new warning exists to catch the mistaken use of
$[
in version checks.$]
, not$[
, contains the version number.$[
in a numeric comparison is almost always wrong.Use of assignment to $[ is deprecated
This previously removed warning has been restored with the re-implementation of
$[
as a module.
Removed Warnings
"sort is now a reserved word"
This error used to occur when
sort
was called without arguments, followed by;
or)
. (E.g.,sort;
would die, but{sort}
was OK.) This error message was added in Perl 3 to catch code likeclose(sort)
which would no longer work. More than two decades later, this message is no longer appropriate. Nowsort
without arguments is always allowed, and returns an empty list, as it did in those cases where it was already allowed [perl #90030].
Changes to Existing Diagnostics
Redefinition warnings for constant subroutines used to be mandatory, even occurring under
no warnings
. Now they respect the warnings pragma.The "Attempt to free non-existent shared string" has had the spelling of "non-existent" corrected to "nonexistent". It was already listed with the correct spelling in perldiag.
The 'Use of "foo" without parentheses is ambiguous' warning has been extended to apply also to user-defined subroutines with a (;$) prototype, and not just to built-in functions.
The error messages for using
default
andwhen
outside of a topicalizer have been standardised to match the messages forcontinue
and loop controls. They now read 'Can't "default" outside a topicalizer' and 'Can't "when" outside a topicalizer'. They both used to be 'Can't use when() outside a topicalizer' [perl #91514].The uninitialized warning for
y///r
when$_
is implicit and undefined now mentions the variable name, just like the non-/r variation of the operator.The "Applying pattern match..." or similar warning produced when an array or hash is on the left-hand side of the
=~
operator now mentions the name of the variable.The Invalid version format error message now says "negative version number" within the parentheses, rather than "non-numeric data", for negative numbers.
The two warnings Possible attempt to put comments in qw() list and Possible attempt to separate words with commas are no longer mutually exclusive: the same
qw
construct may produce both.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"
Warnings that mention the names of lexical (
my
) variables with Unicode characters in them now respect the presence or absence of the:utf8
layer on the output handle, instead of outputting UTF8 regardless. Also, the correct names are included in the strings passed to$SIG{__WARN__}
handlers, rather than the raw UTF8 bytes.
XXX Describe change here
Utility Changes
zipdetails
zipdetails displays information about the internal record structure of the zip file. It is not concerned with displaying any details of the compressed data stored in the zip file.
h2ph
h2ph used to generate code of the form
unless(defined(&FOO)) { sub FOO () {42;} }
But the subroutine is a compile-time declaration, and is hence unaffected by the condition. It has now been corrected to emit a string
eval
around the subroutine [perl #99368].
splain
splain no longer emits backtraces with the first line number repeated. This:
Uncaught exception from user code: Cannot fwiddle the fwuddle at -e line 1. at -e line 1 main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1
has become this:
Uncaught exception from user code: Cannot fwiddle the fwuddle at -e line 1. main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1
Some error messages consist of multiple lines that are listed as separate entries in perldiag. splain has been taught to find the separate entries in these cases, instead of simply failing to find the message.
Configuration and Compilation
The -Dusesitecustomize and -Duserelocatableinc options now work together properly.
regexp.h has been modified for compatibility with GCC's -Werror option, as used by some projects that include perl's header files (5.14.1).
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).The code and tests for IPC::Open2 have been moved from ext/IPC-Open2 into ext/IPC-Open3, as
IPC::Open2::open2()
is implemented as a thin wrapper aroundIPC::Open3::_open3()
, and hence is very tightly coupled to it.The magic types and magic vtables are now generated from data in a new script regen/mg_vtable.pl, instead of being maintained by hand. As different EBCDIC variants can't agree on the code point for '~', the character to code point conversion is done at build time by generate_uudmap to a new generated header mg_data.h.
PL_vtbl_bm
andPL_vtbl_fm
are now defined by the pre-processor asPL_vtbl_regexp
, instead of being distinct C variables.PL_vtbl_sig
has been removed.Building with
-DPERL_GLOBAL_STRUCT
works again. This configuration is not generally used.Perl configured with MAD now correctly frees
MADPROP
structures when OPs are freed.MADPROP
s are now allocated withPerlMemShared_malloc()
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 ]
XXX
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
VMS
Remove unnecessary includes, fix miscellaneous compiler warnings and close some unclosed comments on vms/vms.c.
Remove sockadapt layer from the VMS build.
A link-time error on VMS versions without
symlink
support was introduced in 5.15.1, but has now been corrected.Explicit support for VMS versions prior to v7.0 and DEC C versions prior to v6.0 has been removed.
Since Perl 5.10.1, the home-grown
stat
wrapper has been unable to distinguish between a directory name containing an underscore and an otherwise-identical filename containing a dot in the same position (e.g., t/test_pl as a directory and t/test.pl as a file). This problem has been corrected.
GNU/Hurd
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.
OpenVOS
Perl is now built with dynamic linking on OpenVOS, the minimum supported version of which is now Release 17.1.0.
SunOS
The CC workshop C++ compiler is now detected and used on systems that ship without cc.
Internal Changes
There are now feature bundle hints in
PL_hints
($^H
) that version declarations use, to avoid having to load feature.pm. One setting of the hint bits indicates a "custom" feature bundle, which means that the entries in%^H
still apply. feature.pm uses that.The
HINT_FEATURE_MASK
macro is defined in perl.h along with other hints. Other macros for setting and testing features and bundles are in the new feature.h.FEATURE_IS_ENABLED
(which has moved to feature.h) is no longer used throughout the codebase, but more specific macros, e.g.,FEATURE_SAY_IS_ENABLED
, that are defined in feature.h.lib/feature.pm is now a generated file, created by the new regen/feature.pl script, which also generates feature.h.
Tied arrays are now always
AvREAL
. If@_
orDB::args
is tied, it is reified first, to make sure this is always the case.The
is_gv_magical_sv
function has been eliminated and merged withgv_fetchpvn_flags
. It used to be called to determine whether a GV should be autovivified in rvalue context. Now it has been replaced with a newGV_ADDMG
flag (not part of the API).Padlists are now marked
AvREAL
; i.e., reference-counted. They have always been reference-counted, but were not marked real, because pad.c did its own clean-up, instead of using the usual clean-up code in sv.c. That caused problems in thread cloning, so now theAvREAL
flag is on, but is turned off in pad.c right before the padlist is freed (after pad.c has done its custom freeing of the pads).All the C files that make up the Perl core have been converted to UTF-8.
Selected Bug Fixes
Regular expressions and character classes
The new (in 5.14.0) regular expression modifier
/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.
5.14.0 introduced some memory leaks in regular expression character classes such as
[\w\s]
, which have now been fixed (5.14.1)An edge case in regular expression matching could potentially loop. This happened only under
/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)A few characters in regular expression pattern matches did not match correctly in some circumstances, all involving
/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.Fixed memory leak regression in regular expression compilation under threading
Formats
A number of edge cases have been fixed with formats and
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 toformline
no longer destroys the reference [perl #79532].
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.
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].Lvalue subroutines were not allowing COW scalars to be returned. This was fixed for lvalue scalar context in Perl 5.12.3 and 5.14.0, but list context was not fixed until this release.
Elements of restricted hashes (see the fields pragma) containing copy-on-write values couldn't be deleted, nor could such hashes be cleared (
%hash = ()
).Localising a tied variable used to make it read-only if it contained a copy-on-write string.
Storable, Devel::Peek and PerlIO::scalar had similar problems. See "Updated Modules and Pragmata", above.
lvalue subroutines
There have been various fixes to lvalue subroutines.
Explicit return now returns the actual argument passed to return, instead of copying it [perl #72724] [perl #72706].
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.
Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on the left-hand side of
=
) for the last statement and the arguments to return. Since lvalue subroutines are not always called in lvalue context, this restriction has been lifted.Lvalue subroutines are less restrictive as to what values can be returned. It used to croak on values returned by
shift
anddelete
and from other subroutines, but no longer does so [perl #71172].Empty lvalue subroutines (
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.Lvalue subroutines used to copy their return values in rvalue context. Not only was this a waste of CPU cycles, but it also caused bugs. A
($)
prototype would cause an lvalue sub to copy its return value [perl #51408], andwhile(lvalue_sub() =~ m/.../g) { ... }
would loop endlessly [perl #78680].Autovivification now works on values returned from lvalue subroutines [perl #7946].
When called in pass-by-reference context (e.g., subroutine arguments or a list passed to
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 orprint
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].When called in pass-by-reference context, lvalue subroutines used to copy any read-only value that was returned. E.g.,
sub :lvalue { $] }
would not return$]
, but a copy of it.Assignment to
keys
returned from an lvalue sub used not to work, but now it does.Applying the
:lvalue
attribute to an XSUB or to an aliased subroutine stub withsub foo :lvalue;
syntax stopped working in Perl 5.12. This has been fixed.
Fixes related to hashes
A bug has been fixed that would cause a "Use of freed value in iteration" error if the next two hash elements that would be iterated over are deleted [perl #85026]. (5.14.1)
Freeing deeply nested hashes no longer crashes [perl #44225].
Deleting the current hash iterator (the hash element that would be returend by the next call to
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].
Other notable fixes
"b . COND" in the debugger has been fixed
Breaking on the current line with
b . COND
was broken by previous work and has now been fixed.Tying
%^H
Tying
%^H
no longer causes perl to crash or ignore the contents of%^H
when entering a compilation scope [perl #106282].~
on vstringsThe bitwise complement operator (and possibly other operators, too) when passed a vstring would leave vstring magic attached to the return value, even though the string had changed. This meant that
version->new(~v1.2.3)
would create a version looking like "v1.2.3" even though the string passed toversion->new
was actually "\376\375\374". This also caused B::Deparse to deparse~v1.2.3
incorrectly, without the~
[perl #29070].Vstrings blowing away magic
Assigning a vstring to a magic (e.g., tied,
$!
) variable and then assigning something else used to blow away all the magic. This meant that tied variables would come undone,$!
would stop getting updated on failed system calls,$|
would stop setting autoflush, and other mischief would take place. This has been fixed.newHVhv
and tied hashesThe
newHVhv
XS function now works on tied hashes, instead of crashing or returning an empty hash.Hashes will null elements
It is possible from XS code to create hashes with elements that have no values. Perl itself sometimes creates such hashes, but they are rarely visible to Perl code. The hash element and slice operators used to crash when handling these in lvalue context. These have been fixed. They now produce a "Modification of non-creatable hash value attempted" error message.
No warning for
open(foo::bar)
When one writes
open foo || die
, which used to work in Perl 4, a "Precedence problem" warning is produced. This warning used erroneously to apply to fully-qualified bareword handle names not followed by||
. This has been corrected.select
and package aliasingAfter package aliasing (
*foo:: = *bar::
),select
with 0 or 1 argument would sometimes return a name that could not be used to refer to the filehandle, or sometimes it would returnundef
even when a filehandle was selected. Now it returns a typeglob reference in such cases.PerlIO::get_layers
and tied variablesPerlIO::get_layers
no longer ignores FETCH on tied variables as it used to most of the time [perl #97956].PerlIO::get_layers
and numbersPerlIO::get_layers
no longer ignores some arguments that it thinks are numeric, while treating others as filehandle names. It is now consistent for flat scalars (i.e., not references).Lvalue subs and strict mode
Lvalue sub calls that are not determined to be such at compile time (
&$name
or &{"name"}) are no longer exempt from strict refs if they occur in the last statement of an lvalue subroutine [perl #102486].Non-lvalue sub calls in potentially lvalue context
Sub calls whose subs are not visible at compile time, if they occurred in the last statement of an lvalue subroutine, would reject non-lvalue subroutines and die with "Can't modify non-lvalue subroutine call" [perl #102486].
Non-lvalue sub calls whose subs are visible at compile time exhibited the opposite bug. If the call occurred in the last statement of an lvalue subroutine, there would be no error when the lvalue sub was called in lvalue context. Perl would blindly assign to the temporary value returned by the non-lvalue subroutine.
AUTOLOADing lvalue subs
AUTOLOAD
routines used to take precedence over the actual sub being called (i.e., when autoloading wasn't needed), for sub calls in lvalue or potential lvalue context, if the subroutine was not visible at compile time.caller
and tied@DB::args
caller
sets@DB::args
to the subroutine arguments when called from the DB package. It used to crash when doing so if@DB::args
happened to be tied. Now it croaks instead.Tying
@_
Under debugging builds, this code:
sub TIEARRAY{bless[]} sub { tie @_, ""; \@_; }->(1);
use to produce an "av_reify called on tied array" warning. It doesn't any more.
Unrecognised switches on
#!
lineIf a switch, such as -x, that cannot occur on the
#!
line is used there, perl dies with "Can't emulate...".It used to produce the same message for switches that perl did not recognise at all, whether on the command line or the
#!
line.Now it produces the "Unrecognized switch" error message [perl #104288].
system
and SIGCHLDsystem
now temporarily blocks the SIGCHLD signal handler, to prevent the signal handler from stealing the exit status [perl #105700].Deleting methods via
delete
Deletion of methods via
delete $Class::{method}
syntax used to update method caches if called in void context, but not scalar or list context. Now it always updates those caches.Hash element deletion and destructors
When hash elements are deleted in void context, the internal hash entry is now freed before the value is freed, to prevent destructors called by that latter freeing from seeing the hash in an inconsistent state. It was possible to cause double-frees if the destructor freed the hash itself [perl #100340].
(s)printf
's %n formatting codeThe %n formatting code, which causes the number of characters to be assigned to the next argument to
printf
orsprintf
now actually assigns the number of characters, instead of the number of bytes.It also works now with special lvalue functions like
substr
and with nonexistent hash and array elements [perl #3471, #103492].Typeglobs and threads
Typeglobs returned from threads are no longer cloned if the parent thread already has a glob with the same name. This means that returned subroutines will now assign to the right package variables [perl #107366].
local $_
In Perl 5.14,
local $_
was changed to create a new variable not tied to anything, even if $_ was tied before that. But, due to an oversight, it would still call FETCH once on a tied $_ before replacing it with the new variable. This has been fixed [perl #105912].Returning tied variables
When returning a value from a non-lvalue subroutine, Perl copies the value. Sometimes it cheats for the sake of speed, and does not copy the value if it makes no observable difference. This optimisation was erroneously allowing the copy to be skipped on tied variables, causing a difference in behaviour depending on the tied variable's reference count. This has been fixed [perl #95548].
{@a = sort}
no longer crashesThis particular piece of code (
sort
with no arguments assigned to an array, inside a block with no;
) started crashing in an earlier 5.15.x release. It has been fixed.utf8::decode
and read-only scalarsutf8::decode
now refuses to modify read-only scalars [perl #91850].dbmopen
with undefined modedbmopen
now only warns once, rather than three times, if the mode argument isundef
[perl #90064].Freeing an aggregate during list assignment
If list assignment to a hash or array triggered destructors that freed the hash or array itself, a crash would ensue. This is no longer the case [perl #107440].
Confused internal bookkeeping with @ISA arrays
Creating a weak reference to an @ISA array or accessing the array index (
$#ISA
) could result in confused internal bookkeeping for elements subsequently added to the @ISA array. For instance, creating a weak reference to the element itself could push that weak reference on to @ISA; and elements added after use of$#ISA
would be ignored by method lookup [perl #85670].DELETE on scalar ties
Tying an element of %ENV or
%^H
and then deleting that element would result in a call to the tie object's DELETE method, even though tying the element itself is supposed to be equivalent to tying a scalar (the element is, of course, a scalar) [perl #67490].Freeing $_ inside
grep
ormap
Freeing $_ inside a
grep
ormap
block or a code block embedded in a regular expression used to result in double frees [perl #92254, #92256].Warnings with
+=
The
+=
operator does not usually warn when the left-hand side isundef
, but it was doing so for tied variables. This has been fixed [perl #44895].Tying and autovivification
When Perl autovivifies an element of a tied array or hash (which entails calling STORE with a new reference), it now calls FETCH immediately after the STORE, instead of assuming that FETCH would have returned the same reference. This can make it easier to implement tied objects [perl #35865, #43011].
@&
and$&
Mentioning a variable named "&" other than
$&
(i.e.,@&
or%&
) no longer stops$&
from working. The same applies to variables named "'" and "`" [perl #24237].Stacked filetests
-T
and-B
now work when stacked up with other filetest operators [perl #77388].Filetests and stat buffers
Perl keeps several internal variables to keep track of the last stat buffer, from which file(handle) it originated, what type it was, and whether the last stat succeeded.
There were various cases where these could get out of synch, resulting in inconsistent or erratic behaviour in edge cases (every mention of
-T
applies to-B
as well):-T HANDLE
, even though it does astat
, was not resetting the last stat type, so anlstat _
following it would merrily return the wrong results. Also, it was not setting the success status.Freeing the handle last used by
stat
or a filetest could result in-T _
using an unrelated handle.stat
with an IO reference (as returned by*STDIO{IO}
, for instance) would not reset the stat type.stat
with an IO reference was not recording the filehandle for-T _
to use.The presence of fatal warnings could cause the stat buffer not to be reset for a filetest operator on an unopened filehandle or
-l
on any handle.Fatal warnings would stop
-T
from setting$!
.When the last stat was on an unreadable file,
-T _
is supposed to returnundef
, leaving the last stat buffer unchanged. But it was setting the stat type, causinglstat _
to stop working.-T FILENAME
was not resetting the internal stat buffers for unreadable files.
These have all been fixed.
defined *{"!"}
An earlier 5.15.x release caused this construct to stop the
%!
hash from working. Likewisedefined *{"+"}
anddefined *{"-"}
caused%+
and%-
, respectively, to stop working. This has been fixed.-T _
with no precedingstat
This used to produce a confusing "uninitialized" warning, even though there is no visible uninitialized value to speak of.
stat HANDLE
and fstat failuresIf the operating system's
fstat
function failed,stat
would warn about an unopened handle, even though that was not the case. This has been fixed.lstat IOREF
lstat
is documented to fall back tostat
(with a warning) when given a filehandle. When passed an IO reference, it was actually doing the equivalent ofstat _
and ignoring the handle.Crashes with warnings
Two warning messages that mention variable names started crashing in 5.15.5, but have been fixed [perl #106726, #107656].
Bitwise assignment operators and copy-on-write
In 5.14.0, the bitwise assignment operators
|=
,^=
and&=
started leaving the left-hand side undefined if it happened to be a copy-on-write string. This has been fixed [perl #108480].Three problematic Unicode characters now work better in regex pattern matching under
/i
In the past, three Unicode characters: LATIN SMALL LETTER SHARP S, GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, and GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, along with the sequences that they fold to (including "ss" in the case of LATIN SMALL LETTER SHARP S), did not properly match under
/i
. 5.14.0 fixed some of these cases, but introduced others, including a panic when one of the characters or sequences was used in the(?(DEFINE)
regular expression predicate. The known bugs that were introduced in 5.14 have now been fixed; as well as some other edge cases that have never worked until now. All these involve using the characters and sequences outside bracketed character classes under/i
. This closes [perl #98546].There remain known problems when using certain characters with multi-character folds inside bracketed character classes, including such constructs as
qr/[\N{LATIN SMALL LETTER SHARP}a-z]/i
. These remaining bugs are addressed in [perl #89774].RT #78266: The regex engine has been leaking memory when accessing named captures that weren't matched as part of a regex ever since 5.10 when they were introduced, e.g. this would consume over a hundred MB of memory:
for (1..10_000_000) { if ("foo" =~ /(foo|(?<capture>bar))?/) { my $capture = $+{capture} } } system "ps -o rss $$"'
A constant subroutine assigned to a glob whose name contains a null will no longer cause extra globs to pop into existence when the constant is referenced under its new name.
sort
was not treatingsub {}
andsub {()}
as equivalent when such a sub was provided as the comparison routine. It used to croak onsub {()}
.Subroutines from the
autouse
namespace are once more exempt from redefinition warnings. This used to work in 5.005, but was broken in 5.6 for most subroutines. For subs created via XS that redefine subroutines from theautouse
package, this stopped working in 5.10.New XSUBs now produce redefinition warnings if they overwrite existing subs, as they did in 5.8.x. (The
autouse
logic was reversed in 5.10-14. Only subroutines from theautouse
namespace would warn when clobbered.)Redefinition warnings triggered by the creation of XSUBs now respect Unicode glob names, instead of using the internal representation. This was missed in 5.15.4, partly because this warning was so hard to trigger. (See the previous item.)
newCONSTSUB
used to use compile-time warning hints, instead of run-time hints. The following code should never produce a redefinition warning, but it used to, ifnewCONSTSUB
redefined an existing subroutine:use warnings; BEGIN { no warnings; some_XS_function_that_calls_new_CONSTSUB(); }
Redefinition warnings for constant subroutines are on by default (what are known as severe warnings in perldiag). This was only the case when it was a glob assignment or declaration of a Perl subroutine that caused the warning. If the creation of XSUBs triggered the warning, it was not a default warning. This has been corrected.
The internal check to see whether a redefinition warning should occur used to emit "uninitialized" warnings in cases like this:
use warnings "uninitialized"; use constant {u => undef, v => undef}; sub foo(){u} sub foo(){v}
A bug fix in Perl 5.14 introduced a new bug, causing "uninitialized" warnings to report the wrong variable if the operator in question had two operands and one was
%{...}
or@{...}
. This has been fixed [perl #103766].version->new("version")
andprintf "%vd", "version"
no longer crash [perl #102586].$tied =~ y/a/b/
,chop $tied
andchomp $tied
now call FETCH just once when $tied holds a reference.Four-argument
select
now always calls FETCH on tied arguments. It used to skip the call if the tied argument happened to holdundef
or a typeglob.Four-argument
select
no longer produces its "Non-string passed as bitmask" warning on tied or tainted variables that are strings.sysread
now always calls FETCH on the buffer passed to it if the buffer is tied. It used to skip the call if the tied variable happened to hold a typeglob.$tied .= <>
now calls FETCH once on$tied
. It used to call it multiple times if the last value assigned to or returned from the tied variable was anything other than a string or typeglob.The
evalbytes
keyword added in 5.15.5 was respectinguse utf8
declarations from the outer scope, when it should have been ignoring them.goto &func
no longer crashes, but produces an error message, when the unwinding of the current subroutine's scope fires a destructor that undefines the subroutine being "goneto" [perl #99850].Arithmetic assignment (
$left += $right
) involving overloaded objects that rely on the 'nomethod' override no longer segfault when the left operand is not overloaded.Assigning
__PACKAGE__
or any other shared hash key scalar to a stash element no longer causes a double free. Regardless of this change, the results of such assignments are still undefined.Assigning
__PACKAGE__
or another shared hash key string to a variable no longer stops that variable from being tied if it happens to be a PVMG or PVLV internally.Creating a
UNIVERSAL::AUTOLOAD
sub no longer stops%+
,%-
and%!
from working some of the time [perl #105024].When presented with malformed UTF-8 input, the XS-callable functions
is_utf8_string()
,is_utf8_string_loc()
, andis_utf8_string_loclen()
could read beyond the end of the input string by up to 12 bytes. This no longer happens. [perl #32080]. However, currently,is_utf8_char()
still has this defect, see "is_utf8_char()" above.Doing a substitution on a tied variable returning a copy-on-write scalar used to cause an assertion failure or an "Attempt to free nonexistent shared string" warning.
A change in perl 5.15.4 caused
caller()
to produce malloc errors and a crash with Perl's own malloc, and possibly with other malloc implementations, too [perl #104034].A bug fix in 5.15.5 could sometimes result in assertion failures under debugging builds of perl for certain syntax errors in
eval
, such aseval q|""!=!~//|
The "c [line num]" debugger command was broken by other debugger changes released in 5.15.3. This is now fixed.
Breakpoints were not properly restored after a debugger restart using the "R" command. This was broken in 5.15.3. This is now fixed.
The debugger prompt did not display the current line. This was broken in 5.15.3. This is now fixed.
Class method calls still suffered from the Unicode bug with Latin-1 package names. This was missed in the Unicode package name cleanup in 5.15.4 [perl #105922].
The debugger no longer tries to do
local $_
when dumping data structures.Calling
readline($fh)
where $fh is a glob copy (e.g., after$fh = *STDOUT
), assigning something other than a glob to $fh, and then freeing $fh (e.g., by leaving the scope where it is defined) no longer causes the internal variable used by$.
(PL_last_in_gv
) to point to a freed scalar, that could be reused for some other glob, causing$.
to use some unrelated filehandle [perl #97988].A regression in 5.14 caused these statements not to set the internal variable that holds the handle used by
$.
:my $fh = *STDOUT; tell $fh; eof $fh; seek $fh, 0,0; tell *$fh; eof *$fh; seek *$fh, 0,0; readline *$fh;
This is now fixed, but
tell *{ *$fh }
still has the problem, and it is not clear how to fix it [perl #106536].Version comparisons, such as those that happen implicitly with
use v5.43
, no longer cause locale settings to change [perl #105784].pod/buildtoc, which generates perltoc, put path names in the perltoc file. This bug was introduced in 5.15.1.
Perl now holds an extra reference count on the package that code is currently compiling in. This means that the following code no longer crashes [perl #101486]:
package Foo; BEGIN {*Foo:: = *Bar::} sub foo;
dumpvar.pl, and consequently the
x
command in the debugger, have been fixed to handle objects blessed into classes whose names contain "=". The contents of such objects used not to be dumped [perl #101814].The
x
repetition operator no longer crashes on 64-bit builds with large repeat counts [perl #94560].A fix to
glob
under miniperl (used to configure modules when perl itself is built) in Perl 5.15.3 stopped<~>
from returning the home directory, because it cleared %ENV before calling csh. Now$ENV{HOME}
is preserved. This fix probably does not affect anything. If File::Glob fails to load for some reason, Perl reverts to using csh. So it would apply in that case.On OSes other than VMS, Perl's
glob
operator (and the<...>
form) use File::Glob underneath. File::Glob splits the pattern into words, before feeding each word to itsbsd_glob
function.There were several inconsistencies in the way the split was done. Now quotation marks (' and ") are always treated as shell-style word delimiters (that allow whitespace as part of a word) and backslashes are always preserved, unless they exist to escape quotation marks. Before, those would only sometimes be the case, depending on whether the pattern contained whitespace. Also, escaped whitespace at the end of the pattern is no longer stripped [perl #40470].
CORE::glob
now works as a way to call the default globbing function. It used to respect overrides, despite theCORE::
prefix.In 5.14,
/[[:lower:]]/i
and/[[:upper:]]/i
no longer matched the opposite case. This has been fixed [perl #101970].A regular expression match with an overloaded object on the right-hand side would in some cases stringify the object too many times.
The C-level
pregcomp
function could become confused as to whether the pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise magical scalar [perl #101940].A regression has been fixed that was introduced in 5.14, in
/i
regular expression matching, in which a match improperly fails if the pattern is in UTF-8, the target string is not, and a Latin-1 character precedes a character in the string that should match the pattern. [perl #101710]@{"..."} = reverse ...
started crashing in 5.15.3. This has been fixed.ref
in a tainted expression started producing an "sv_upgrade" error in 5.15.4. This has been fixed.Weak references to lexical hashes going out of scope were not going stale (becoming undefined), but continued to point to the hash.
Weak references to lexical variables going out of scope are now broken before any magical methods (e.g., DESTROY on a tie object) are called. This prevents such methods from modifying the variable that will be seen the next time the scope is entered.
A
keys
optimisation in Perl 5.12.0 to make it faster on empty hashes causedeach
not to reset the iterator if called after the last element was deleted. This has been fixed.The
#line 42 foo
directive used not to update the arrays of lines used by the debugger if it occurred in a string eval. This was partially fixed in 5.14, but it only worked for a single#line 42 foo
in each eval. Now it works for multiple.String eval used not to localise
%^H
when compiling its argument if it was empty at the time theeval
call itself was compiled. This could lead to scary side effects, likeuse re "/m"
enabling other flags that the surrounding code was trying to enable for its caller [perl #68750].Creating a BEGIN block from XS code (via
newXS
ornewATTRSUB
) would, on completion, make the hints of the current compiling code the current hints. This could cause warnings to occur in a non-warning scope.eval $string
andrequire
no longer localise hints ($^H
and%^H
) at run time, but only during compilation of the $string or required file. This makesBEGIN { $^H{foo}=7 }
equivalent toBEGIN { eval '$^H{foo}=7' }
[perl #70151].When subroutine calls are intercepted by the debugger, the name of the subroutine or a reference to it is stored in
$DB::sub
, for the debugger to access. In some cases (such as$foo = *bar; undef *bar; &$foo
)$DB::sub
would be set to a name that could not be used to find the subroutine, and so the debugger's attempt to call it would fail. Now the check to see whether a reference is needed is more robust, so those problems should not happen anymore [rt.cpan.org #69862].Localising a tied scalar that returns a typeglob no longer stops it from being tied till the end of the scope.
When
open
is called with three arguments, the third being a file handle (as inopen $fh, ">&", $fh2
), if the third argument is tied or a reference to a tied variable, FETCH is now called exactly once, instead of 0, 2, or 3 times (all of which could occur in various circumstances).sort
no longer ignores FETCH when passed a reference to a tied glob for the comparison routine.Warnings emitted by
sort
when a custom comparison routine returns a non-numeric value now show the line number of thesort
operator, rather than the last line of the comparison routine. The warnings also occur now only if warnings are enabled in the scope wheresort
occurs. Previously the warnings would occur if enabled in the comparison routine's scope.Internals::SvREFCNT
now behaves consistently in 'get' and 'set' scenarios [perl #103222] and also treats the reference count as unsigned.Calling
require
on an implicit$_
when*CORE::GLOBAL::require
has been overridden does not segfault anymore, and$_
is now passed to the overriding subroutine [perl #78260].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.Passing the same constant subroutine to both
index
andformline
no longer causes one or the other to fail [perl #89218]. (5.14.1)List assignment to lexical variables declared with attributes in the same statement (
my ($x,@y) : blimp = (72,94)
) stopped working in Perl 5.8.0. It has now been fixed.Perl 5.10.0 introduced some faulty logic that made "U*" in the middle of a pack template equivalent to "U0" if the input string was empty. This has been fixed [perl #90160].
Destructors on objects were not called during global destruction on objects that were not referenced by any scalars. This could happen if an array element were blessed (e.g.,
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, thatpos
would be remembered from one execution of the samegiven
block to the next, even if the input were a different variable [perl #84526].The "R" command for restarting a debugger session has been fixed to work on Windows, or any other system lacking a
POSIX::_SC_OPEN_MAX
constant [perl #87740].Fixed a case where it was possible that a freed buffer may have been read from when parsing a here document [perl #90128]. (5.14.1)
The
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 indefined(...)
, likeeach(HASH)
, inside awhile
condition [perl #90888].In @INC filters (subroutines returned by subroutines in @INC), $_ used to misbehave: If returned from a subroutine, it would not be copied, but the variable itself would be returned; and freeing $_ (e.g., with
undef *_
) would cause perl to crash. This has been fixed [perl #91880].An ASCII single quote (') in a symbol name is meant to be equivalent to a double colon (::) except at the end of the name. It was not equivalent if followed by a null character, but now it is [perl #88138].
The abbreviations for four C1 control characters
MW
PM
,RI
, andST
were previously unrecognized by\N{}
, vianame(), and string_vianame().Some cases of threads crashing due to memory allocation during cloning have been fixed [perl #90006].
Attempting to
goto
out of a tied handle method used to cause memory corruption or crashes. Now it produces an error message instead [perl #8611].Perl skips copying values returned from a subroutine if it thinks the value is not in use elsewhere. Due to faulty logic, this would happen with the result of
delete
,shift
orsplice
, even if the result was referenced elsewhere. So\sub { delete $_[0] }->($x)
would return a reference to$x
. This has been fixed [perl #91844].Applying the :lvalue attribute to subroutine that is already defined does not work properly, as the attribute changes the way the sub is compiled. Hence, Perl 5.12 began warning when an attempt is made to apply the attribute to an already defined sub. In such cases, the attribute is discarded.
But the change in 5.12 missed the case where custom attributes are also present: that case still silently and ineffectively applied the attribute. That omission has now been corrected.
sub foo :lvalue :Whatever
(whenfoo
is already defined) now warns about the :lvalue attribute, and does not apply it.attributes.pm has likewise been updated to warn and not apply the attribute.
The remaining discrepancies between explicit and implicit return from lvalue subroutines have been resolved. They mainly involved which error message to display when a read-only value is returned in lvalue context. Also, returning a PADTMP (the result of most built-ins, like
index
) in lvalue context is now forbidden for explicit return, as it always has been for implicit return. This is not a regression from 5.14, as all the cases in which it could happen where previously syntax errors.Explicitly returning a tied
my
variable from an lvalue subroutine in list lvalue context used to clear the variable before the assignment could happen. This is something that was missed when explicit return was made to work in 5.15.0.A minor memory leak, introduced in 5.15.0, has been fixed. It would occur when a hash is freed that has had its current iterator deleted [perl #93454].
The
prototype
function no longer dies for the__FILE__
,__LINE__
and__PACKAGE__
directives. It now returns an empty-string prototype for them, because they are syntactically very similar to nullary functions liketime
.prototype
now returnsundef
for all overridable infix operators, such aseq
, which are not callable in any way resembling functions. It used to return incorrect prototypes for some and die for others [perl #94984].A bug affecting lvalue context propagation through nested lvalue subroutine calls has been fixed. Previously, returning a value in nested rvalue context would be treated as lvalue context by the inner subroutine call, resulting in some values (such as read-only values) being rejected.
Some core bugs affecting Hash::Util have been fixed: locking a hash element that is a glob copy no longer causes subsequent assignment to it to corrupt the glob, and unlocking a hash element that holds a copy-on-write scalar no longer causes modifications to that scalar to modify other scalars that were sharing the same string buffer.
when
blocks are now capable of returning variables declared inside the enclosinggiven
block [perl #93548].A problem with context propagation when a
do
block is an argument toreturn
has been fixed. It used to causeundef
to be returned in some cases of areturn
inside anif
block which itself is followed by anotherreturn
.Calling
index
with a tainted constant no longer causes constants in subsequently compiled code to become tainted [perl #64804].Use of lexical (
my
) variables in code blocks embedded in regular expressions will no longer result in memory corruption or crashes.Nevertheless, these code blocks are still experimental, as there are still problems with the wrong variables being closed over (in loops for instance) and with abnormal exiting (e.g.,
die
) causing memory corruption.The
SvIsCOW
C macro now returns false for read-only copies of typeglobs, such as those created by:$hash{elem} = *foo; Hash::Util::lock_value %hash, 'elem';
It used to return true.
Assignment to
$^A
(the format output accumulator) now recalculates the number of lines output.The regexp optimiser no longer crashes on debugging builds when merging fixed-string nodes with inconvenient contents.
Locking a subroutine (via
lock &sub
) is no longer a compile-time error for regular subs. For lvalue subroutines, it no longer tries to return the sub as a scalar, resulting in strange side effects likeref \$_
returning "CODE" in some instances.lock &sub
is now a run-time error if threads::shared is loaded (a no-op otherwise), but that may be rectified in a future version.The prototypes of several built-in functions--
getprotobynumber
,lock
,not
andselect
--have been corrected, or at least are now closer to reality than before.Most dereferencing operators (
${}
, etc.) used to callFETCH
twice on a tied operand when doing a symbolic dereference (looking up a variable by name, which is not permitted underuse strict 'refs'
). Only&{}
did not have this problem. This has been fixed.A minor regression introduced in 5.15.0 has been fixed. Dereferencing a magical mortal (e.g., the return value of
delete
on a tied hash element) explicitly returned from a subroutine called recursively was not callingFETCH
. This would affect code like@{ foo() }
where thefoo
sub containsreturn delete $hash{elem}
and is calling itself.A panic involving the combination of the regular expression modifiers
/aa
and the\b
escape sequence introduced in 5.14.0 has been fixed [perl #95964].stat() would always return the inode number as an IV, even when the original was unsigned, or too large to fit in an IV. stat() now returns the inode number as the type that would best preserve the original value. [perl #84590]
The combination of the regular expression modifiers
/aa
and the\b
and\B
escape sequences did not work properly on UTF-8 encoded strings. All non-ASCII characters under/aa
should be treated as non-word characters, but what was happening was that Unicode rules were used to determine wordness/non-wordness for non-ASCII characters. This is now fixed [perl #95968].Infinite loops like
1 while 1
used to stopstrict 'subs'
mode from working for the rest of the block.tThe
\h
,\H
,\v
and\V
regular expression metacharacters used to cause a panic error message when attempting to match at the end of the string [perl #96354].For list assignments like
($a,$b) = ($b,$a)
, Perl has to make a copy of the items on the right-hand side before assignment them to the left. For efficiency's sake, it assigns the values on the right straight to the items on the left no variable is mentioned on both sides, as in($a,$b) = ($c,$d)
. The logic for determining when it can cheat was faulty, in that&&
and||
on the right-hand side could fool it. So($a,$b) = $some_true_value && ($b,$a)
would end up assigning the value of$b
to both scalars.Perl no longer tries to apply lvalue context to the string in
("string", $variable) ||= 1
(which used to be an error). Since the left-hand side of||=
is evaluated in scalar context, that's a scalar comma operator, which gives all but the last item void context. There is no such thing as void lvalue context, so it was a mistake for Perl to try to force it [perl #96942].Every subroutine has a filename associated with it, that the debugger uses. The one associated with constant subroutines used to be misallocated when cloned under threads. Consequently, debugging threaded applications could result in memory corruption [perl #96126].
caller
no longer leaks memory when called from the DB package if@DB::args
was assigned to after the first call tocaller
. Carp was triggering this bug [perl #97010].In Perl 5.15.0
defined(${'$'})
stopped returning true if the$$
variable had not been used yet. This has been fixed.defined(${"..."})
,defined(*{"..."})
, etc., used to return true for most, but not all built-in variables, if they had not been used yet. Many times that new built-in variables were added in past versions, this construct was not taken into account, so this affected${^GLOBAL_PHASE}
and${^UTF8CACHE}
, among others. It also used to return false if the package name was given as well (${"::!"}
) and for subroutines in the CORE package [perl #97978] [perl #97492] [perl #97484].Perl 5.10.0 introduced a similar bug:
defined(*{"foo"})
where "foo" represents the name of a built-in global variable used to return false if the variable had never been used before, but only on the first call. This, too, has been fixed.Various functions that take a filehandle argument in rvalue context (
close
,readline
, etc.) used to callFETCH
multiple times, if it was a tied variable, and warn twice, if it wasundef
[perl #97482].close
and similar filehandle functions, when called on built-in global variables (like$+
), used to die if the variable happened to hold the undefined value, instead of producing the usual "Use of uninitialized value" warning.When autovivified file handles were introduced in Perl 5.6.0,
readline
was inadvertently made to autovivify when called asreadline($foo)
(but not as<$foo>
). It has now been fixed never to autovivify.defined ${ $tied_variable }
used to callFETCH
multiple times, but now calls it just once.Some cases of dereferencing a complex expression, such as
${ (), $tied } = 1
, used to callFETCH
multiple times, but now call it once.For a tied variable returning a package name,
$tied->method
used to callFETCH
multiple times (even up to six!), and sometimes would fail to call the method, due to memory corruption.Calling an undefined anonymous subroutine (e.g., what $x holds after
undef &{$x = sub{}}
) used to cause a "Not a CODE reference" error, which has been corrected to "Undefined subroutine called" [perl #71154].Causing
@DB::args
to be freed between uses ofcaller
no longer results in a crash [perl #93320].Since 5.6.0,
*{ ... }
has been inconsistent in how it treats undefined values. It would die in strict mode or lvalue context for most undefined values, but would be treated as the empty string (with a warning) for the specific scalar return byundef()
(&PL_sv_undef
internally). This has been corrected.undef()
is now treated like other undefined scalars, as in Perl 5.005.It used to be possible to free the typeglob of a localised array or hash (e.g.,
local @{"x"}; delete $::{x}
), resulting in a crash on scope exit.setpgrp($foo)
used to be equivalent to($foo, setpgrp)
, becausesetpgrp
was ignoring its argument if there was just one. Now it is equivalent tosetpgrp($foo,0)
.Assignments like
*$tied = \&{"..."}
and*glob = $tied
now call FETCH only once.chdir
,chmod
,chown
,utime
,truncate
,stat
,lstat
and the filetest ops (-r
,-x
, etc.) now always call FETCH if passed a tied variable as the last argument. They used to ignore tiedness if the last thing return from or assigned to the variable was a typeglob or reference to a typeglob.Perl 5.15.1 inadvertently stopped
*foo =~ s/\*//r
from working, as it would try to force the *foo glob into a string. This has been fixed [perl #97954].If things were arranged in memory the right way, it was possible for thread joining to emit "Attempt to free unreferenced scalar" warnings if
caller
had been used from theDB
package prior to thread creation, due to the way pads were reference-counted and cloned [perl #98092].CORE:: subs were introduced in the previous development release, but
defined &{"CORE::..."}
did not return true. That has been rectified [perl #97484].Lvalue subroutines were made to autovivify in 5.15.0, but it did not work in some cases involving an intervening list operator between the dereference operator and the subroutine call (
${(), lvsub()}
) [perl #98184].A bug has been fixed that occurs when a tied variable is used as a subroutine reference: if the last thing assigned to or returned from the variable was a reference or typeglob, the
\&$tied
could either crash or return the wrong subroutine. The reference case is a regression introduced in Perl 5.10.0. For typeglobs, it has probably never worked till now.given
was not scoping its implicit $_ properly, resulting in memory leaks or "Variable is not available" warnings [perl #94682].-l
followed by a bareword no longer "eats" the previous argument to the list operator in whose argument list it resides. In less convoluted English:print "bar", -l foo
now actually prints "bar", because-l
on longer eats it.In 5.14.0, filetest ops (
-r
,-x
, etc.) started calling FETCH on a tied argument belonging to the previous argument to a list operator, if called with a bareword argument or no argument at all. This has been fixed, sopush @foo, $tied, -r
no longer calls FETCH on$tied
.shmread
was not setting the scalar flags correctly when reading from shared memory, causing the existing cached numeric representation in the scalar to persist [perl #98480].Weakening the first argument to an automatically-invoked
DESTROY
method could result in erroneous "DESTROY created new reference" errors or crashes. Now it is an error to weaken a read-only reference.Under miniperl (used to configure modules when perl itself is built),
glob
now clears %ENV before calling csh, since the latter croaks on some systems if it does not like the contents of the LS_COLORS enviroment variable [perl #98662].++
and--
now work on copies of globs, instead of dying.The subroutines in the CORE:: namespace that were introduced in the previous development release run with the lexical hints (strict, warnings) of the caller, just as though the built-in function had been called. But this was not the case for
goto &CORE::sub
. The CORE sub would end up running with the lexical hints of the subroutine it replaced, instead of that subroutine's caller. This has been fixed.Stacked
-l
(followed immediately by other filetest operators) did not work previously; now it does. It is only permitted when the rightmost filetest op has the special "_" handle for its argument and the most recentstat
/lstat
call was anlstat
.In Perl 5.6,
-l
followed by anything other than a bareword would treat its argument as a file name. That was changed in 5.8 for glob references (\*foo
), but not for globs themselves (*foo
).-l
started returningundef
for glob references without setting the last stat buffer that the "_" handle uses, but only if warnings were turned on. With warnings off, it was the same as 5.6. In other words, it was simply buggy and inconsistent. Now the 5.6 behaviour has been restored.
Known Problems
We have a failing test in op/sigdispatch.t on i386-netbsd 3.1
On Solaris, we have two kinds of failure.
If make is Sun's make≥, we get an error about a badly formed macro assignment in the Makefile. That happens when ./Configure tries to make depends. Configure then exits 0, but further make-ing fails.
If make is gmake, Configure completes, then we get errors related to /usr/include/stdbool.h
Obituary
XXX If any significant core contributor has died, we've added a short obituary here.
Acknowledgements
XXX Generate this with:
perl Porting/acknowledgements.pl 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 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.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 731:
'=item' outside of any '=over'
- Around line 753:
You forgot a '=back' before '=head2'