.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "PERL5160DELTA 1perl"
.TH PERL5160DELTA 1perl 2024-02-11 "perl v5.38.2" "Perl Programmers Reference Guide"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
perl5160delta \- what is new for perl v5.16.0
.SH DESCRIPTION
.IX Header "DESCRIPTION"
This document describes differences between the 5.14.0 release and
the 5.16.0 release.
.PP
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.
.PP
Some bug fixes in this release have been backported to later
releases of 5.14.x. Those are indicated with the 5.14.x version in
parentheses.
.SH Notice
.IX Header "Notice"
With the release of Perl 5.16.0, the 5.12.x series of releases is now out of
its support period. There may be future 5.12.x releases, but only in the
event of a critical security issue. Users of Perl 5.12 or earlier should
consider upgrading to a more recent release of Perl.
.PP
This policy is described in greater detail in
perlpolicy.
.SH "Core Enhancements"
.IX Header "Core Enhancements"
.ie n .SS """use \fIVERSION\fP"""
.el .SS "\f(CWuse \fP\f(CIVERSION\fP\f(CW\fP"
.IX Subsection "use VERSION"
As of this release, version declarations like \f(CW\*(C`use v5.16\*(C'\fR now disable
all features before enabling the new feature bundle. This means that
the following holds true:
.PP
.Vb 4
\& use 5.016;
\& # only 5.16 features enabled here
\& use 5.014;
\& # only 5.14 features enabled here (not 5.16)
.Ve
.PP
\&\f(CW\*(C`use v5.12\*(C'\fR and higher continue to enable strict, but explicit \f(CW\*(C`use
strict\*(C'\fR and \f(CW\*(C`no strict\*(C'\fR now override the version declaration, even
when they come first:
.PP
.Vb 3
\& no strict;
\& use 5.012;
\& # no strict here
.Ve
.PP
There is a new ":default" feature bundle that represents the set of
features enabled before any version declaration or \f(CW\*(C`use feature\*(C'\fR has
been seen. Version declarations below 5.10 now enable the ":default"
feature set. This does not actually change the behavior of \f(CW\*(C`use
v5.8\*(C'\fR, because features added to the ":default" set are those that were
traditionally enabled by default, before they could be turned off.
.PP
\&\f(CW\*(C`no feature\*(C'\fR now resets to the default feature set. To disable all
features (which is likely to be a pretty special-purpose request, since
it presumably won't match any named set of semantics) you can now
write \f(CW\*(C`no feature \*(Aq:all\*(Aq\*(C'\fR.
.PP
\&\f(CW$[\fR is now disabled under \f(CW\*(C`use v5.16\*(C'\fR. It is part of the default
feature set and can be turned on or off explicitly with \f(CWuse feature
\&\*(Aqarray_base\*(Aq\fR.
.ie n .SS """_\|_SUB_\|_"""
.el .SS \f(CW_\|_SUB_\|_\fP
.IX Subsection "__SUB__"
The new \f(CW\*(C`_\|_SUB_\|_\*(C'\fR token, available under the \f(CW\*(C`current_sub\*(C'\fR feature
(see feature) or \f(CW\*(C`use v5.16\*(C'\fR, returns a reference to the current
subroutine, making it easier to write recursive closures.
.SS "New and Improved Built-ins"
.IX Subsection "New and Improved Built-ins"
\fIMore consistent \fR\f(CI\*(C`eval\*(C'\fR
.IX Subsection "More consistent eval"
.PP
The \f(CW\*(C`eval\*(C'\fR 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.
.PP
The new \f(CW\*(C`unicode_eval\*(C'\fR and \f(CW\*(C`evalbytes\*(C'\fR features (enabled under \f(CWuse
5.16.0\fR) resolve this. The \f(CW\*(C`unicode_eval\*(C'\fR feature causes \f(CWeval
$string\fR to treat the string always as Unicode. The \f(CW\*(C`evalbytes\*(C'\fR
features provides a function, itself called \f(CW\*(C`evalbytes\*(C'\fR, which
evaluates its argument always as a string of bytes.
.PP
These features also fix oddities with source filters leaking to outer
dynamic scopes.
.PP
See feature for more detail.
.PP
\fR\f(CI\*(C`substr\*(C'\fR\fI lvalue revamp\fR
.IX Subsection "substr lvalue revamp"
.PP
When \f(CW\*(C`substr\*(C'\fR 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.
.PP
Previously, the offsets (the second and third arguments) passed to
\&\f(CW\*(C`substr\*(C'\fR would be converted immediately to match the string, negative
offsets being translated to positive and offsets beyond the end of the
string being truncated.
.PP
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 \f(CW\*(C`substr\*(C'\fR itself, but only when the returned lvalue is
read or modified.
.PP
These changes result in an incompatible change:
.PP
If the original string changes length after the call to \f(CW\*(C`substr\*(C'\fR but
before assignment to its return value, negative offsets will remember
their position from the end of the string, affecting code like this:
.PP
.Vb 5
\& my $string = "string";
\& my $lvalue = \esubstr $string, \-4, 2;
\& print $$lvalue, "\en"; # prints "ri"
\& $string = "bailing twine";
\& print $$lvalue, "\en"; # prints "wi"; used to print "il"
.Ve
.PP
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.
.PP
Since this change also allowed many bugs to be fixed (see
"The \f(CW\*(C`substr\*(C'\fR operator"), and since the behavior
of negative offsets has never been specified, the
change was deemed acceptable.
.PP
\fIReturn value of \fR\f(CI\*(C`tied\*(C'\fR
.IX Subsection "Return value of tied"
.PP
The value returned by \f(CW\*(C`tied\*(C'\fR on a tied variable is now the actual
scalar that holds the object to which the variable is tied. This
lets ties be weakened with \f(CW\*(C`Scalar::Util::weaken(tied
$tied_variable)\*(C'\fR.
.SS "Unicode Support"
.IX Subsection "Unicode Support"
\fISupports (almost) Unicode 6.1\fR
.IX Subsection "Supports (almost) Unicode 6.1"
.PP
Besides the addition of whole new scripts, and new characters in
existing scripts, this new version of Unicode, as always, makes some
changes to existing characters. One change that may trip up some
applications is that the General Category of two characters in the
Latin\-1 range, PILCROW SIGN and SECTION SIGN, has been changed from
Other_Symbol to Other_Punctuation. The same change has been made for
a character in each of Tibetan, Ethiopic, and Aegean.
The code points U+3248..U+324F (CIRCLED NUMBER TEN ON BLACK SQUARE
through CIRCLED NUMBER EIGHTY ON BLACK SQUARE) have had their General
Category changed from Other_Symbol to Other_Numeric. The Line Break
property has changes for Hebrew and Japanese; and because of
other changes in 6.1, the Perl regular expression construct \f(CW\*(C`\eX\*(C'\fR now
works differently for some characters in Thai and Lao.
.PP
New aliases (synonyms) have been defined for many property values;
these, along with the previously existing ones, are all cross-indexed in
perluniprops.
.PP
The return value of \f(CWcharnames::viacode()\fR is affected by other
changes:
.PP
.Vb 10
\& Code point Old Name New Name
\& U+000A LINE FEED (LF) LINE FEED
\& U+000C FORM FEED (FF) FORM FEED
\& U+000D CARRIAGE RETURN (CR) CARRIAGE RETURN
\& U+0085 NEXT LINE (NEL) NEXT LINE
\& U+008E SINGLE\-SHIFT 2 SINGLE\-SHIFT\-2
\& U+008F SINGLE\-SHIFT 3 SINGLE\-SHIFT\-3
\& U+0091 PRIVATE USE 1 PRIVATE USE\-1
\& U+0092 PRIVATE USE 2 PRIVATE USE\-2
\& U+2118 SCRIPT CAPITAL P WEIERSTRASS ELLIPTIC FUNCTION
.Ve
.PP
Perl will accept any of these names as input, but
\&\f(CWcharnames::viacode()\fR now returns the new name of each pair. The
change for U+2118 is considered by Unicode to be a correction, that is
the original name was a mistake (but again, it will remain forever valid
to use it to refer to U+2118). But most of these changes are the
fallout of the mistake Unicode 6.0 made in naming a character used in
Japanese cell phones to be "BELL", which conflicts with the longstanding
industry use of (and Unicode's recommendation to use) that name
to mean the ASCII control character at U+0007. Therefore, that name
has been deprecated in Perl since v5.14, and any use of it will raise a
warning message (unless turned off). The name "ALERT" is now the
preferred name for this code point, with "BEL" an acceptable short
form. The name for the new cell phone character, at code point U+1F514,
remains undefined in this version of Perl (hence we don't
implement quite all of Unicode 6.1), but starting in v5.18, BELL will mean
this character, and not U+0007.
.PP
Unicode has taken steps to make sure that this sort of mistake does not
happen again. The Standard now includes all generally accepted
names and abbreviations for control characters, whereas previously it
didn't (though there were recommended names for most of them, which Perl
used). This means that most of those recommended names are now
officially in the Standard. Unicode did not recommend names for the
four code points listed above between U+008E and U+008F, and in
standardizing them Unicode subtly changed the names that Perl had
previously given them, by replacing the final blank in each name by a
hyphen. Unicode also officially accepts names that Perl had deprecated,
such as FILE SEPARATOR. Now the only deprecated name is BELL.
Finally, Perl now uses the new official names instead of the old
(now considered obsolete) names for the first four code points in the
list above (the ones which have the parentheses in them).
.PP
Now that the names have been placed in the Unicode standard, these kinds
of changes should not happen again, though corrections, such as to
U+2118, are still possible.
.PP
Unicode also added some name abbreviations, which Perl now accepts:
SP for SPACE;
TAB for CHARACTER TABULATION;
NEW LINE, END OF LINE, NL, and EOL for LINE FEED;
LOCKING-SHIFT ONE for SHIFT OUT;
LOCKING-SHIFT ZERO for SHIFT IN;
and ZWNBSP for ZERO WIDTH NO-BREAK SPACE.
.PP
More details on this version of Unicode are provided in
.
.PP
\fR\f(CI\*(C`use charnames\*(C'\fR\fI is no longer needed for \fR\f(CI\*(C`\eN{name}\*(C'\fR\fI\fR
.IX Subsection "use charnames is no longer needed for N{name}"
.PP
When \f(CW\*(C`\eN{\fR\f(CIname\fR\f(CW}\*(C'\fR is encountered, the \f(CW\*(C`charnames\*(C'\fR module is now
automatically loaded when needed as if the \f(CW\*(C`:full\*(C'\fR and \f(CW\*(C`:short\*(C'\fR
options had been specified. See charnames for more information.
.PP
\fR\f(CI\*(C`\eN{...}\*(C'\fR\fI can now have Unicode loose name matching\fR
.IX Subsection "N{...} can now have Unicode loose name matching"
.PP
This is described in the \f(CW\*(C`charnames\*(C'\fR item in
"Updated Modules and Pragmata" below.
.PP
\fIUnicode Symbol Names\fR
.IX Subsection "Unicode Symbol Names"
.PP
Perl now has proper support for Unicode in symbol names. It used to be
that \f(CW\*(C`*{$foo}\*(C'\fR would ignore the internal UTF8 flag and use the bytes of
the underlying representation to look up the symbol. That meant that
\&\f(CW\*(C`*{"\ex{100}"}\*(C'\fR and \f(CW\*(C`*{"\exc4\ex80"}\*(C'\fR would return the same thing. All
these parts of Perl have been fixed to account for Unicode:
.IP \(bu 4
Method names (including those passed to \f(CW\*(C`use overload\*(C'\fR)
.IP \(bu 4
Typeglob names (including names of variables, subroutines, and filehandles)
.IP \(bu 4
Package names
.IP \(bu 4
\&\f(CW\*(C`goto\*(C'\fR
.IP \(bu 4
Symbolic dereferencing
.IP \(bu 4
Second argument to \f(CWbless()\fR and \f(CWtie()\fR
.IP \(bu 4
Return value of \f(CWref()\fR
.IP \(bu 4
Subroutine prototypes
.IP \(bu 4
Attributes
.IP \(bu 4
Various warnings and error messages that mention variable names or values,
methods, etc.
.PP
In addition, a parsing bug has been fixed that prevented \f(CW\*(C`*{é}\*(C'\fR from
implicitly quoting the name, but instead interpreted it as \f(CW\*(C`*{+é}\*(C'\fR, which
would cause a strict violation.
.PP
\&\f(CW\*(C`*{"*a::b"}\*(C'\fR automatically strips off the * if it is followed by an ASCII
letter. That has been extended to all Unicode identifier characters.
.PP
One-character non-ASCII non-punctuation variables (like \f(CW$é\fR) are now
subject to "Used only once" warnings. They used to be exempt, as they
were treated as punctuation variables.
.PP
Also, single-character Unicode punctuation variables (like \f(CW$‰\fR) are now
supported [perl #69032].
.PP
\fIImproved ability to mix locales and Unicode, including UTF\-8 locales\fR
.IX Subsection "Improved ability to mix locales and Unicode, including UTF-8 locales"
.PP
An optional parameter has been added to \f(CW\*(C`use locale\*(C'\fR
.PP
.Vb 1
\& use locale \*(Aq:not_characters\*(Aq;
.Ve
.PP
which tells Perl to use all but the \f(CW\*(C`LC_CTYPE\*(C'\fR and \f(CW\*(C`LC_COLLATE\*(C'\fR
portions of the current locale. Instead, the character set is assumed
to be Unicode. This lets locales and Unicode be seamlessly mixed,
including the increasingly frequent UTF\-8 locales. When using this
hybrid form of locales, the \f(CW\*(C`:locale\*(C'\fR layer to the open pragma can
be used to interface with the file system, and there are CPAN modules
available for ARGV and environment variable conversions.
.PP
Full details are in perllocale.
.PP
\fINew function \fR\f(CI\*(C`fc\*(C'\fR\fI and corresponding escape sequence \fR\f(CI\*(C`\eF\*(C'\fR\fI for Unicode foldcase\fR
.IX Subsection "New function fc and corresponding escape sequence F for Unicode foldcase"
.PP
Unicode foldcase is an extension to lowercase that gives better results
when comparing two strings case-insensitively. It has long been used
internally in regular expression \f(CW\*(C`/i\*(C'\fR matching. Now it is available
explicitly through the new \f(CW\*(C`fc\*(C'\fR function call (enabled by
\&\f(CW"use\ feature\ \*(Aqfc\*(Aq"\fR, or \f(CW\*(C`use v5.16\*(C'\fR, or explicitly callable via
\&\f(CW\*(C`CORE::fc\*(C'\fR) or through the new \f(CW\*(C`\eF\*(C'\fR sequence in double-quotish
strings.
.PP
Full details are in "fc" in perlfunc.
.PP
\fIThe Unicode \fR\f(CI\*(C`Script_Extensions\*(C'\fR\fI property is now supported.\fR
.IX Subsection "The Unicode Script_Extensions property is now supported."
.PP
New in Unicode 6.0, this is an improved \f(CW\*(C`Script\*(C'\fR property. Details
are in "Scripts" in perlunicode.
.SS "XS Changes"
.IX Subsection "XS Changes"
\fIImproved typemaps for Some Builtin Types\fR
.IX Subsection "Improved typemaps for Some Builtin Types"
.PP
Most XS authors will know there is a longstanding bug in the
OUTPUT typemap for T_AVREF (\f(CW\*(C`AV*\*(C'\fR), T_HVREF (\f(CW\*(C`HV*\*(C'\fR), T_CVREF (\f(CW\*(C`CV*\*(C'\fR),
and T_SVREF (\f(CW\*(C`SVREF\*(C'\fR or \f(CW\*(C`\e$foo\*(C'\fR) 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
\&\f(CW\*(C`T_AVREF_REFCOUNT_FIXED\*(C'\fR, etc. that do not exhibit this bug. Using
them in your extension is as simple as having one line in your
\&\f(CW\*(C`TYPEMAP\*(C'\fR section:
.PP
.Vb 1
\& HV* T_HVREF_REFCOUNT_FIXED
.Ve
.PP
\fR\f(CIis_utf8_char()\fR\fI\fR
.IX Subsection "is_utf8_char()"
.PP
The XS-callable function \f(CWis_utf8_char()\fR, 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, and so its
use is now deprecated. Use \f(CWis_utf8_char_buf()\fR (described just below)
instead.
.PP
\fIAdded \fR\f(CIis_utf8_char_buf()\fR
.IX Subsection "Added is_utf8_char_buf()"
.PP
This function is designed to replace the deprecated "\fBis_utf8_char()\fR"
function. It includes an extra parameter to make sure it doesn't read
past the end of the input buffer.
.PP
\fIOther \fR\f(CIis_utf8_foo()\fR\fI functions, as well as \fR\f(CIutf8_to_foo()\fR\fI, etc.\fR
.IX Subsection "Other is_utf8_foo() functions, as well as utf8_to_foo(), etc."
.PP
Most other XS-callable functions that take UTF\-8 encoded input
implicitly assume that the UTF\-8 is valid (not malformed) with respect 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 \f(CWis_utf8_string()\fR, \f(CWis_utf8_string_loc()\fR, and
\&\f(CWis_utf8_string_loclen()\fR.
.PP
\fINew Pad API\fR
.IX Subsection "New Pad API"
.PP
Many new functions have been added to the API for manipulating lexical
pads. See "Pad Data Structures" in perlapi for more information.
.SS "Changes to Special Variables"
.IX Subsection "Changes to Special Variables"
\fR\f(CI$$\fR\fI can be assigned to\fR
.IX Subsection "$$ can be assigned to"
.PP
\&\f(CW$$\fR was made read-only in Perl 5.8.0. But only sometimes: \f(CW\*(C`local $$\*(C'\fR
would make it writable again. Some CPAN modules were using \f(CW\*(C`local $$\*(C'\fR or
XS code to bypass the read-only check, so there is no reason to keep \f(CW$$\fR
read-only. (This change also allowed a bug to be fixed while maintaining
backward compatibility.)
.PP
\fR\f(CI$^X\fR\fI converted to an absolute path on FreeBSD, OS X and Solaris\fR
.IX Subsection "$^X converted to an absolute path on FreeBSD, OS X and Solaris"
.PP
\&\f(CW$^X\fR is now converted to an absolute path on OS X, FreeBSD (without
needing \fI/proc\fR mounted) and Solaris 10 and 11. This augments the
previous approach of using \fI/proc\fR on Linux, FreeBSD, and NetBSD
(in all cases, where mounted).
.PP
This makes relocatable perl installations more useful on these platforms.
(See "Relocatable \f(CW@INC\fR" in \fIINSTALL\fR)
.SS "Debugger Changes"
.IX Subsection "Debugger Changes"
\fIFeatures inside the debugger\fR
.IX Subsection "Features inside the debugger"
.PP
The current Perl's feature bundle is now enabled for commands entered
in the interactive debugger.
.PP
\fINew option for the debugger's \fR\f(BIt\fR\fI command\fR
.IX Subsection "New option for the debugger's t command"
.PP
The \fBt\fR command in the debugger, which toggles tracing mode, now
accepts a numeric argument that determines how many levels of subroutine
calls to trace.
.PP
\fR\f(CI\*(C`enable\*(C'\fR\fI and \fR\f(CI\*(C`disable\*(C'\fR\fI\fR
.IX Subsection "enable and disable"
.PP
The debugger now has \f(CW\*(C`disable\*(C'\fR and \f(CW\*(C`enable\*(C'\fR commands for disabling
existing breakpoints and re-enabling them. See perldebug.
.PP
\fIBreakpoints with file names\fR
.IX Subsection "Breakpoints with file names"
.PP
The debugger's "b" command for setting breakpoints now lets a line
number be prefixed with a file name. See
"b [file]:[line] [condition]" in perldebug.
.ie n .SS "The ""CORE"" Namespace"
.el .SS "The \f(CWCORE\fP Namespace"
.IX Subsection "The CORE Namespace"
\fIThe \fR\f(CI\*(C`CORE::\*(C'\fR\fI prefix\fR
.IX Subsection "The CORE:: prefix"
.PP
The \f(CW\*(C`CORE::\*(C'\fR prefix can now be used on keywords enabled by
feature.pm, even outside the scope of \f(CW\*(C`use feature\*(C'\fR.
.PP
\fISubroutines in the \fR\f(CI\*(C`CORE\*(C'\fR\fI namespace\fR
.IX Subsection "Subroutines in the CORE namespace"
.PP
Many Perl keywords are now available as subroutines in the CORE namespace.
This lets them be aliased:
.PP
.Vb 2
\& BEGIN { *entangle = \e&CORE::tie }
\& entangle $variable, $package, @args;
.Ve
.PP
And for prototypes to be bypassed:
.PP
.Vb 5
\& sub mytie(\e[%$*@]$@) {
\& my ($ref, $pack, @args) = @_;
\& ... do something ...
\& goto &CORE::tie;
\& }
.Ve
.PP
Some of these cannot be called through references or via \f(CW&foo\fR syntax,
but must be called as barewords.
.PP
See CORE for details.
.SS "Other Changes"
.IX Subsection "Other Changes"
\fIAnonymous handles\fR
.IX Subsection "Anonymous handles"
.PP
Automatically generated file handles are now named _\|_ANONIO_\|_ when the
variable name cannot be determined, rather than \f(CW$_\fR\|_ANONIO_\|_.
.PP
\fIAutoloaded sort Subroutines\fR
.IX Subsection "Autoloaded sort Subroutines"
.PP
Custom sort subroutines can now be autoloaded [perl #30661]:
.PP
.Vb 2
\& sub AUTOLOAD { ... }
\& @sorted = sort foo @list; # uses AUTOLOAD
.Ve
.PP
\fR\f(CI\*(C`continue\*(C'\fR\fI no longer requires the "switch" feature\fR
.IX Subsection "continue no longer requires the ""switch"" feature"
.PP
The \f(CW\*(C`continue\*(C'\fR keyword has two meanings. It can introduce a \f(CW\*(C`continue\*(C'\fR
block after a loop, or it can exit the current \f(CW\*(C`when\*(C'\fR block. Up to now,
the latter meaning was valid only 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
\&\f(CW\*(C`continue\*(C'\fR to depend on it.
.PP
\fIDTrace probes for interpreter phase change\fR
.IX Subsection "DTrace probes for interpreter phase change"
.PP
The \f(CW\*(C`phase\-change\*(C'\fR probes will fire when the interpreter's phase
changes, which tracks the \f(CW\*(C`${^GLOBAL_PHASE}\*(C'\fR variable. \f(CW\*(C`arg0\*(C'\fR is
the new phase name; \f(CW\*(C`arg1\*(C'\fR is the old one. This is useful
for limiting your instrumentation to one or more of: compile time,
run time, or destruct time.
.PP
\fR\f(CI\*(C`_\|_FILE_\|_()\*(C'\fR\fI Syntax\fR
.IX Subsection "__FILE__() Syntax"
.PP
The \f(CW\*(C`_\|_FILE_\|_\*(C'\fR, \f(CW\*(C`_\|_LINE_\|_\*(C'\fR and \f(CW\*(C`_\|_PACKAGE_\|_\*(C'\fR tokens can now be written
with an empty pair of parentheses after them. This makes them parse the
same way as \f(CW\*(C`time\*(C'\fR, \f(CW\*(C`fork\*(C'\fR and other built-in functions.
.PP
\fIThe \fR\f(CI\*(C`\e$\*(C'\fR\fI prototype accepts any scalar lvalue\fR
.IX Subsection "The $ prototype accepts any scalar lvalue"
.PP
The \f(CW\*(C`\e$\*(C'\fR and \f(CW\*(C`\e[$]\*(C'\fR subroutine prototypes now accept any scalar lvalue
argument. Previously they accepted only scalars beginning with \f(CW\*(C`$\*(C'\fR and
hash and array elements. This change makes them consistent with the way
the built-in \f(CW\*(C`read\*(C'\fR and \f(CW\*(C`recv\*(C'\fR 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.
.PP
\fR\f(CI\*(C`_\*(C'\fR\fI in subroutine prototypes\fR
.IX Subsection "_ in subroutine prototypes"
.PP
The \f(CW\*(C`_\*(C'\fR character in subroutine prototypes is now allowed before \f(CW\*(C`@\*(C'\fR or
\&\f(CW\*(C`%\*(C'\fR.
.SH Security
.IX Header "Security"
.ie n .SS "Use is_utf8_char_buf() and not is_utf8_char()"
.el .SS "Use \f(CWis_utf8_char_buf()\fP and not \f(CWis_utf8_char()\fP"
.IX Subsection "Use is_utf8_char_buf() and not is_utf8_char()"
The latter function is now deprecated because its API is insufficient to
guarantee that it doesn't read (up to 12 bytes in the worst case) beyond
the end of its input string. See
\&\fBis_utf8_char_buf()\fR.
.SS "Malformed UTF\-8 input could cause attempts to read beyond the end of the buffer"
.IX Subsection "Malformed UTF-8 input could cause attempts to read beyond the end of the buffer"
Two new XS-accessible functions, \f(CWutf8_to_uvchr_buf()\fR and
\&\f(CWutf8_to_uvuni_buf()\fR are now available to prevent this, and the Perl
core has been converted to use them.
See "Internal Changes".
.ie n .SS "File::Glob::bsd_glob() memory error with GLOB_ALTDIRFUNC (CVE\-2011\-2728)."
.el .SS "\f(CWFile::Glob::bsd_glob()\fP memory error with GLOB_ALTDIRFUNC (CVE\-2011\-2728)."
.IX Subsection "File::Glob::bsd_glob() memory error with GLOB_ALTDIRFUNC (CVE-2011-2728)."
Calling \f(CW\*(C`File::Glob::bsd_glob\*(C'\fR 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. (5.14.2)
.ie n .SS "Privileges are now set correctly when assigning to $("
.el .SS "Privileges are now set correctly when assigning to \f(CW$(\fP"
.IX Subsection "Privileges are now set correctly when assigning to $("
A hypothetical bug (probably unexploitable in practice) because the
incorrect setting of the effective group ID while setting \f(CW$(\fR has been
fixed. The bug would have affected only systems that have \f(CWsetresgid()\fR
but not \f(CWsetregid()\fR, but no such systems are known to exist.
.SH Deprecations
.IX Header "Deprecations"
.SS "Don't read the Unicode data base files in \fIlib/unicore\fP"
.IX Subsection "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 \fIlib/unicore\fR directory. Instead, you should
use the new functions in Unicode::UCD. These provide a stable API,
and give complete information.
.PP
Perl may at some point in the future change or remove these files. The
file which applications were most likely to have used is
\&\fIlib/unicore/ToDigit.pl\fR. "\fBprop_invmap()\fR" in Unicode::UCD can be used to
get at its data instead.
.ie n .SS "XS functions is_utf8_char(), utf8_to_uvchr() and utf8_to_uvuni()"
.el .SS "XS functions \f(CWis_utf8_char()\fP, \f(CWutf8_to_uvchr()\fP and \f(CWutf8_to_uvuni()\fP"
.IX Subsection "XS functions is_utf8_char(), utf8_to_uvchr() and utf8_to_uvuni()"
This function is deprecated because it could read beyond the end of the
input string. Use the new \fBis_utf8_char_buf()\fR,
\&\f(CWutf8_to_uvchr_buf()\fR and \f(CWutf8_to_uvuni_buf()\fR instead.
.SH "Future Deprecations"
.IX Header "Future Deprecations"
This section serves as a notice of features that are \fIlikely\fR to be
removed or 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.
.SS "Core Modules"
.IX Subsection "Core Modules"
These modules may be marked as deprecated \fIfrom the core\fR. This only
means that they will no longer be installed by default with the core
distribution, but will remain available on the CPAN.
.IP \(bu 4
CPANPLUS
.IP \(bu 4
Filter::Simple
.IP \(bu 4
PerlIO::mmap
.IP \(bu 4
Pod::LaTeX
.IP \(bu 4
Pod::Parser
.IP \(bu 4
SelfLoader
.IP \(bu 4
Text::Soundex
.IP \(bu 4
Thread.pm
.SS "Platforms with no supporting programmers"
.IX Subsection "Platforms with no supporting programmers"
These platforms will probably have their
special build support removed during the
5.17.0 development series.
.IP \(bu 4
BeOS
.IP \(bu 4
djgpp
.IP \(bu 4
dgux
.IP \(bu 4
EPOC
.IP \(bu 4
MPE/iX
.IP \(bu 4
Rhapsody
.IP \(bu 4
UTS
.IP \(bu 4
VM/ESA
.SS "Other Future Deprecations"
.IX Subsection "Other Future Deprecations"
.IP \(bu 4
Swapping of $< and $>
.Sp
For more information about this future deprecation, see the relevant RT
ticket .
.IP \(bu 4
sfio, stdio
.Sp
Perl supports being built without PerlIO proper, using a stdio or sfio
wrapper instead. A perl build like this will not support IO layers and
thus Unicode IO, making it rather handicapped.
.Sp
PerlIO supports a \f(CW\*(C`stdio\*(C'\fR layer if stdio use is desired, and similarly a
sfio layer could be produced.
.IP \(bu 4
Unescaped literal \f(CW"{"\fR in regular expressions.
.Sp
Starting with v5.20, it is planned to require a literal \f(CW"{"\fR to be
escaped, for example by preceding it with a backslash. In v5.18, a
deprecated warning message will be emitted for all such uses.
This affects only patterns that are to match a literal \f(CW"{"\fR. Other
uses of this character, such as part of a quantifier or sequence as in
those below, are completely unaffected:
.Sp
.Vb 3
\& /foo{3,5}/
\& /\ep{Alphabetic}/
\& /\eN{DIGIT ZERO}
.Ve
.Sp
Removing this will permit extensions to Perl's pattern syntax and better
error checking for existing syntax. See "Quantifiers" in perlre for an
example.
.IP \(bu 4
Revamping \f(CW"\eQ"\fR semantics in double-quotish strings when combined with other escapes.
.Sp
There are several bugs and inconsistencies involving combinations
of \f(CW\*(C`\eQ\*(C'\fR and escapes like \f(CW\*(C`\ex\*(C'\fR, \f(CW\*(C`\eL\*(C'\fR, etc., within a \f(CW\*(C`\eQ...\eE\*(C'\fR pair.
These need to be fixed, and doing so will necessarily change current
behavior. The changes have not yet been settled.
.SH "Incompatible Changes"
.IX Header "Incompatible Changes"
.SS "Special blocks called in void context"
.IX Subsection "Special blocks called in void context"
Special blocks (\f(CW\*(C`BEGIN\*(C'\fR, \f(CW\*(C`CHECK\*(C'\fR, \f(CW\*(C`INIT\*(C'\fR, \f(CW\*(C`UNITCHECK\*(C'\fR, \f(CW\*(C`END\*(C'\fR) are now
called in void context. This avoids wasteful copying of the result of the
last statement [perl #108794].
.ie n .SS "The ""overloading"" pragma and regexp objects"
.el .SS "The \f(CWoverloading\fP pragma and regexp objects"
.IX Subsection "The overloading pragma and regexp objects"
With \f(CW\*(C`no overloading\*(C'\fR, regular expression objects returned by \f(CW\*(C`qr//\*(C'\fR are
now stringified as "Regexp=REGEXP(0xbe600d)" instead of the regular
expression itself [perl #108780].
.SS "Two XS typemap Entries removed"
.IX Subsection "Two XS typemap Entries removed"
Two presumably unused XS typemap entries have been removed from the
core typemap: T_DATAUNIT and T_CALLBACK. If you are, against all odds,
a user of these, please see the instructions on how to restore them
in perlxstypemap.
.SS "Unicode 6.1 has incompatibilities with Unicode 6.0"
.IX Subsection "Unicode 6.1 has incompatibilities with Unicode 6.0"
These are detailed in "Supports (almost) Unicode 6.1" above.
You can compile this version of Perl to use Unicode 6.0. See
"Hacking Perl to work on earlier Unicode versions (for very serious hackers only)" in perlunicode.
.SS "Borland compiler"
.IX Subsection "Borland compiler"
All support for the Borland compiler has been dropped. The code had not
worked for a long time anyway.
.SS "Certain deprecated Unicode properties are no longer supported by default"
.IX Subsection "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.
.PP
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.
.SS "Dereferencing IO thingies as typeglobs"
.IX Subsection "Dereferencing IO thingies as typeglobs"
The \f(CW\*(C`*{...}\*(C'\fR operator, when passed a reference to an IO thingy (as in
\&\f(CW\*(C`*{*STDIN{IO}}\*(C'\fR), 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.
Now it stringifies as _\|_ANONIO_\|_ [perl #96326].
.SS "User-defined case-changing operations"
.IX Subsection "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:
.SS "XSUBs are now 'static'"
.IX Subsection "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 \f(CWXS_EXTERNAL(name)\fR
and \f(CWXS_INTERNAL(name)\fR macros to pick the desired linking behavior.
The ordinary \f(CWXS(name)\fR declaration for XSUBs will continue to declare
non\-'static' XSUBs for compatibility, but the XS compiler,
ExtUtils::ParseXS (\f(CW\*(C`xsubpp\*(C'\fR) will emit 'static' XSUBs by default.
ExtUtils::ParseXS's behavior can be reconfigured from XS using the
\&\f(CW\*(C`EXPORT_XSUB_SYMBOLS\*(C'\fR keyword. See perlxs for details.
.SS "Weakening read-only references"
.IX Subsection "Weakening read-only references"
Weakening read-only references is no longer permitted. It should never
have worked anyway, and could sometimes result in crashes.
.SS "Tying scalars that hold typeglobs"
.IX Subsection "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 \f(CW\*(C`tied\*(C'\fR and
\&\f(CW\*(C`untie\*(C'\fR: \f(CW\*(C`tied $scalar\*(C'\fR would return false on a tied scalar if the last
thing returned was a typeglob, and \f(CW\*(C`untie $scalar\*(C'\fR on such a tied scalar
would do nothing.
.PP
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.
.PP
Now the deprecation has been removed and this bug has been fixed. So
\&\f(CW\*(C`tie $scalar\*(C'\fR will always tie the scalar, not the handle it holds. To tie
the handle, use \f(CW\*(C`tie *$scalar\*(C'\fR (with an explicit asterisk). The same
applies to \f(CW\*(C`tied *$scalar\*(C'\fR and \f(CW\*(C`untie *$scalar\*(C'\fR.
.ie n .SS "IPC::Open3 no longer provides xfork(), xclose_on_exec() and xpipe_anon()"
.el .SS "IPC::Open3 no longer provides \f(CWxfork()\fP, \f(CWxclose_on_exec()\fP and \f(CWxpipe_anon()\fP"
.IX Subsection "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.
.ie n .SS "$$ no longer caches PID"
.el .SS "\f(CW$$\fP no longer caches PID"
.IX Subsection "$$ no longer caches PID"
Previously, if one called \fBfork\fR\|(3) from C, Perl's
notion of \f(CW$$\fR could go out of sync with what \fBgetpid()\fR returns. By always
fetching the value of \f(CW$$\fR via \fBgetpid()\fR, this potential bug is eliminated.
Code that depends on the caching behavior will break. As described in
Core Enhancements,
\&\f(CW$$\fR is now writable, but it will be reset during a
fork.
.ie n .SS "$$ and getppid() no longer emulate POSIX semantics under LinuxThreads"
.el .SS "\f(CW$$\fP and \f(CWgetppid()\fP no longer emulate POSIX semantics under LinuxThreads"
.IX Subsection "$$ and getppid() no longer emulate POSIX semantics under LinuxThreads"
The POSIX emulation of \f(CW$$\fR and \f(CWgetppid()\fR under the obsolete
LinuxThreads implementation has been removed.
This only impacts users of Linux 2.4 and
users of Debian GNU/kFreeBSD up to and including 6.0, not the vast
majority of Linux installations that use NPTL threads.
.PP
This means that \f(CWgetppid()\fR, like \f(CW$$\fR, is now always guaranteed to
return the OS's idea of the current state of the process, not perl's
cached version of it.
.PP
See the documentation for $$ for details.
.ie n .SS "$<, $>, $( and $) are no longer cached"
.el .SS "\f(CW$<\fP, \f(CW$>\fP, \f(CW$(\fP and \f(CW$)\fP are no longer cached"
.IX Subsection "$<, $>, $( and $) are no longer cached"
Similarly to the changes to \f(CW$$\fR and \f(CWgetppid()\fR, the internal
caching of \f(CW$<\fR, \f(CW$>\fR, \f(CW$(\fR and \f(CW$)\fR has been removed.
.PP
When we cached these values our idea of what they were would drift out
of sync with reality if someone (e.g., someone embedding perl) called
\&\f(CW\*(C`sete?[ug]id()\*(C'\fR without updating \f(CW\*(C`PL_e?[ug]id\*(C'\fR. Having to deal with
this complexity wasn't worth it given how cheap the \f(CW\*(C`gete?[ug]id()\*(C'\fR
system call is.
.PP
This change will break a handful of CPAN modules that use the XS-level
\&\f(CW\*(C`PL_uid\*(C'\fR, \f(CW\*(C`PL_gid\*(C'\fR, \f(CW\*(C`PL_euid\*(C'\fR or \f(CW\*(C`PL_egid\*(C'\fR variables.
.PP
The fix for those breakages is to use \f(CW\*(C`PerlProc_gete?[ug]id()\*(C'\fR to
retrieve them (e.g., \f(CWPerlProc_getuid()\fR), and not to assign to
\&\f(CW\*(C`PL_e?[ug]id\*(C'\fR if you change the UID/GID/EUID/EGID. There is no longer
any need to do so since perl will always retrieve the up-to-date
version of those values from the OS.
.ie n .SS "Which Non-ASCII characters get quoted by ""quotemeta"" and ""\eQ"" has changed"
.el .SS "Which Non-ASCII characters get quoted by \f(CWquotemeta\fP and \f(CW\eQ\fP has changed"
.IX Subsection "Which Non-ASCII characters get quoted by quotemeta and Q has changed"
This is unlikely to result in a real problem, as Perl does not attach
special meaning to any non-ASCII character, so it is currently
irrelevant which are quoted or not. This change fixes bug [perl #77654] and
brings Perl's behavior more into line with Unicode's recommendations.
See "quotemeta" in perlfunc.
.SH "Performance Enhancements"
.IX Header "Performance Enhancements"
.IP \(bu 4
Improved performance for Unicode properties in regular expressions
.Sp
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, \f(CW\*(C`qr/\ep{foo}abc\ep{foo}/\*(C'\fR
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.
Now, however, there is just one hash shared by all instances of a given
property. This means that if \f(CW\*(C`\ep{foo}\*(C'\fR 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.
.IP \(bu 4
Version declarations with the \f(CW\*(C`use\*(C'\fR keyword (e.g., \f(CW\*(C`use 5.012\*(C'\fR) are now
faster, as they enable features without loading \fIfeature.pm\fR.
.IP \(bu 4
\&\f(CW\*(C`local $_\*(C'\fR is faster now, as it no longer iterates through magic that it
is not going to copy anyway.
.IP \(bu 4
Perl 5.12.0 sped up the destruction of objects whose classes define
empty \f(CW\*(C`DESTROY\*(C'\fR methods (to prevent autoloading), by simply not
calling such empty methods. This release takes this optimization a
step further, by not calling any \f(CW\*(C`DESTROY\*(C'\fR method that begins with a
\&\f(CW\*(C`return\*(C'\fR statement. This can be useful for destructors that are only
used for debugging:
.Sp
.Vb 2
\& use constant DEBUG => 1;
\& sub DESTROY { return unless DEBUG; ... }
.Ve
.Sp
Constant-folding will reduce the first statement to \f(CW\*(C`return;\*(C'\fR if DEBUG
is set to 0, triggering this optimization.
.IP \(bu 4
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.
.IP \(bu 4
Assignment to \f(CW\*(C`substr\*(C'\fR 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, \f(CW\*(C`substr\*(C'\fR modifies the original string
itself.
.IP \(bu 4
\&\f(CW\*(C`substr\*(C'\fR no longer calculates a value to return when called in void
context.
.IP \(bu 4
Due to changes in File::Glob, Perl's \f(CW\*(C`glob\*(C'\fR function and its \f(CW\*(C`<...>\*(C'\fR equivalent are now much faster. The splitting of the pattern
into words has been rewritten in C, resulting in speed-ups of 20% for
some cases.
.Sp
This does not affect \f(CW\*(C`glob\*(C'\fR on VMS, as it does not use File::Glob.
.IP \(bu 4
The short-circuiting operators \f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, and \f(CW\*(C`//\*(C'\fR, when chained
(such as \f(CW\*(C`$a || $b || $c\*(C'\fR), are now considerably faster to short-circuit,
due to reduced optree traversal.
.IP \(bu 4
The implementation of \f(CW\*(C`s///r\*(C'\fR makes one fewer copy of the scalar's value.
.IP \(bu 4
Recursive calls to lvalue subroutines in lvalue scalar context use less
memory.
.SH "Modules and Pragmata"
.IX Header "Modules and Pragmata"
.SS "Deprecated Modules"
.IX Subsection "Deprecated Modules"
.IP Version::Requirements 4
.IX Item "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.
.SS "New Modules and Pragmata"
.IX Subsection "New Modules and Pragmata"
.IP \(bu 4
arybase \-\- this new module implements the \f(CW$[\fR variable.
.IP \(bu 4
PerlIO::mmap 0.010 has been added to the Perl core.
.Sp
The \f(CW\*(C`mmap\*(C'\fR PerlIO layer is no longer implemented by perl itself, but has
been moved out into the new PerlIO::mmap module.
.SS "Updated Modules and Pragmata"
.IX Subsection "Updated Modules and Pragmata"
This is only an overview of selected module updates. For a complete list of
updates, run:
.PP
.Vb 1
\& $ corelist \-\-diff 5.14.0 5.16.0
.Ve
.PP
You can substitute your favorite version in place of 5.14.0, too.
.IP \(bu 4
Archive::Extract has been upgraded from version 0.48 to 0.58.
.Sp
Includes a fix for FreeBSD to only use \f(CW\*(C`unzip\*(C'\fR if it is located in
\&\f(CW\*(C`/usr/local/bin\*(C'\fR, as FreeBSD 9.0 will ship with a limited \f(CW\*(C`unzip\*(C'\fR in
\&\f(CW\*(C`/usr/bin\*(C'\fR.
.IP \(bu 4
Archive::Tar has been upgraded from version 1.76 to 1.82.
.Sp
Adjustments to handle files >8gb (>0777777777777 octal) and a feature
to return the MD5SUM of files in the archive.
.IP \(bu 4
base has been upgraded from version 2.16 to 2.18.
.Sp
\&\f(CW\*(C`base\*(C'\fR no longer sets a module's \f(CW$VERSION\fR to "\-1" when a module it
loads does not define a \f(CW$VERSION\fR. This change has been made because
"\-1" is not a valid version number under the new "lax" criteria used
internally by \f(CW\*(C`UNIVERSAL::VERSION\*(C'\fR. (See version for more on "lax"
version criteria.)
.Sp
\&\f(CW\*(C`base\*(C'\fR no longer internally skips loading modules it has already loaded
and instead relies on \f(CW\*(C`require\*(C'\fR to inspect \f(CW%INC\fR. This fixes a bug
when \f(CW\*(C`base\*(C'\fR is used with code that clear \f(CW%INC\fR to force a module to
be reloaded.
.IP \(bu 4
Carp has been upgraded from version 1.20 to 1.26.
.Sp
It now includes last read filehandle info and puts a dot after the file
and line number, just like errors from \f(CW\*(C`die\*(C'\fR [perl #106538].
.IP \(bu 4
charnames has been updated from version 1.18 to 1.30.
.Sp
\&\f(CW\*(C`charnames\*(C'\fR can now be invoked with a new option, \f(CW\*(C`:loose\*(C'\fR,
which is like the existing \f(CW\*(C`:full\*(C'\fR option, but enables Unicode loose
name matching. Details are in "LOOSE MATCHES" in charnames.
.IP \(bu 4
B::Deparse has been upgraded from version 1.03 to 1.14. This fixes
numerous deparsing bugs.
.IP \(bu 4
CGI has been upgraded from version 3.52 to 3.59.
.Sp
It uses the public and documented FCGI.pm API in CGI::Fast. CGI::Fast was
using an FCGI API that was deprecated and removed from documentation
more than ten years ago. Usage of this deprecated API with FCGI >=
0.70 or FCGI <= 0.73 introduces a security issue.
.Sp
Things that may break your code:
.Sp
\&\f(CWurl()\fR was fixed to return \f(CW\*(C`PATH_INFO\*(C'\fR when it is explicitly requested
with either the \f(CW\*(C`path=>1\*(C'\fR or \f(CW\*(C`path_info=>1\*(C'\fR flag.
.Sp
If your code is running under mod_rewrite (or compatible) and you are
calling \f(CWself_url()\fR or you are calling \f(CWurl()\fR and passing
\&\f(CW\*(C`path_info=>1\*(C'\fR, these methods will actually be returning
\&\f(CW\*(C`PATH_INFO\*(C'\fR now, as you have explicitly requested or \f(CWself_url()\fR
has requested on your behalf.
.Sp
The \f(CW\*(C`PATH_INFO\*(C'\fR has been omitted in such URLs since the issue was
introduced in the 3.12 release in December, 2005.
.Sp
This bug is so old your application may have come to depend on it or
workaround it. Check for application before upgrading to this release.
.Sp
Examples of affected method calls:
.Sp
.Vb 5
\& $q\->url(\-absolute => 1, \-query => 1, \-path_info => 1);
\& $q\->url(\-path=>1);
\& $q\->url(\-full=>1,\-path=>1);
\& $q\->url(\-rewrite=>1,\-path=>1);
\& $q\->self_url();
.Ve
.Sp
We no longer read from STDIN when the Content-Length is not set,
preventing requests with no Content-Length from sometimes freezing.
This is consistent with the CGI RFC 3875, and is also consistent with
CGI::Simple. However, the old behavior may have been expected by some
command-line uses of CGI.pm.
.Sp
In addition, the DELETE HTTP verb is now supported.
.IP \(bu 4
Compress::Zlib has been upgraded from version 2.035 to 2.048.
.Sp
IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA
(method 14). There is a fix for a CRC issue in IO::Compress::Unzip and
it supports Streamed Stored context now. And fixed a Zip64 issue in
IO::Compress::Zip when the content size was exactly 0xFFFFFFFF.
.IP \(bu 4
Digest::SHA has been upgraded from version 5.61 to 5.71.
.Sp
Added BITS mode to the addfile method and shasum. This makes
partial-byte inputs possible via files/STDIN and lets shasum check
all 8074 NIST Msg vectors, where previously special programming was
required to do this.
.IP \(bu 4
Encode has been upgraded from version 2.42 to 2.44.
.Sp
Missing aliases added, a deep recursion error fixed and various
documentation updates.
.Sp
Addressed 'decode_xs n\-byte heap\-overflow' security bug in Unicode.xs
(CVE\-2011\-2939). (5.14.2)
.IP \(bu 4
ExtUtils::CBuilder updated from version 0.280203 to 0.280206.
.Sp
The new version appends CFLAGS and LDFLAGS to their Config.pm
counterparts.
.IP \(bu 4
ExtUtils::ParseXS has been upgraded from version 2.2210 to 3.16.
.Sp
Much of ExtUtils::ParseXS, the module behind the XS compiler \f(CW\*(C`xsubpp\*(C'\fR,
was rewritten and cleaned up. It has been made somewhat more extensible
and now finally uses strictures.
.Sp
The typemap logic has been moved into a separate module,
ExtUtils::Typemaps. See "New Modules and Pragmata", above.
.Sp
For a complete set of changes, please see the ExtUtils::ParseXS
changelog, available on the CPAN.
.IP \(bu 4
File::Glob has been upgraded from version 1.12 to 1.17.
.Sp
On Windows, tilde (~) expansion now checks the \f(CW\*(C`USERPROFILE\*(C'\fR environment
variable, after checking \f(CW\*(C`HOME\*(C'\fR.
.Sp
It has a new \f(CW\*(C`:bsd_glob\*(C'\fR export tag, intended to replace \f(CW\*(C`:glob\*(C'\fR. Like
\&\f(CW\*(C`:glob\*(C'\fR it overrides \f(CW\*(C`glob\*(C'\fR with a function that does not split the glob
pattern into words, but, unlike \f(CW\*(C`:glob\*(C'\fR, it iterates properly in scalar
context, instead of returning the last file.
.Sp
There are other changes affecting Perl's own \f(CW\*(C`glob\*(C'\fR operator (which uses
File::Glob internally, except on VMS). See "Performance Enhancements"
and "Selected Bug Fixes".
.IP \(bu 4
FindBin updated from version 1.50 to 1.51.
.Sp
It no longer returns a wrong result if a script of the same name as the
current one exists in the path and is executable.
.IP \(bu 4
HTTP::Tiny has been upgraded from version 0.012 to 0.017.
.Sp
Added support for using \f(CW$ENV{http_proxy}\fR to set the default proxy host.
.Sp
Adds additional shorthand methods for all common HTTP verbs,
a \f(CWpost_form()\fR method for POST-ing x\-www-form-urlencoded data and
a \f(CWwww_form_urlencode()\fR utility method.
.IP \(bu 4
IO has been upgraded from version 1.25_04 to 1.25_06, and IO::Handle
from version 1.31 to 1.33.
.Sp
Together, these upgrades fix a problem with IO::Handle's \f(CW\*(C`getline\*(C'\fR and
\&\f(CW\*(C`getlines\*(C'\fR methods. When these methods are called on the special ARGV
handle, the next file is automatically opened, as happens with the built-in
\&\f(CW\*(C`<>\*(C'\fR and \f(CW\*(C`readline\*(C'\fR functions. But, unlike the built-ins, these
methods were not respecting the caller's use of the open pragma and
applying the appropriate I/O layers to the newly-opened file
[rt.cpan.org #66474].
.IP \(bu 4
IPC::Cmd has been upgraded from version 0.70 to 0.76.
.Sp
Capturing of command output (both \f(CW\*(C`STDOUT\*(C'\fR and \f(CW\*(C`STDERR\*(C'\fR) is now supported
using IPC::Open3 on MSWin32 without requiring IPC::Run.
.IP \(bu 4
IPC::Open3 has been upgraded from version 1.09 to 1.12.
.Sp
Fixes a bug which prevented use of \f(CW\*(C`open3\*(C'\fR on Windows when \f(CW*STDIN\fR,
\&\f(CW*STDOUT\fR or \f(CW*STDERR\fR had been localized.
.Sp
Fixes a bug which prevented duplicating numeric file descriptors on Windows.
.Sp
\&\f(CW\*(C`open3\*(C'\fR with "\-" for the program name works once more. This was broken in
version 1.06 (and hence in Perl 5.14.0) [perl #95748].
.IP \(bu 4
Locale::Codes has been upgraded from version 3.16 to 3.21.
.Sp
Added Language Extension codes (langext) and Language Variation codes (langvar)
as defined in the IANA language registry.
.Sp
Added language codes from ISO 639\-5
.Sp
Added language/script codes from the IANA language subtag registry
.Sp
Fixed an uninitialized value warning [rt.cpan.org #67438].
.Sp
Fixed the return value for the all_XXX_codes and all_XXX_names functions
[rt.cpan.org #69100].
.Sp
Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE to allow
for cleaner future additions. The original four modules (Locale::Language,
Locale::Currency, Locale::Country, Locale::Script) will continue to work, but
all new sets of codes will be added in the Locale::Codes namespace.
.Sp
The code2XXX, XXX2code, all_XXX_codes, and all_XXX_names functions now
support retired codes. All codesets may be specified by a constant or
by their name now. Previously, they were specified only by a constant.
.Sp
The alias_code function exists for backward compatibility. It has been
replaced by rename_country_code. The alias_code function will be
removed some time after September, 2013.
.Sp
All work is now done in the central module (Locale::Codes). Previously,
some was still done in the wrapper modules (Locale::Codes::*). Added
Language Family codes (langfam) as defined in ISO 639\-5.
.IP \(bu 4
Math::BigFloat has been upgraded from version 1.993 to 1.997.
.Sp
The \f(CW\*(C`numify\*(C'\fR method has been corrected to return a normalized Perl number
(the result of \f(CW\*(C`0 + $thing\*(C'\fR), instead of a string [rt.cpan.org #66732].
.IP \(bu 4
Math::BigInt has been upgraded from version 1.994 to 1.998.
.Sp
It provides a new \f(CW\*(C`bsgn\*(C'\fR method that complements the \f(CW\*(C`babs\*(C'\fR method.
.Sp
It fixes the internal \f(CW\*(C`objectify\*(C'\fR function's handling of "foreign objects"
so they are converted to the appropriate class (Math::BigInt or
Math::BigFloat).
.IP \(bu 4
Math::BigRat has been upgraded from version 0.2602 to 0.2603.
.Sp
\&\f(CWint()\fR on a Math::BigRat object containing \-1/2 now creates a
Math::BigInt containing 0, rather than \-0. Math::BigInt does not even
support negative zero, so the resulting object was actually malformed
[perl #95530].
.IP \(bu 4
Math::Complex has been upgraded from version 1.56 to 1.59
and Math::Trig from version 1.2 to 1.22.
.Sp
Fixes include: correct copy constructor usage; fix polarwise formatting with
numeric format specifier; and more stable \f(CW\*(C`great_circle_direction\*(C'\fR algorithm.
.IP \(bu 4
Module::CoreList has been upgraded from version 2.51 to 2.66.
.Sp
The \f(CW\*(C`corelist\*(C'\fR utility now understands the \f(CW\*(C`\-r\*(C'\fR option for displaying
Perl release dates and the \f(CW\*(C`\-\-diff\*(C'\fR option to print the set of modlib
changes between two perl distributions.
.IP \(bu 4
Module::Metadata has been upgraded from version 1.000004 to 1.000009.
.Sp
Adds \f(CW\*(C`provides\*(C'\fR method to generate a CPAN META provides data structure
correctly; use of \f(CW\*(C`package_versions_from_directory\*(C'\fR is discouraged.
.IP \(bu 4
ODBM_File has been upgraded from version 1.10 to 1.12.
.Sp
The XS code is now compiled with \f(CW\*(C`PERL_NO_GET_CONTEXT\*(C'\fR, which will aid
performance under ithreads.
.IP \(bu 4
open has been upgraded from version 1.08 to 1.10.
.Sp
It no longer turns off layers on standard handles when invoked without the
":std" directive. Similarly, when invoked \fIwith\fR the ":std" directive, it
now clears layers on STDERR before applying the new ones, and not just on
STDIN and STDOUT [perl #92728].
.IP \(bu 4
overload has been upgraded from version 1.13 to 1.18.
.Sp
\&\f(CW\*(C`overload::Overloaded\*(C'\fR no longer calls \f(CW\*(C`can\*(C'\fR on the class, but uses
another means to determine whether the object has overloading. It was
never correct for it to call \f(CW\*(C`can\*(C'\fR, as overloading does not respect
AUTOLOAD. So classes that autoload methods and implement \f(CW\*(C`can\*(C'\fR no longer
have to account for overloading [perl #40333].
.Sp
A warning is now produced for invalid arguments. See "New Diagnostics".
.IP \(bu 4
PerlIO::scalar has been upgraded from version 0.11 to 0.14.
.Sp
(This is the module that implements \f(CW\*(C`open $fh, \*(Aq>\*(Aq, \e$scalar\*(C'\fR.)
.Sp
It fixes a problem with \f(CW\*(C`open my $fh, ">", \e$scalar\*(C'\fR not working if
\&\f(CW$scalar\fR is a copy-on-write scalar. (5.14.2)
.Sp
It also fixes a hang that occurs with \f(CW\*(C`readline\*(C'\fR or \f(CW\*(C`<$fh>\*(C'\fR if a
typeglob has been assigned to \f(CW$scalar\fR [perl #92258].
.Sp
It no longer assumes during \f(CW\*(C`seek\*(C'\fR that \f(CW$scalar\fR is a string internally.
If it didn't crash, it was close to doing so [perl #92706]. Also, the
internal print routine no longer assumes that the position set by \f(CW\*(C`seek\*(C'\fR
is valid, but extends the string to that position, filling the intervening
bytes (between the old length and the seek position) with nulls
[perl #78980].
.Sp
Printing to an in-memory handle now works if the \f(CW$scalar\fR holds a reference,
stringifying the reference before modifying it. References used to be
treated as empty strings.
.Sp
Printing to an in-memory handle no longer crashes if the \f(CW$scalar\fR happens to
hold a number internally, but no string buffer.
.Sp
Printing to an in-memory handle no longer creates scalars that confuse
the regular expression engine [perl #108398].
.IP \(bu 4
Pod::Functions has been upgraded from version 1.04 to 1.05.
.Sp
\&\fIFunctions.pm\fR is now generated at perl build time from annotations in
\&\fIperlfunc.pod\fR. This will ensure that Pod::Functions and perlfunc
remain in synchronisation.
.IP \(bu 4
Pod::Html has been upgraded from version 1.11 to 1.1502.
.Sp
This is an extensive rewrite of Pod::Html to use Pod::Simple under
the hood. The output has changed significantly.
.IP \(bu 4
Pod::Perldoc has been upgraded from version 3.15_03 to 3.17.
.Sp
It corrects the search paths on VMS [perl #90640]. (5.14.1)
.Sp
The \fB\-v\fR option now fetches the right section for \f(CW$0\fR.
.Sp
This upgrade has numerous significant fixes. Consult its changelog on
the CPAN for more information.
.IP \(bu 4
POSIX has been upgraded from version 1.24 to 1.30.
.Sp
POSIX no longer uses AutoLoader. Any code which was relying on this
implementation detail was buggy, and may fail because of this change.
The module's Perl code has been considerably simplified, roughly halving
the number of lines, with no change in functionality. The XS code has
been refactored to reduce the size of the shared object by about 12%,
with no change in functionality. More POSIX functions now have tests.
.Sp
\&\f(CW\*(C`sigsuspend\*(C'\fR and \f(CW\*(C`pause\*(C'\fR now run signal handlers before returning, as the
whole point of these two functions is to wait until a signal has
arrived, and then return \fIafter\fR it has been triggered. Delayed, or
"safe", signals were preventing that from happening, possibly resulting in
race conditions [perl #107216].
.Sp
\&\f(CW\*(C`POSIX::sleep\*(C'\fR is now a direct call into the underlying OS \f(CW\*(C`sleep\*(C'\fR
function, instead of being a Perl wrapper on \f(CW\*(C`CORE::sleep\*(C'\fR.
\&\f(CW\*(C`POSIX::dup2\*(C'\fR now returns the correct value on Win32 (\fIi.e.\fR, the file
descriptor). \f(CW\*(C`POSIX::SigSet\*(C'\fR \f(CW\*(C`sigsuspend\*(C'\fR and \f(CW\*(C`sigpending\*(C'\fR and
\&\f(CW\*(C`POSIX::pause\*(C'\fR now dispatch safe signals immediately before returning to
their caller.
.Sp
\&\f(CW\*(C`POSIX::Termios::setattr\*(C'\fR now defaults the third argument to \f(CW\*(C`TCSANOW\*(C'\fR,
instead of 0. On most platforms \f(CW\*(C`TCSANOW\*(C'\fR is defined to be 0, but on some
0 is not a valid parameter, which caused a call with defaults to fail.
.IP \(bu 4
Socket has been upgraded from version 1.94 to 2.001.
.Sp
It has new functions and constants for handling IPv6 sockets:
.Sp
.Vb 11
\& pack_ipv6_mreq
\& unpack_ipv6_mreq
\& IPV6_ADD_MEMBERSHIP
\& IPV6_DROP_MEMBERSHIP
\& IPV6_MTU
\& IPV6_MTU_DISCOVER
\& IPV6_MULTICAST_HOPS
\& IPV6_MULTICAST_IF
\& IPV6_MULTICAST_LOOP
\& IPV6_UNICAST_HOPS
\& IPV6_V6ONLY
.Ve
.IP \(bu 4
Storable has been upgraded from version 2.27 to 2.34.
.Sp
It no longer turns copy-on-write scalars into read-only scalars when
freezing and thawing.
.IP \(bu 4
Sys::Syslog has been upgraded from version 0.27 to 0.29.
.Sp
This upgrade closes many outstanding bugs.
.IP \(bu 4
Term::ANSIColor has been upgraded from version 3.00 to 3.01.
.Sp
Only interpret an initial array reference as a list of colors, not any initial
reference, allowing the colored function to work properly on objects with
stringification defined.
.IP \(bu 4
Term::ReadLine has been upgraded from version 1.07 to 1.09.
.Sp
Term::ReadLine now supports any event loop, including unpublished ones and
simple IO::Select, loops without the need to rewrite existing code for
any particular framework [perl #108470].
.IP \(bu 4
threads::shared has been upgraded from version 1.37 to 1.40.
.Sp
Destructors on shared objects used to be ignored sometimes if the objects
were referenced only by shared data structures. This has been mostly
fixed, but destructors may still be ignored if the objects still exist at
global destruction time [perl #98204].
.IP \(bu 4
Unicode::Collate has been upgraded from version 0.73 to 0.89.
.Sp
Updated to CLDR 1.9.1
.Sp
Locales updated to CLDR 2.0: mk, mt, nb, nn, ro, ru, sk, sr, sv, uk,
zh_\|_pinyin, zh_\|_stroke
.Sp
Newly supported locales: bn, fa, ml, mr, or, pa, sa, si, si_\|_dictionary,
sr_Latn, sv_\|_reformed, ta, te, th, ur, wae.
.Sp
Tailored compatibility ideographs as well as unified ideographs for the
locales: ja, ko, zh_\|_big5han, zh_\|_gb2312han, zh_\|_pinyin, zh_\|_stroke.
.Sp
Locale/*.pl files are now searched for in \f(CW@INC\fR.
.IP \(bu 4
Unicode::Normalize has been upgraded from version 1.10 to 1.14.
.Sp
Fixes for the removal of \fIunicore/CompositionExclusions.txt\fR from core.
.IP \(bu 4
Unicode::UCD has been upgraded from version 0.32 to 0.43.
.Sp
This adds four new functions: \f(CWprop_aliases()\fR and
\&\f(CWprop_value_aliases()\fR, which are used to find all Unicode-approved
synonyms for property names, or to convert from one name to another;
\&\f(CW\*(C`prop_invlist\*(C'\fR which returns all code points matching a given
Unicode binary property; and \f(CW\*(C`prop_invmap\*(C'\fR which returns the complete
specification of a given Unicode property.
.IP \(bu 4
Win32API::File has been upgraded from version 0.1101 to 0.1200.
.Sp
Added SetStdHandle and GetStdHandle functions
.SS "Removed Modules and Pragmata"
.IX Subsection "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.
.IP \(bu 4
Devel::DProf has been removed from the Perl core. Prior version was
20110228.00.
.IP \(bu 4
Shell has been removed from the Perl core. Prior version was 0.72_01.
.IP \(bu 4
Several old perl4\-style libraries which have been deprecated with 5.14
are now removed:
.Sp
.Vb 5
\& abbrev.pl assert.pl bigfloat.pl bigint.pl bigrat.pl cacheout.pl
\& complete.pl ctime.pl dotsh.pl exceptions.pl fastcwd.pl flush.pl
\& getcwd.pl getopt.pl getopts.pl hostname.pl importenv.pl
\& lib/find{,depth}.pl look.pl newgetopt.pl open2.pl open3.pl
\& pwd.pl shellwords.pl stat.pl tainted.pl termcap.pl timelocal.pl
.Ve
.Sp
They can be found on CPAN as Perl4::CoreLibs.
.SH Documentation
.IX Header "Documentation"
.SS "New Documentation"
.IX Subsection "New Documentation"
\fIperldtrace\fR
.IX Subsection "perldtrace"
.PP
perldtrace describes Perl's DTrace support, listing the provided probes
and gives examples of their use.
.PP
\fIperlexperiment\fR
.IX Subsection "perlexperiment"
.PP
This document is intended to provide a list of experimental features in
Perl. It is still a work in progress.
.PP
\fIperlootut\fR
.IX Subsection "perlootut"
.PP
This a new OO tutorial. It focuses on basic OO concepts, and then recommends
that readers choose an OO framework from CPAN.
.PP
\fIperlxstypemap\fR
.IX Subsection "perlxstypemap"
.PP
The new manual describes the XS typemapping mechanism in unprecedented
detail and combines new documentation with information extracted from
perlxs and the previously unofficial list of all core typemaps.
.SS "Changes to Existing Documentation"
.IX Subsection "Changes to Existing Documentation"
\fIperlapi\fR
.IX Subsection "perlapi"
.IP \(bu 4
The HV API has long accepted negative lengths to show that the key is
in UTF8. This is now documented.
.IP \(bu 4
The \f(CWboolSV()\fR macro is now documented.
.PP
\fIperlfunc\fR
.IX Subsection "perlfunc"
.IP \(bu 4
\&\f(CW\*(C`dbmopen\*(C'\fR 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].
.IP \(bu 4
As an accident of history, \f(CW\*(C`open $fh, \*(Aq<:\*(Aq, ...\*(C'\fR applies the default
layers for the platform (\f(CW\*(C`:raw\*(C'\fR on Unix, \f(CW\*(C`:crlf\*(C'\fR on Windows), ignoring
whatever is declared by open.pm. This seems such a useful feature
it has been documented in perlfunc and open.
.IP \(bu 4
The entry for \f(CW\*(C`split\*(C'\fR has been rewritten. It is now far clearer than
before.
.PP
\fIperlguts\fR
.IX Subsection "perlguts"
.IP \(bu 4
A new section, Autoloading with XSUBs,
has been added, which explains the two APIs for accessing the name of the
autoloaded sub.
.IP \(bu 4
Some 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].
.PP
\fIperlobj\fR
.IX Subsection "perlobj"
.IP \(bu 4
This document has been rewritten from scratch, and its coverage of various OO
concepts has been expanded.
.PP
\fIperlop\fR
.IX Subsection "perlop"
.IP \(bu 4
Documentation of the smartmatch operator has been reworked and moved from
perlsyn to perlop where it belongs.
.Sp
It has also been corrected for the case of \f(CW\*(C`undef\*(C'\fR on the left-hand
side. The list of different smart match behaviors had an item in the
wrong place.
.IP \(bu 4
Documentation of the ellipsis statement (\f(CW\*(C`...\*(C'\fR) has been reworked and
moved from perlop to perlsyn.
.IP \(bu 4
The explanation of bitwise operators has been expanded to explain how they
work on Unicode strings (5.14.1).
.IP \(bu 4
More examples for \f(CW\*(C`m//g\*(C'\fR have been added (5.14.1).
.IP \(bu 4
The \f(CW\*(C`<<\eFOO\*(C'\fR here-doc syntax has been documented (5.14.1).
.PP
\fIperlpragma\fR
.IX Subsection "perlpragma"
.IP \(bu 4
There is now a standard convention for naming keys in the \f(CW\*(C`%^H\*(C'\fR,
documented under Key naming.
.PP
\fI"Laundering and Detecting Tainted Data" in perlsec\fR
.IX Subsection """Laundering and Detecting Tainted Data"" in perlsec"
.IP \(bu 4
The example function for checking for taintedness contained a subtle
error. \f(CW$@\fR 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.
.PP
\fIperllol\fR
.IX Subsection "perllol"
.IP \(bu 4
perllol has been expanded with examples using the new \f(CW\*(C`push $scalar\*(C'\fR
syntax introduced in Perl 5.14.0 (5.14.1).
.PP
\fIperlmod\fR
.IX Subsection "perlmod"
.IP \(bu 4
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].
.PP
\fIperlpodstyle\fR
.IX Subsection "perlpodstyle"
.IP \(bu 4
The tips on which formatting codes to use have been corrected and greatly
expanded.
.IP \(bu 4
There are now a couple of example one-liners for previewing POD files after
they have been edited.
.PP
\fIperlre\fR
.IX Subsection "perlre"
.IP \(bu 4
The \f(CW\*(C`(*COMMIT)\*(C'\fR directive is now listed in the right section
(Verbs without an argument).
.PP
\fIperlrun\fR
.IX Subsection "perlrun"
.IP \(bu 4
perlrun has undergone a significant clean-up. Most notably, the
\&\fB\-0x...\fR form of the \fB\-0\fR flag has been clarified, and the final section
on environment variables has been corrected and expanded (5.14.1).
.PP
\fIperlsub\fR
.IX Subsection "perlsub"
.IP \(bu 4
The ($;) prototype syntax, which has existed for rather a long time, is now
documented in perlsub. It lets a unary function have the same
precedence as a list operator.
.PP
\fIperltie\fR
.IX Subsection "perltie"
.IP \(bu 4
The required syntax for tying handles has been documented.
.PP
\fIperlvar\fR
.IX Subsection "perlvar"
.IP \(bu 4
The documentation for $! has been corrected and clarified.
It used to state that $! could be \f(CW\*(C`undef\*(C'\fR, which is not the case. It was
also unclear whether system calls set C's \f(CW\*(C`errno\*(C'\fR or Perl's \f(CW$!\fR
[perl #91614].
.IP \(bu 4
Documentation for $$ has been amended with additional
cautions regarding changing the process ID.
.PP
\fIOther Changes\fR
.IX Subsection "Other Changes"
.IP \(bu 4
perlxs was extended with documentation on inline typemaps.
.IP \(bu 4
perlref has a new Circular References
section explaining how circularities may not be freed and how to solve that
with weak references.
.IP \(bu 4
Parts of perlapi were clarified, and Perl equivalents of some C
functions have been added as an additional mode of exposition.
.IP \(bu 4
A few parts of perlre and perlrecharclass were clarified.
.SS "Removed Documentation"
.IX Subsection "Removed Documentation"
\fIOld OO Documentation\fR
.IX Subsection "Old OO Documentation"
.PP
The old OO tutorials, perltoot, perltooc, and perlboot, have been
removed. The perlbot (bag of object tricks) document has been removed
as well.
.PP
\fIDevelopment Deltas\fR
.IX Subsection "Development Deltas"
.PP
The perldelta files for development releases are no longer packaged with
perl. These can still be found in the perl source code repository.
.SH Diagnostics
.IX Header "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.
.SS "New Diagnostics"
.IX Subsection "New Diagnostics"
\fINew Errors\fR
.IX Subsection "New Errors"
.IP \(bu 4
Cannot set tied \f(CW@DB::args\fR
.Sp
This error occurs when \f(CW\*(C`caller\*(C'\fR tries to set \f(CW@DB::args\fR but finds it
tied. Before this error was added, it used to crash instead.
.IP \(bu 4
Cannot tie unreifiable array
.Sp
This error is part of a safety check that the \f(CW\*(C`tie\*(C'\fR operator does before
tying a special array like \f(CW@_\fR. You should never see this message.
.IP \(bu 4
&CORE::%s cannot be called directly
.Sp
This occurs when a subroutine in the \f(CW\*(C`CORE::\*(C'\fR namespace is called
with \f(CW&foo\fR syntax or through a reference. Some subroutines
in this package cannot yet be called that way, but must be
called as barewords. See "Subroutines in the \f(CW\*(C`CORE\*(C'\fR namespace", above.
.IP \(bu 4
Source filters apply only to byte streams
.Sp
This new error occurs when you try to activate a source filter (usually by
loading a source filter module) within a string passed to \f(CW\*(C`eval\*(C'\fR under the
\&\f(CW\*(C`unicode_eval\*(C'\fR feature.
.PP
\fINew Warnings\fR
.IX Subsection "New Warnings"
.IP \(bu 4
defined(@array) is deprecated
.Sp
The long-deprecated \f(CWdefined(@array)\fR now also warns for package variables.
Previously it issued a warning for lexical variables only.
.IP \(bu 4
\&\fBlength()\fR used on \f(CW%s\fR
.Sp
This new warning occurs when \f(CW\*(C`length\*(C'\fR is used on an array or hash, instead
of \f(CWscalar(@array)\fR or \f(CW\*(C`scalar(keys %hash)\*(C'\fR.
.IP \(bu 4
lvalue attribute \f(CW%s\fR already-defined subroutine
.Sp
attributes.pm now emits this warning when the :lvalue
attribute is applied to a Perl subroutine that has already been defined, as
doing so can have unexpected side-effects.
.IP \(bu 4
overload arg '%s' is invalid
.Sp
This warning, in the "overload" category, is produced when the overload
pragma is given an argument it doesn't recognize, presumably a mistyped
operator.
.IP \(bu 4
$[ used in \f(CW%s\fR (did you mean $] ?)
.Sp
This new warning exists to catch the mistaken use of \f(CW$[\fR in version
checks. \f(CW$]\fR, not \f(CW$[\fR, contains the version number.
.IP \(bu 4
Useless assignment to a temporary
.Sp
Assigning to a temporary scalar returned
from an lvalue subroutine now produces this
warning [perl #31946].
.IP \(bu 4
Useless use of \eE
.Sp
\&\f(CW\*(C`\eE\*(C'\fR does nothing unless preceded by \f(CW\*(C`\eQ\*(C'\fR, \f(CW\*(C`\eL\*(C'\fR or \f(CW\*(C`\eU\*(C'\fR.
.SS "Removed Errors"
.IX Subsection "Removed Errors"
.IP \(bu 4
"sort is now a reserved word"
.Sp
This error used to occur when \f(CW\*(C`sort\*(C'\fR was called without arguments,
followed by \f(CW\*(C`;\*(C'\fR or \f(CW\*(C`)\*(C'\fR. (E.g., \f(CW\*(C`sort;\*(C'\fR would die, but \f(CW\*(C`{sort}\*(C'\fR was
OK.) This error message was added in Perl 3 to catch code like
\&\f(CWclose(sort)\fR which would no longer work. More than two decades later,
this message is no longer appropriate. Now \f(CW\*(C`sort\*(C'\fR without arguments is
always allowed, and returns an empty list, as it did in those cases
where it was already allowed [perl #90030].
.SS "Changes to Existing Diagnostics"
.IX Subsection "Changes to Existing Diagnostics"
.IP \(bu 4
The "Applying pattern match..." or similar warning produced when an
array or hash is on the left-hand side of the \f(CW\*(C`=~\*(C'\fR operator now
mentions the name of the variable.
.IP \(bu 4
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.
.IP \(bu 4
The error messages for using \f(CW\*(C`default\*(C'\fR and \f(CW\*(C`when\*(C'\fR outside a
topicalizer have been standardized to match the messages for \f(CW\*(C`continue\*(C'\fR
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 \fBwhen()\fR outside a topicalizer' [perl #91514].
.IP \(bu 4
The message, "Code point 0x%X is not Unicode, no properties match it;
all inverse properties do" has been changed to "Code point 0x%X is not
Unicode, all \ep{} matches fail; all \eP{} matches succeed".
.IP \(bu 4
Redefinition warnings for constant subroutines used to be mandatory,
even occurring under \f(CW\*(C`no warnings\*(C'\fR. Now they respect the warnings
pragma.
.IP \(bu 4
The "glob failed" warning message is now suppressible via \f(CW\*(C`no warnings\*(C'\fR
[perl #111656].
.IP \(bu 4
The Invalid version format
error message now says "negative version number" within the parentheses,
rather than "non-numeric data", for negative numbers.
.IP \(bu 4
The two warnings
Possible attempt to put comments in \fBqw()\fR list
and
Possible attempt to separate words with commas
are no longer mutually exclusive: the same \f(CW\*(C`qw\*(C'\fR construct may produce
both.
.IP \(bu 4
The uninitialized warning for \f(CW\*(C`y///r\*(C'\fR when \f(CW$_\fR is implicit and
undefined now mentions the variable name, just like the non\-/r variation
of the operator.
.IP \(bu 4
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.
.IP \(bu 4
Warnings that mention the names of lexical (\f(CW\*(C`my\*(C'\fR) variables with
Unicode characters in them now respect the presence or absence of the
\&\f(CW\*(C`:utf8\*(C'\fR layer on the output handle, instead of outputting UTF8
regardless. Also, the correct names are included in the strings passed
to \f(CW$SIG{_\|_WARN_\|_}\fR handlers, rather than the raw UTF8 bytes.
.SH "Utility Changes"
.IX Header "Utility Changes"
\fIh2ph\fR
.IX Subsection "h2ph"
.IP \(bu 4
h2ph used to generate code of the form
.Sp
.Vb 3
\& unless(defined(&FOO)) {
\& sub FOO () {42;}
\& }
.Ve
.Sp
But the subroutine is a compile-time declaration, and is hence unaffected
by the condition. It has now been corrected to emit a string \f(CW\*(C`eval\*(C'\fR
around the subroutine [perl #99368].
.PP
\fIsplain\fR
.IX Subsection "splain"
.IP \(bu 4
\&\fIsplain\fR no longer emits backtraces with the first line number repeated.
.Sp
This:
.Sp
.Vb 6
\& 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
.Ve
.Sp
has become this:
.Sp
.Vb 5
\& 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
.Ve
.IP \(bu 4
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.
.PP
\fIzipdetails\fR
.IX Subsection "zipdetails"
.IP \(bu 4
This is a new utility, included as part of an
IO::Compress::Base upgrade.
.Sp
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.
.SH "Configuration and Compilation"
.IX Header "Configuration and Compilation"
.IP \(bu 4
\&\fIregexp.h\fR has been modified for compatibility with GCC's \fB\-Werror\fR
option, as used by some projects that include perl's header files (5.14.1).
.IP \(bu 4
\&\f(CW\*(C`USE_LOCALE{,_COLLATE,_CTYPE,_NUMERIC}\*(C'\fR have been added the output of perl \-V
as they have affect the behavior of the interpreter binary (albeit
in only a small area).
.IP \(bu 4
The code and tests for IPC::Open2 have been moved from \fIext/IPC\-Open2\fR
into \fIext/IPC\-Open3\fR, as \f(CWIPC::Open2::open2()\fR is implemented as a thin
wrapper around \f(CWIPC::Open3::_open3()\fR, and hence is very tightly coupled to
it.
.IP \(bu 4
The magic types and magic vtables are now generated from data in a new script
\&\fIregen/mg_vtable.pl\fR, 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 \fIgenerate_uudmap\fR to a new generated
header \fImg_data.h\fR. \f(CW\*(C`PL_vtbl_bm\*(C'\fR and \f(CW\*(C`PL_vtbl_fm\*(C'\fR are now defined by the
pre-processor as \f(CW\*(C`PL_vtbl_regexp\*(C'\fR, instead of being distinct C variables.
\&\f(CW\*(C`PL_vtbl_sig\*(C'\fR has been removed.
.IP \(bu 4
Building with \f(CW\*(C`\-DPERL_GLOBAL_STRUCT\*(C'\fR works again. This configuration is not
generally used.
.IP \(bu 4
Perl configured with \fIMAD\fR now correctly frees \f(CW\*(C`MADPROP\*(C'\fR structures when
OPs are freed. \f(CW\*(C`MADPROP\*(C'\fRs are now allocated with \f(CWPerlMemShared_malloc()\fR
.IP \(bu 4
\&\fImakedef.pl\fR has been refactored. This should have no noticeable affect on
any of the platforms that use it as part of their build (AIX, VMS, Win32).
.IP \(bu 4
\&\f(CW\*(C`useperlio\*(C'\fR can no longer be disabled.
.IP \(bu 4
The file \fIglobal.sym\fR is no longer needed, and has been removed. It
contained a list of all exported functions, one of the files generated by
\&\fIregen/embed.pl\fR from data in \fIembed.fnc\fR and \fIregen/opcodes\fR. The code
has been refactored so that the only user of \fIglobal.sym\fR, \fImakedef.pl\fR,
now reads \fIembed.fnc\fR and \fIregen/opcodes\fR directly, removing the need to
store the list of exported functions in an intermediate file.
.Sp
As \fIglobal.sym\fR was never installed, this change should not be visible
outside the build process.
.IP \(bu 4
\&\fIpod/buildtoc\fR, used by the build process to build perltoc, has been
refactored and simplified. It now contains only code to build perltoc;
the code to regenerate Makefiles has been moved to \fIPorting/pod_rules.pl\fR.
It's a bug if this change has any material effect on the build process.
.IP \(bu 4
\&\fIpod/roffitall\fR is now built by \fIpod/buildtoc\fR, instead of being
shipped with the distribution. Its list of manpages is now generated
(and therefore current). See also RT #103202 for an unresolved related
issue.
.IP \(bu 4
The man page for \f(CW\*(C`XS::Typemap\*(C'\fR is no longer installed. \f(CW\*(C`XS::Typemap\*(C'\fR
is a test module which is not installed, hence installing its
documentation makes no sense.
.IP \(bu 4
The \-Dusesitecustomize and \-Duserelocatableinc options now work
together properly.
.SH "Platform Support"
.IX Header "Platform Support"
.SS "Platform-Specific Notes"
.IX Subsection "Platform-Specific Notes"
\fICygwin\fR
.IX Subsection "Cygwin"
.IP \(bu 4
Since version 1.7, Cygwin supports native UTF\-8 paths. If Perl is built
under that environment, directory and filenames will be UTF\-8 encoded.
.IP \(bu 4
Cygwin does not initialize all original Win32 environment variables. See
\&\fIREADME.cygwin\fR for a discussion of the newly-added
\&\f(CWCygwin::sync_winenv()\fR function [perl #110190] and for
further links.
.PP
\fIHP-UX\fR
.IX Subsection "HP-UX"
.IP \(bu 4
HP-UX PA\-RISC/64 now supports gcc\-4.x
.Sp
A fix to correct the socketsize now makes the test suite pass on HP-UX
PA-RISC for 64bitall builds. (5.14.2)
.PP
\fIVMS\fR
.IX Subsection "VMS"
.IP \(bu 4
Remove unnecessary includes, fix miscellaneous compiler warnings and
close some unclosed comments on \fIvms/vms.c\fR.
.IP \(bu 4
Remove sockadapt layer from the VMS build.
.IP \(bu 4
Explicit support for VMS versions before v7.0 and DEC C versions
before v6.0 has been removed.
.IP \(bu 4
Since Perl 5.10.1, the home-grown \f(CW\*(C`stat\*(C'\fR 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.
.IP \(bu 4
The build on VMS now permits names of the resulting symbols in C code for
Perl longer than 31 characters. Symbols like
\&\f(CW\*(C`Perl_\|_it_was_the_best_of_times_it_was_the_worst_of_times\*(C'\fR can now be
created freely without causing the VMS linker to seize up.
.PP
\fIGNU/Hurd\fR
.IX Subsection "GNU/Hurd"
.IP \(bu 4
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.
.PP
\fIOpenVOS\fR
.IX Subsection "OpenVOS"
.IP \(bu 4
Perl is now built with dynamic linking on OpenVOS, the minimum supported
version of which is now Release 17.1.0.
.PP
\fISunOS\fR
.IX Subsection "SunOS"
.PP
The CC workshop C++ compiler is now detected and used on systems that ship
without cc.
.SH "Internal Changes"
.IX Header "Internal Changes"
.IP \(bu 4
The compiled representation of formats is now stored via the \f(CW\*(C`mg_ptr\*(C'\fR of
their \f(CW\*(C`PERL_MAGIC_fm\*(C'\fR. Previously it was stored in the string buffer,
beyond \f(CWSvLEN()\fR, the regular end of the string. \f(CWSvCOMPILED()\fR and
\&\f(CW\*(C`SvCOMPILED_{on,off}()\*(C'\fR now exist solely for compatibility for XS code.
The first is always 0, the other two now no-ops. (5.14.1)
.IP \(bu 4
Some global variables have been marked \f(CW\*(C`const\*(C'\fR, members in the interpreter
structure have been re-ordered, and the opcodes have been re-ordered. The
op \f(CW\*(C`OP_AELEMFAST\*(C'\fR has been split into \f(CW\*(C`OP_AELEMFAST\*(C'\fR and \f(CW\*(C`OP_AELEMFAST_LEX\*(C'\fR.
.IP \(bu 4
When empting a hash of its elements (e.g., via undef(%h), or \f(CW%h\fR=()), HvARRAY
field is no longer temporarily zeroed. Any destructors called on the freed
elements see the remaining elements. Thus, \f(CW%h\fR=() becomes more like
\&\f(CW\*(C`delete $h{$_} for keys %h\*(C'\fR.
.IP \(bu 4
Boyer-Moore compiled scalars are now PVMGs, and the Boyer-Moore tables are now
stored via the mg_ptr of their \f(CW\*(C`PERL_MAGIC_bm\*(C'\fR.
Previously they were PVGVs, with the tables stored in
the string buffer, beyond \f(CWSvLEN()\fR. This eliminates
the last place where the core stores data beyond \f(CWSvLEN()\fR.
.IP \(bu 4
Simplified logic in \f(CWPerl_sv_magic()\fR introduces a small change of
behavior for error cases involving unknown magic types. Previously, if
\&\f(CWPerl_sv_magic()\fR was passed a magic type unknown to it, it would
.RS 4
.IP 1. 4
Croak "Modification of a read-only value attempted" if read only
.IP 2. 4
Return without error if the SV happened to already have this magic
.IP 3. 4
otherwise croak "Don't know how to handle magic of type \e\e%o"
.RE
.RS 4
.Sp
Now it will always croak "Don't know how to handle magic of type \e\e%o", even
on read-only values, or SVs which already have the unknown magic type.
.RE
.IP \(bu 4
The experimental \f(CW\*(C`fetch_cop_label\*(C'\fR function has been renamed to
\&\f(CW\*(C`cop_fetch_label\*(C'\fR.
.IP \(bu 4
The \f(CW\*(C`cop_store_label\*(C'\fR function has been added to the API, but is
experimental.
.IP \(bu 4
\&\fIembedvar.h\fR has been simplified, and one level of macro indirection for
PL_* variables has been removed for the default (non-multiplicity)
configuration. PERLVAR*() macros now directly expand their arguments to
tokens such as \f(CW\*(C`PL_defgv\*(C'\fR, instead of expanding to \f(CW\*(C`PL_Idefgv\*(C'\fR, with
\&\fIembedvar.h\fR defining a macro to map \f(CW\*(C`PL_Idefgv\*(C'\fR to \f(CW\*(C`PL_defgv\*(C'\fR. XS code
which has unwarranted chumminess with the implementation may need updating.
.IP \(bu 4
An API has been added to explicitly choose whether to export XSUB
symbols. More detail can be found in the comments for commit e64345f8.
.IP \(bu 4
The \f(CW\*(C`is_gv_magical_sv\*(C'\fR function has been eliminated and merged with
\&\f(CW\*(C`gv_fetchpvn_flags\*(C'\fR. It used to be called to determine whether a GV
should be autovivified in rvalue context. Now it has been replaced with a
new \f(CW\*(C`GV_ADDMG\*(C'\fR flag (not part of the API).
.IP \(bu 4
The returned code point from the function \f(CWutf8n_to_uvuni()\fR
when the input is malformed UTF\-8, malformations are allowed, and
\&\f(CW\*(C`utf8\*(C'\fR warnings are off is now the Unicode REPLACEMENT CHARACTER
whenever the malformation is such that no well-defined code point can be
computed. Previously the returned value was essentially garbage. The
only malformations that have well-defined values are a zero-length
string (0 is the return), and overlong UTF\-8 sequences.
.IP \(bu 4
Padlists are now marked \f(CW\*(C`AvREAL\*(C'\fR; i.e., reference-counted. They have
always been reference-counted, but were not marked real, because \fIpad.c\fR
did its own clean-up, instead of using the usual clean-up code in \fIsv.c\fR.
That caused problems in thread cloning, so now the \f(CW\*(C`AvREAL\*(C'\fR flag is on,
but is turned off in \fIpad.c\fR right before the padlist is freed (after
\&\fIpad.c\fR has done its custom freeing of the pads).
.IP \(bu 4
All C files that make up the Perl core have been converted to UTF\-8.
.IP \(bu 4
These new functions have been added as part of the work on Unicode symbols:
.Sp
.Vb 10
\& HvNAMELEN
\& HvNAMEUTF8
\& HvENAMELEN
\& HvENAMEUTF8
\& gv_init_pv
\& gv_init_pvn
\& gv_init_pvsv
\& gv_fetchmeth_pv
\& gv_fetchmeth_pvn
\& gv_fetchmeth_sv
\& gv_fetchmeth_pv_autoload
\& gv_fetchmeth_pvn_autoload
\& gv_fetchmeth_sv_autoload
\& gv_fetchmethod_pv_flags
\& gv_fetchmethod_pvn_flags
\& gv_fetchmethod_sv_flags
\& gv_autoload_pv
\& gv_autoload_pvn
\& gv_autoload_sv
\& newGVgen_flags
\& sv_derived_from_pv
\& sv_derived_from_pvn
\& sv_derived_from_sv
\& sv_does_pv
\& sv_does_pvn
\& sv_does_sv
\& whichsig_pv
\& whichsig_pvn
\& whichsig_sv
\& newCONSTSUB_flags
.Ve
.Sp
The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are
experimental and may change in a future release.
.IP \(bu 4
The following functions were added. These are \fInot\fR part of the API:
.Sp
.Vb 9
\& GvNAMEUTF8
\& GvENAMELEN
\& GvENAME_HEK
\& CopSTASH_flags
\& CopSTASH_flags_set
\& PmopSTASH_flags
\& PmopSTASH_flags_set
\& sv_sethek
\& HEKfARG
.Ve
.Sp
There is also a \f(CW\*(C`HEKf\*(C'\fR macro corresponding to \f(CW\*(C`SVf\*(C'\fR, for
interpolating HEKs in formatted strings.
.IP \(bu 4
\&\f(CW\*(C`sv_catpvn_flags\*(C'\fR takes a couple of new internal-only flags,
\&\f(CW\*(C`SV_CATBYTES\*(C'\fR and \f(CW\*(C`SV_CATUTF8\*(C'\fR, which tell it whether the char array to
be concatenated is UTF8. This allows for more efficient concatenation than
creating temporary SVs to pass to \f(CW\*(C`sv_catsv\*(C'\fR.
.IP \(bu 4
For XS AUTOLOAD subs, \f(CW$AUTOLOAD\fR is set once more, as it was in 5.6.0. This
is in addition to setting \f(CWSvPVX(cv)\fR, for compatibility with 5.8 to 5.14.
See "Autoloading with XSUBs" in perlguts.
.IP \(bu 4
Perl now checks whether the array (the linearized isa) returned by a MRO
plugin begins with the name of the class itself, for which the array was
created, instead of assuming that it does. This prevents the first element
from being skipped during method lookup. It also means that
\&\f(CW\*(C`mro::get_linear_isa\*(C'\fR may return an array with one more element than the
MRO plugin provided [perl #94306].
.IP \(bu 4
\&\f(CW\*(C`PL_curstash\*(C'\fR is now reference-counted.
.IP \(bu 4
There are now feature bundle hints in \f(CW\*(C`PL_hints\*(C'\fR (\f(CW$^H\fR) that version
declarations use, to avoid having to load \fIfeature.pm\fR. One setting of
the hint bits indicates a "custom" feature bundle, which means that the
entries in \f(CW\*(C`%^H\*(C'\fR still apply. \fIfeature.pm\fR uses that.
.Sp
The \f(CW\*(C`HINT_FEATURE_MASK\*(C'\fR macro is defined in \fIperl.h\fR along with other
hints. Other macros for setting and testing features and bundles are in
the new \fIfeature.h\fR. \f(CW\*(C`FEATURE_IS_ENABLED\*(C'\fR (which has moved to
\&\fIfeature.h\fR) is no longer used throughout the codebase, but more specific
macros, e.g., \f(CW\*(C`FEATURE_SAY_IS_ENABLED\*(C'\fR, that are defined in \fIfeature.h\fR.
.IP \(bu 4
\&\fIlib/feature.pm\fR is now a generated file, created by the new
\&\fIregen/feature.pl\fR script, which also generates \fIfeature.h\fR.
.IP \(bu 4
Tied arrays are now always \f(CW\*(C`AvREAL\*(C'\fR. If \f(CW@_\fR or \f(CW\*(C`DB::args\*(C'\fR is tied, it
is reified first, to make sure this is always the case.
.IP \(bu 4
Two new functions \f(CWutf8_to_uvchr_buf()\fR and \f(CWutf8_to_uvuni_buf()\fR have
been added. These are the same as \f(CW\*(C`utf8_to_uvchr\*(C'\fR and
\&\f(CW\*(C`utf8_to_uvuni\*(C'\fR (which are now deprecated), but take an extra parameter
that is used to guard against reading beyond the end of the input
string.
See "utf8_to_uvchr_buf" in perlapi and "utf8_to_uvuni_buf" in perlapi.
.IP \(bu 4
The regular expression engine now does TRIE case insensitive matches
under Unicode. This may change the output of \f(CW\*(C`use re \*(Aqdebug\*(Aq;\*(C'\fR,
and will speed up various things.
.IP \(bu 4
There is a new \f(CWwrap_op_checker()\fR function, which provides a thread-safe
alternative to writing to \f(CW\*(C`PL_check\*(C'\fR directly.
.SH "Selected Bug Fixes"
.IX Header "Selected Bug Fixes"
.SS "Array and hash"
.IX Subsection "Array and hash"
.IP \(bu 4
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)
.IP \(bu 4
Deleting the current hash iterator (the hash element that would be returned
by the next call to \f(CW\*(C`each\*(C'\fR) in void context used not to free it
[perl #85026].
.IP \(bu 4
Deletion of methods via \f(CW\*(C`delete $Class::{method}\*(C'\fR syntax used to update
method caches if called in void context, but not scalar or list context.
.IP \(bu 4
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].
.IP \(bu 4
A \f(CW\*(C`keys\*(C'\fR optimization in Perl 5.12.0 to make it faster on empty hashes
caused \f(CW\*(C`each\*(C'\fR not to reset the iterator if called after the last element
was deleted.
.IP \(bu 4
Freeing deeply nested hashes no longer crashes [perl #44225].
.IP \(bu 4
It is possible from XS code to create hashes with elements that have no
values. The hash element and slice operators used to crash
when handling these in lvalue context. They now
produce a "Modification of non-creatable hash value attempted" error
message.
.IP \(bu 4
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].
.IP \(bu 4
It used to be possible to free the typeglob of a localized array or hash
(e.g., \f(CW\*(C`local @{"x"}; delete $::{x}\*(C'\fR), resulting in a crash on scope exit.
.IP \(bu 4
Some core bugs affecting Hash::Util have been fixed: locking a hash
element that is a glob copy no longer causes the next assignment to it to
corrupt the glob (5.14.2), 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.
.SS "C API fixes"
.IX Subsection "C API fixes"
.IP \(bu 4
The \f(CW\*(C`newHVhv\*(C'\fR XS function now works on tied hashes, instead of crashing or
returning an empty hash.
.IP \(bu 4
The \f(CW\*(C`SvIsCOW\*(C'\fR C macro now returns false for read-only copies of typeglobs,
such as those created by:
.Sp
.Vb 2
\& $hash{elem} = *foo;
\& Hash::Util::lock_value %hash, \*(Aqelem\*(Aq;
.Ve
.Sp
It used to return true.
.IP \(bu 4
The \f(CW\*(C`SvPVutf8\*(C'\fR C function no longer tries to modify its argument,
resulting in errors [perl #108994].
.IP \(bu 4
\&\f(CW\*(C`SvPVutf8\*(C'\fR now works properly with magical variables.
.IP \(bu 4
\&\f(CW\*(C`SvPVbyte\*(C'\fR now works properly non-PVs.
.IP \(bu 4
When presented with malformed UTF\-8 input, the XS-callable functions
\&\f(CWis_utf8_string()\fR, \f(CWis_utf8_string_loc()\fR, and
\&\f(CWis_utf8_string_loclen()\fR could read beyond the end of the input
string by up to 12 bytes. This no longer happens. [perl #32080].
However, currently, \f(CWis_utf8_char()\fR still has this defect, see
"\fBis_utf8_char()\fR" above.
.IP \(bu 4
The C\-level \f(CW\*(C`pregcomp\*(C'\fR function could become confused about whether the
pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise
magical scalar [perl #101940].
.SS "Compile-time hints"
.IX Subsection "Compile-time hints"
.IP \(bu 4
Tying \f(CW\*(C`%^H\*(C'\fR no longer causes perl to crash or ignore the contents of
\&\f(CW\*(C`%^H\*(C'\fR when entering a compilation scope [perl #106282].
.IP \(bu 4
\&\f(CW\*(C`eval $string\*(C'\fR and \f(CW\*(C`require\*(C'\fR used not to
localize \f(CW\*(C`%^H\*(C'\fR during compilation if it
was empty at the time the \f(CW\*(C`eval\*(C'\fR call itself was compiled. This could
lead to scary side effects, like \f(CW\*(C`use re "/m"\*(C'\fR enabling other flags that
the surrounding code was trying to enable for its caller [perl #68750].
.IP \(bu 4
\&\f(CW\*(C`eval $string\*(C'\fR and \f(CW\*(C`require\*(C'\fR no longer localize hints (\f(CW$^H\fR and \f(CW\*(C`%^H\*(C'\fR)
at run time, but only during compilation of the \f(CW$string\fR or required file.
This makes \f(CW\*(C`BEGIN { $^H{foo}=7 }\*(C'\fR equivalent to
\&\f(CW\*(C`BEGIN { eval \*(Aq$^H{foo}=7\*(Aq }\*(C'\fR [perl #70151].
.IP \(bu 4
Creating a BEGIN block from XS code (via \f(CW\*(C`newXS\*(C'\fR or \f(CW\*(C`newATTRSUB\*(C'\fR) 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.
.SS "Copy-on-write scalars"
.IX Subsection "Copy-on-write scalars"
Copy-on-write or shared hash key 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 \f(CW\*(C`_\|_PACKAGE_\|_\*(C'\fR 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.
.IP \(bu 4
\&\f(CW\*(C`utf8::decode\*(C'\fR 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]. (5.14.2)
.IP \(bu 4
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.
.IP \(bu 4
Elements of restricted hashes (see the fields pragma) containing
copy-on-write values couldn't be deleted, nor could such hashes be cleared
(\f(CW\*(C`%hash = ()\*(C'\fR). (5.14.2)
.IP \(bu 4
Localizing a tied variable used to make it read-only if it contained a
copy-on-write string. (5.14.2)
.IP \(bu 4
Assigning a copy-on-write string to a stash
element no longer causes a double free. Regardless of this change, the
results of such assignments are still undefined.
.IP \(bu 4
Assigning a copy-on-write string to a tied variable no longer stops that
variable from being tied if it happens to be a PVMG or PVLV internally.
.IP \(bu 4
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.
.IP \(bu 4
This one is a regression from 5.12: In 5.14.0, the bitwise assignment
operators \f(CW\*(C`|=\*(C'\fR, \f(CW\*(C`^=\*(C'\fR and \f(CW\*(C`&=\*(C'\fR started leaving the left-hand side
undefined if it happened to be a copy-on-write string [perl #108480].
.IP \(bu 4
Storable, Devel::Peek and PerlIO::scalar had similar problems.
See "Updated Modules and Pragmata", above.
.SS "The debugger"
.IX Subsection "The debugger"
.IP \(bu 4
\&\fIdumpvar.pl\fR, and therefore the \f(CW\*(C`x\*(C'\fR 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].
.IP \(bu 4
The "R" command for restarting a debugger session has been fixed to work on
Windows, or any other system lacking a \f(CW\*(C`POSIX::_SC_OPEN_MAX\*(C'\fR constant
[perl #87740].
.IP \(bu 4
The \f(CW\*(C`#line 42 foo\*(C'\fR 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 worked only for a single \f(CW\*(C`#line 42 foo\*(C'\fR in each eval. Now
it works for multiple.
.IP \(bu 4
When subroutine calls are intercepted by the debugger, the name of the
subroutine or a reference to it is stored in \f(CW$DB::sub\fR, for the debugger
to access. Sometimes (such as \f(CW\*(C`$foo = *bar; undef *bar; &$foo\*(C'\fR)
\&\f(CW$DB::sub\fR 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].
.IP \(bu 4
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].
.SS "Dereferencing operators"
.IX Subsection "Dereferencing operators"
.IP \(bu 4
\&\f(CWdefined(${"..."})\fR, \f(CWdefined(*{"..."})\fR, etc., used to
return true for most, but not all built-in variables, if
they had not been used yet. This bug affected \f(CW\*(C`${^GLOBAL_PHASE}\*(C'\fR and
\&\f(CW\*(C`${^UTF8CACHE}\*(C'\fR, among others. It also used to return false if the
package name was given as well (\f(CW\*(C`${"::!"}\*(C'\fR) [perl #97978, #97492].
.IP \(bu 4
Perl 5.10.0 introduced a similar bug: \f(CWdefined(*{"foo"})\fR 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 \fIfirst\fR call.
This, too, has been fixed.
.IP \(bu 4
Since 5.6.0, \f(CW\*(C`*{ ... }\*(C'\fR 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 by \f(CWundef()\fR (\f(CW&PL_sv_undef\fR internally). This
has been corrected. \f(CWundef()\fR is now treated like other undefined
scalars, as in Perl 5.005.
.SS "Filehandle, last-accessed"
.IX Subsection "Filehandle, last-accessed"
Perl has an internal variable that stores the last filehandle to be
accessed. It is used by \f(CW$.\fR and by \f(CW\*(C`tell\*(C'\fR and \f(CW\*(C`eof\*(C'\fR without
arguments.
.IP \(bu 4
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:
.Sp
.Vb 4
\& 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
.Ve
.Sp
Now the \f(CW\*(C`$foo = 3\*(C'\fR assignment unsets that internal variable, so there
is no last-accessed filehandle, just as if \f(CW\*(C`<$foo>\*(C'\fR had never
happened.
.Sp
This also prevents some unrelated handle from becoming the last-accessed
handle if \f(CW$foo\fR falls out of scope and the same internal SV gets used for
another handle [perl #97988].
.IP \(bu 4
A regression in 5.14 caused these statements not to set that internal
variable:
.Sp
.Vb 8
\& my $fh = *STDOUT;
\& tell $fh;
\& eof $fh;
\& seek $fh, 0,0;
\& tell *$fh;
\& eof *$fh;
\& seek *$fh, 0,0;
\& readline *$fh;
.Ve
.Sp
This is now fixed, but \f(CW\*(C`tell *{ *$fh }\*(C'\fR still has the problem, and it
is not clear how to fix it [perl #106536].
.ie n .SS "Filetests and ""stat"""
.el .SS "Filetests and \f(CWstat\fP"
.IX Subsection "Filetests and stat"
The term "filetests" refers to the operators that consist of a hyphen
followed by a single letter: \f(CW\*(C`\-r\*(C'\fR, \f(CW\*(C`\-x\*(C'\fR, \f(CW\*(C`\-M\*(C'\fR, etc. The term "stacked"
when applied to filetests means followed by another filetest operator
sharing the same operand, as in \f(CW\*(C`\-r \-x \-w $fooo\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`stat\*(C'\fR produces more consistent warnings. It no longer warns for "_"
[perl #71002] and no longer skips the warning at times for other unopened
handles. It no longer warns about an unopened handle when the operating
system's \f(CW\*(C`fstat\*(C'\fR function fails.
.IP \(bu 4
\&\f(CW\*(C`stat\*(C'\fR would sometimes return negative numbers for large inode numbers,
because it was using the wrong internal C type. [perl #84590]
.IP \(bu 4
\&\f(CW\*(C`lstat\*(C'\fR is documented to fall back to \f(CW\*(C`stat\*(C'\fR (with a warning) when given
a filehandle. When passed an IO reference, it was actually doing the
equivalent of \f(CW\*(C`stat\ _\*(C'\fR and ignoring the handle.
.IP \(bu 4
\&\f(CW\*(C`\-T _\*(C'\fR with no preceding \f(CW\*(C`stat\*(C'\fR used to produce a
confusing "uninitialized" warning, even though there
is no visible uninitialized value to speak of.
.IP \(bu 4
\&\f(CW\*(C`\-T\*(C'\fR, \f(CW\*(C`\-B\*(C'\fR, \f(CW\*(C`\-l\*(C'\fR and \f(CW\*(C`\-t\*(C'\fR now work
when stacked with other filetest operators
[perl #77388].
.IP \(bu 4
In 5.14.0, filetest ops (\f(CW\*(C`\-r\*(C'\fR, \f(CW\*(C`\-x\*(C'\fR, 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, so \f(CW\*(C`push @foo, $tied, \-r\*(C'\fR no longer calls FETCH on \f(CW$tied\fR.
.IP \(bu 4
In Perl 5.6, \f(CW\*(C`\-l\*(C'\fR followed by anything other than a bareword would treat
its argument as a file name. That was changed in 5.8 for glob references
(\f(CW\*(C`\e*foo\*(C'\fR), but not for globs themselves (\f(CW*foo\fR). \f(CW\*(C`\-l\*(C'\fR started
returning \f(CW\*(C`undef\*(C'\fR 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
behavior has been restored.
.IP \(bu 4
\&\f(CW\*(C`\-l\*(C'\fR followed by a bareword no longer "eats" the previous argument to
the list operator in whose argument list it resides. Hence,
\&\f(CW\*(C`print "bar", \-l foo\*(C'\fR now actually prints "bar", because \f(CW\*(C`\-l\*(C'\fR
on longer eats it.
.IP \(bu 4
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.
.Sp
There were various cases where these could get out of synch, resulting in
inconsistent or erratic behavior in edge cases (every mention of \f(CW\*(C`\-T\*(C'\fR
applies to \f(CW\*(C`\-B\*(C'\fR as well):
.RS 4
.IP \(bu 4
\&\f(CW\*(C`\-T \fR\f(CIHANDLE\fR\f(CW\*(C'\fR, even though it does a \f(CW\*(C`stat\*(C'\fR, was not resetting the last
stat type, so an \f(CW\*(C`lstat _\*(C'\fR following it would merrily return the wrong
results. Also, it was not setting the success status.
.IP \(bu 4
Freeing the handle last used by \f(CW\*(C`stat\*(C'\fR or a filetest could result in
\&\f(CW\*(C`\-T\ _\*(C'\fR using an unrelated handle.
.IP \(bu 4
\&\f(CW\*(C`stat\*(C'\fR with an IO reference would not reset the stat type or record the
filehandle for \f(CW\*(C`\-T\ _\*(C'\fR to use.
.IP \(bu 4
Fatal warnings could cause the stat buffer not to be reset
for a filetest operator on an unopened filehandle or \f(CW\*(C`\-l\*(C'\fR on any handle.
Fatal warnings also stopped \f(CW\*(C`\-T\*(C'\fR from setting \f(CW$!\fR.
.IP \(bu 4
When the last stat was on an unreadable file, \f(CW\*(C`\-T _\*(C'\fR is supposed to
return \f(CW\*(C`undef\*(C'\fR, leaving the last stat buffer unchanged. But it was
setting the stat type, causing \f(CW\*(C`lstat _\*(C'\fR to stop working.
.IP \(bu 4
\&\f(CW\*(C`\-T \fR\f(CIFILENAME\fR\f(CW\*(C'\fR was not resetting the internal stat buffers for
unreadable files.
.RE
.RS 4
.Sp
These have all been fixed.
.RE
.SS Formats
.IX Subsection "Formats"
.IP \(bu 4
Several edge cases have been fixed with formats and \f(CW\*(C`formline\*(C'\fR;
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].
.IP \(bu 4
\&\f(CW\*(C`formline\*(C'\fR no longer converts its argument into a string in-place. So
passing a reference to \f(CW\*(C`formline\*(C'\fR no longer destroys the reference
[perl #79532].
.IP \(bu 4
Assignment to \f(CW$^A\fR (the format output accumulator) now recalculates
the number of lines output.
.ie n .SS """given"" and ""when"""
.el .SS "\f(CWgiven\fP and \f(CWwhen\fP"
.IX Subsection "given and when"
.IP \(bu 4
\&\f(CW\*(C`given\*(C'\fR was not scoping its implicit \f(CW$_\fR properly, resulting in memory
leaks or "Variable is not available" warnings [perl #94682].
.IP \(bu 4
\&\f(CW\*(C`given\*(C'\fR was not calling set-magic on the implicit lexical \f(CW$_\fR that it
uses. This meant, for example, that \f(CW\*(C`pos\*(C'\fR would be remembered from one
execution of the same \f(CW\*(C`given\*(C'\fR block to the next, even if the input were a
different variable [perl #84526].
.IP \(bu 4
\&\f(CW\*(C`when\*(C'\fR blocks are now capable of returning variables declared inside the
enclosing \f(CW\*(C`given\*(C'\fR block [perl #93548].
.ie n .SS "The ""glob"" operator"
.el .SS "The \f(CWglob\fP operator"
.IX Subsection "The glob operator"
.IP \(bu 4
On OSes other than VMS, Perl's \f(CW\*(C`glob\*(C'\fR operator (and the \f(CW\*(C`<...>\*(C'\fR form)
use File::Glob underneath. File::Glob splits the pattern into words,
before feeding each word to its \f(CW\*(C`bsd_glob\*(C'\fR function.
.Sp
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].
.IP \(bu 4
\&\f(CW\*(C`CORE::glob\*(C'\fR now works as a way to call the default globbing function. It
used to respect overrides, despite the \f(CW\*(C`CORE::\*(C'\fR prefix.
.IP \(bu 4
Under miniperl (used to configure modules when perl itself is built),
\&\f(CW\*(C`glob\*(C'\fR now clears \f(CW%ENV\fR before calling csh, since the latter croaks on some
systems if it does not like the contents of the LS_COLORS environment
variable [perl #98662].
.SS "Lvalue subroutines"
.IX Subsection "Lvalue subroutines"
.IP \(bu 4
Explicit return now returns the actual argument passed to return, instead
of copying it [perl #72724, #72706].
.IP \(bu 4
Lvalue subroutines used to enforce lvalue syntax (i.e., whatever can go on
the left-hand side of \f(CW\*(C`=\*(C'\fR) for the last statement and the arguments to
return. Since lvalue subroutines are not always called in lvalue context,
this restriction has been lifted.
.IP \(bu 4
Lvalue subroutines are less restrictive about what values can be returned.
It used to croak on values returned by \f(CW\*(C`shift\*(C'\fR and \f(CW\*(C`delete\*(C'\fR and from
other subroutines, but no longer does so [perl #71172].
.IP \(bu 4
Empty lvalue subroutines (\f(CW\*(C`sub :lvalue {}\*(C'\fR) used to return \f(CW@_\fR in list
context. All subroutines used to do this, but regular subs were fixed in
Perl 5.8.2. Now lvalue subroutines have been likewise fixed.
.IP \(bu 4
Autovivification now works on values returned from lvalue subroutines
[perl #7946], as does returning \f(CW\*(C`keys\*(C'\fR in lvalue context.
.IP \(bu 4
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 \f(CW\*(C`($)\*(C'\fR
prototype would cause an lvalue sub to copy its return value [perl #51408],
and \f(CW\*(C`while(lvalue_sub() =~ m/.../g) { ... }\*(C'\fR would loop endlessly
[perl #78680].
.IP \(bu 4
When called in potential lvalue context
(e.g., subroutine arguments or a list
passed to \f(CW\*(C`for\*(C'\fR), lvalue subroutines used to copy
any read-only value that was returned. E.g., \f(CW\*(C` sub :lvalue { $] } \*(C'\fR
would not return \f(CW$]\fR, but a copy of it.
.IP \(bu 4
When called in potential lvalue context, an lvalue subroutine returning
arrays or hashes used to bind the arrays or hashes to scalar variables,
resulting in bugs. This was fixed in 5.14.0 if an array were the first
thing returned from the subroutine (but not for \f(CW\*(C`$scalar, @array\*(C'\fR or
hashes being returned). Now a more general fix has been applied
[perl #23790].
.IP \(bu 4
Method calls whose arguments were all surrounded with \f(CWmy()\fR or \f(CWour()\fR
(as in \f(CW\*(C`$object\->method(my($a,$b))\*(C'\fR) used to force lvalue context on
the subroutine. This would prevent lvalue methods from returning certain
values.
.IP \(bu 4
Lvalue sub calls that are not determined to be such at compile time
(\f(CW&$name\fR or &{"name"}) are no longer exempt from strict refs if they
occur in the last statement of an lvalue subroutine [perl #102486].
.IP \(bu 4
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].
.Sp
Non-lvalue sub calls whose subs \fIare\fR 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.
.IP \(bu 4
\&\f(CW\*(C`AUTOLOAD\*(C'\fR 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.
.IP \(bu 4
Applying the \f(CW\*(C`:lvalue\*(C'\fR attribute to an XSUB or to an aliased subroutine
stub with \f(CW\*(C`sub foo :lvalue;\*(C'\fR syntax stopped working in Perl 5.12.
This has been fixed.
.IP \(bu 4
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.
.Sp
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. \f(CW\*(C`sub foo :lvalue :Whatever\*(C'\fR (when
\&\f(CW\*(C`foo\*(C'\fR is already defined) now warns about the :lvalue attribute, and does
not apply it.
.IP \(bu 4
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.
.SS Overloading
.IX Subsection "Overloading"
.IP \(bu 4
Arithmetic assignment (\f(CW\*(C`$left += $right\*(C'\fR) involving overloaded objects
that rely on the 'nomethod' override no longer segfault when the left
operand is not overloaded.
.IP \(bu 4
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.
.IP \(bu 4
Undefining \f(CW%overload::\fR no longer causes a crash.
.SS "Prototypes of built-in keywords"
.IX Subsection "Prototypes of built-in keywords"
.IP \(bu 4
The \f(CW\*(C`prototype\*(C'\fR function no longer dies for the \f(CW\*(C`_\|_FILE_\|_\*(C'\fR, \f(CW\*(C`_\|_LINE_\|_\*(C'\fR
and \f(CW\*(C`_\|_PACKAGE_\|_\*(C'\fR directives. It now returns an empty-string prototype
for them, because they are syntactically indistinguishable from nullary
functions like \f(CW\*(C`time\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`prototype\*(C'\fR now returns \f(CW\*(C`undef\*(C'\fR for all overridable infix operators,
such as \f(CW\*(C`eq\*(C'\fR, which are not callable in any way resembling functions.
It used to return incorrect prototypes for some and die for others
[perl #94984].
.IP \(bu 4
The prototypes of several built-in functions\-\-\f(CW\*(C`getprotobynumber\*(C'\fR, \f(CW\*(C`lock\*(C'\fR,
\&\f(CW\*(C`not\*(C'\fR and \f(CW\*(C`select\*(C'\fR\-\-have been corrected, or at least are now closer to
reality than before.
.SS "Regular expressions"
.IX Subsection "Regular expressions"
.IP \(bu 4
\&\f(CW\*(C`/[[:ascii:]]/\*(C'\fR and \f(CW\*(C`/[[:blank:]]/\*(C'\fR now use locale rules under
\&\f(CW\*(C`use locale\*(C'\fR when the platform supports that. Previously, they used
the platform's native character set.
.IP \(bu 4
\&\f(CW\*(C`m/[[:ascii:]]/i\*(C'\fR and \f(CW\*(C`/\ep{ASCII}/i\*(C'\fR now match identically (when not
under a differing locale). This fixes a regression introduced in 5.14
in which the first expression could match characters outside of ASCII,
such as the KELVIN SIGN.
.IP \(bu 4
\&\f(CW\*(C`/.*/g\*(C'\fR would sometimes refuse to match at the end of a string that ends
with "\en". This has been fixed [perl #109206].
.IP \(bu 4
Starting with 5.12.0, Perl used to get its internal bookkeeping muddled up
after assigning \f(CW\*(C`${ qr// }\*(C'\fR to a hash element and locking it with
Hash::Util. This could result in double frees, crashes, or erratic
behavior.
.IP \(bu 4
The new (in 5.14.0) regular expression modifier \f(CW\*(C`/a\*(C'\fR when repeated like
\&\f(CW\*(C`/aa\*(C'\fR forbids the characters outside the ASCII range that match
characters inside that range from matching under \f(CW\*(C`/i\*(C'\fR. This did not
work under some circumstances, all involving alternation, such as:
.Sp
.Vb 1
\& "\eN{KELVIN SIGN}" =~ /k|foo/iaa;
.Ve
.Sp
succeeded inappropriately. This is now fixed.
.IP \(bu 4
5.14.0 introduced some memory leaks in regular expression character
classes such as \f(CW\*(C`[\ew\es]\*(C'\fR, which have now been fixed. (5.14.1)
.IP \(bu 4
An edge case in regular expression matching could potentially loop.
This happened only under \f(CW\*(C`/i\*(C'\fR 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.
.Sp
.Vb 1
\& "s\eN{U+DF}" =~ /[\ex{DF}foo]/i
.Ve
.Sp
is one such case. \f(CW\*(C`\exDF\*(C'\fR folds to \f(CW"ss"\fR. (5.14.1)
.IP \(bu 4
A few characters in regular expression pattern matches did not
match correctly in some circumstances, all involving \f(CW\*(C`/i\*(C'\fR. 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.
.IP \(bu 4
A memory leak regression in regular expression compilation
under threading has been fixed.
.IP \(bu 4
A regression introduced in 5.14.0 has
been fixed. This involved an inverted
bracketed character class in a regular expression that consisted solely
of a Unicode property. That property wasn't getting inverted outside the
Latin1 range.
.IP \(bu 4
Three problematic Unicode characters now work better in regex pattern matching under \f(CW\*(C`/i\*(C'\fR.
.Sp
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" for LATIN SMALL LETTER SHARP S),
did not properly match under \f(CW\*(C`/i\*(C'\fR. 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 \f(CW\*(C`(?(DEFINE)\*(C'\fR 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. These all
involve using the characters and sequences outside bracketed character
classes under \f(CW\*(C`/i\*(C'\fR. This closes [perl #98546].
.Sp
There remain known problems when using certain characters with
multi-character folds inside bracketed character classes, including such
constructs as \f(CW\*(C`qr/[\eN{LATIN SMALL LETTER SHARP}a\-z]/i\*(C'\fR. These
remaining bugs are addressed in [perl #89774].
.IP \(bu 4
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:
.Sp
.Vb 6
\& for (1..10_000_000) {
\& if ("foo" =~ /(foo|(?bar))?/) {
\& my $capture = $+{capture}
\& }
\& }
\& system "ps \-o rss $$"\*(Aq
.Ve
.IP \(bu 4
In 5.14, \f(CW\*(C`/[[:lower:]]/i\*(C'\fR and \f(CW\*(C`/[[:upper:]]/i\*(C'\fR no longer matched the
opposite case. This has been fixed [perl #101970].
.IP \(bu 4
A regular expression match with an overloaded object on the right-hand side
would sometimes stringify the object too many times.
.IP \(bu 4
A regression has been fixed that was introduced in 5.14, in \f(CW\*(C`/i\*(C'\fR
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]
.IP \(bu 4
In case-insensitive regular expression pattern matching, no longer on
UTF\-8 encoded strings does the scan for the start of match look only at
the first possible position. This caused matches such as
\&\f(CW\*(C`"f\ex{FB00}" =~ /ff/i\*(C'\fR to fail.
.IP \(bu 4
The regexp optimizer no longer crashes on debugging builds when merging
fixed-string nodes with inconvenient contents.
.IP \(bu 4
A panic involving the combination of the regular expression modifiers
\&\f(CW\*(C`/aa\*(C'\fR and the \f(CW\*(C`\eb\*(C'\fR escape sequence introduced in 5.14.0 has been
fixed [perl #95964]. (5.14.2)
.IP \(bu 4
The combination of the regular expression modifiers \f(CW\*(C`/aa\*(C'\fR and the \f(CW\*(C`\eb\*(C'\fR
and \f(CW\*(C`\eB\*(C'\fR escape sequences did not work properly on UTF\-8 encoded
strings. All non-ASCII characters under \f(CW\*(C`/aa\*(C'\fR 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].
.IP \(bu 4
\&\f(CW\*(C`(?foo: ...)\*(C'\fR no longer loses passed in character set.
.IP \(bu 4
The trie optimization used to have problems with alternations containing
an empty \f(CW\*(C`(?:)\*(C'\fR, causing \f(CW\*(C`"x" =~ /\eA(?>(?:(?:)A|B|C?x))\ez/\*(C'\fR not to
match, whereas it should [perl #111842].
.IP \(bu 4
Use of lexical (\f(CW\*(C`my\*(C'\fR) variables in code blocks embedded in regular
expressions will no longer result in memory corruption or crashes.
.Sp
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., \f(CW\*(C`die\*(C'\fR) causing memory corruption.
.IP \(bu 4
The \f(CW\*(C`\eh\*(C'\fR, \f(CW\*(C`\eH\*(C'\fR, \f(CW\*(C`\ev\*(C'\fR and \f(CW\*(C`\eV\*(C'\fR regular expression metacharacters used to
cause a panic error message when trying to match at the end of the
string [perl #96354].
.IP \(bu 4
The abbreviations for four C1 control characters \f(CW\*(C`MW\*(C'\fR \f(CW\*(C`PM\*(C'\fR, \f(CW\*(C`RI\*(C'\fR, and
\&\f(CW\*(C`ST\*(C'\fR were previously unrecognized by \f(CW\*(C`\eN{}\*(C'\fR, \fBvianame()\fR, and
\&\fBstring_vianame()\fR.
.IP \(bu 4
Mentioning a variable named "&" other than \f(CW$&\fR (i.e., \f(CW\*(C`@&\*(C'\fR or \f(CW\*(C`%&\*(C'\fR) no
longer stops \f(CW$&\fR from working. The same applies to variables named "'"
and "`" [perl #24237].
.IP \(bu 4
Creating a \f(CW\*(C`UNIVERSAL::AUTOLOAD\*(C'\fR sub no longer stops \f(CW\*(C`%+\*(C'\fR, \f(CW\*(C`%\-\*(C'\fR and
\&\f(CW\*(C`%!\*(C'\fR from working some of the time [perl #105024].
.SS Smartmatching
.IX Subsection "Smartmatching"
.IP \(bu 4
\&\f(CW\*(C`~~\*(C'\fR now correctly handles the precedence of Any~~Object, and is not tricked
by an overloaded object on the left-hand side.
.IP \(bu 4
In Perl 5.14.0, \f(CW\*(C`$tainted ~~ @array\*(C'\fR stopped working properly. Sometimes
it would erroneously fail (when \f(CW$tainted\fR contained a string that occurs
in the array \fIafter\fR the first element) or erroneously succeed (when
\&\f(CW\*(C`undef\*(C'\fR occurred after the first element) [perl #93590].
.ie n .SS "The ""sort"" operator"
.el .SS "The \f(CWsort\fP operator"
.IX Subsection "The sort operator"
.IP \(bu 4
\&\f(CW\*(C`sort\*(C'\fR was not treating \f(CW\*(C`sub {}\*(C'\fR and \f(CW\*(C`sub {()}\*(C'\fR as equivalent when
such a sub was provided as the comparison routine. It used to croak on
\&\f(CW\*(C`sub {()}\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`sort\*(C'\fR now works once more with custom sort routines that are XSUBs. It
stopped working in 5.10.0.
.IP \(bu 4
\&\f(CW\*(C`sort\*(C'\fR with a constant for a custom sort routine, although it produces
unsorted results, no longer crashes. It started crashing in 5.10.0.
.IP \(bu 4
Warnings emitted by \f(CW\*(C`sort\*(C'\fR when a custom comparison routine returns a
non-numeric value now contain "in sort" and show the line number of the
\&\f(CW\*(C`sort\*(C'\fR operator, rather than the last line of the comparison routine. The
warnings also now occur only if warnings are enabled in the scope where
\&\f(CW\*(C`sort\*(C'\fR occurs. Previously the warnings would occur if enabled in the
comparison routine's scope.
.IP \(bu 4
\&\f(CW\*(C`sort { $a <=> $b }\*(C'\fR, which is optimized internally, now produces
"uninitialized" warnings for NaNs (not-a-number values), since \f(CW\*(C`<=>\*(C'\fR
returns \f(CW\*(C`undef\*(C'\fR for those. This brings it in line with
\&\f(CW\*(C`sort\ {\ 1;\ $a\ <=>\ $b\ }\*(C'\fR and other more complex cases, which are not
optimized [perl #94390].
.ie n .SS "The ""substr"" operator"
.el .SS "The \f(CWsubstr\fP operator"
.IX Subsection "The substr operator"
.IP \(bu 4
Tied (and otherwise magical) variables are no longer exempt from the
"Attempt to use reference as lvalue in substr" warning.
.IP \(bu 4
That warning now occurs when the returned lvalue is assigned to, not
when \f(CW\*(C`substr\*(C'\fR itself is called. This makes a difference only if the
return value of \f(CW\*(C`substr\*(C'\fR is referenced and later assigned to.
.IP \(bu 4
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 occurs only
if the passed value is assigned to.
.Sp
The same thing happens with the "substr outside of string" error. If
the lvalue is only read from, not written to, it is now just a warning, as
with rvalue \f(CW\*(C`substr\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`substr\*(C'\fR assignments no longer call FETCH twice if the first argument
is a tied variable, just once.
.SS "Support for embedded nulls"
.IX Subsection "Support for embedded nulls"
Some parts of Perl did not work correctly with nulls (\f(CW\*(C`chr 0\*(C'\fR) embedded in
strings. That meant that, for instance, \f(CW\*(C`$m = "a\e0b"; foo\->$m\*(C'\fR would
call the "a" method, instead of the actual method name contained in \f(CW$m\fR.
These parts of perl have been fixed to support nulls:
.IP \(bu 4
Method names
.IP \(bu 4
Typeglob names (including filehandle and subroutine names)
.IP \(bu 4
Package names, including the return value of \f(CWref()\fR
.IP \(bu 4
Typeglob elements (\f(CW*foo{"THING\e0stuff"}\fR)
.IP \(bu 4
Signal names
.IP \(bu 4
Various warnings and error messages that mention variable names or values,
methods, etc.
.PP
One side effect of these changes is that blessing into "\e0" no longer
causes \f(CWref()\fR to return false.
.SS "Threading bugs"
.IX Subsection "Threading bugs"
.IP \(bu 4
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].
.IP \(bu 4
Some cases of threads crashing due to memory allocation during cloning have
been fixed [perl #90006].
.IP \(bu 4
Thread joining would sometimes emit "Attempt to free unreferenced scalar"
warnings if \f(CW\*(C`caller\*(C'\fR had been used from the \f(CW\*(C`DB\*(C'\fR package before thread
creation [perl #98092].
.IP \(bu 4
Locking a subroutine (via \f(CW\*(C`lock &sub\*(C'\fR) 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 like \f(CW\*(C`ref \e$_\*(C'\fR
returning "CODE" in some instances.
.Sp
\&\f(CW\*(C`lock &sub\*(C'\fR is now a run-time error if threads::shared is loaded (a
no-op otherwise), but that may be rectified in a future version.
.SS "Tied variables"
.IX Subsection "Tied variables"
.IP \(bu 4
Various cases in which FETCH was being ignored or called too many times
have been fixed:
.RS 4
.IP \(bu 4
\&\f(CW\*(C`PerlIO::get_layers\*(C'\fR [perl #97956]
.IP \(bu 4
\&\f(CW\*(C`$tied =~ y/a/b/\*(C'\fR, \f(CW\*(C`chop $tied\*(C'\fR and \f(CW\*(C`chomp $tied\*(C'\fR when \f(CW$tied\fR holds a
reference.
.IP \(bu 4
When calling \f(CW\*(C`local $_\*(C'\fR [perl #105912]
.IP \(bu 4
Four-argument \f(CW\*(C`select\*(C'\fR
.IP \(bu 4
A tied buffer passed to \f(CW\*(C`sysread\*(C'\fR
.IP \(bu 4
\&\f(CW\*(C`$tied .= <>\*(C'\fR
.IP \(bu 4
Three-argument \f(CW\*(C`open\*(C'\fR, the third being a tied file handle
(as in \f(CW\*(C`open $fh, ">&", $tied\*(C'\fR)
.IP \(bu 4
\&\f(CW\*(C`sort\*(C'\fR with a reference to a tied glob for the comparison routine.
.IP \(bu 4
\&\f(CW\*(C`..\*(C'\fR and \f(CW\*(C`...\*(C'\fR in list context [perl #53554].
.IP \(bu 4
\&\f(CW\*(C`${$tied}\*(C'\fR, \f(CW\*(C`@{$tied}\*(C'\fR, \f(CW\*(C`%{$tied}\*(C'\fR and \f(CW\*(C`*{$tied}\*(C'\fR where the tied
variable returns a string (\f(CW\*(C`&{}\*(C'\fR was unaffected)
.IP \(bu 4
\&\f(CW\*(C`defined ${ $tied_variable }\*(C'\fR
.IP \(bu 4
Various functions that take a filehandle argument in rvalue context
(\f(CW\*(C`close\*(C'\fR, \f(CW\*(C`readline\*(C'\fR, etc.) [perl #97482]
.IP \(bu 4
Some cases of dereferencing a complex expression, such as
\&\f(CW\*(C`${ (), $tied } = 1\*(C'\fR, used to call \f(CW\*(C`FETCH\*(C'\fR multiple times, but now call
it once.
.IP \(bu 4
\&\f(CW\*(C`$tied\->method\*(C'\fR where \f(CW$tied\fR returns a package name\-\-even resulting in
a failure to call the method, due to memory corruption
.IP \(bu 4
Assignments like \f(CW\*(C`*$tied = \e&{"..."}\*(C'\fR and \f(CW\*(C`*glob = $tied\*(C'\fR
.IP \(bu 4
\&\f(CW\*(C`chdir\*(C'\fR, \f(CW\*(C`chmod\*(C'\fR, \f(CW\*(C`chown\*(C'\fR, \f(CW\*(C`utime\*(C'\fR, \f(CW\*(C`truncate\*(C'\fR, \f(CW\*(C`stat\*(C'\fR, \f(CW\*(C`lstat\*(C'\fR and
the filetest ops (\f(CW\*(C`\-r\*(C'\fR, \f(CW\*(C`\-x\*(C'\fR, etc.)
.RE
.RS 4
.RE
.IP \(bu 4
\&\f(CW\*(C`caller\*(C'\fR sets \f(CW@DB::args\fR to the subroutine arguments when called from
the DB package. It used to crash when doing so if \f(CW@DB::args\fR happened to
be tied. Now it croaks instead.
.IP \(bu 4
Tying an element of \f(CW%ENV\fR or \f(CW\*(C`%^H\*(C'\fR 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].
.IP \(bu 4
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].
.IP \(bu 4
Four-argument \f(CW\*(C`select\*(C'\fR no longer produces its "Non-string passed as
bitmask" warning on tied or tainted variables that are strings.
.IP \(bu 4
Localizing a tied scalar that returns a typeglob no longer stops it from
being tied till the end of the scope.
.IP \(bu 4
Attempting to \f(CW\*(C`goto\*(C'\fR out of a tied handle method used to cause memory
corruption or crashes. Now it produces an error message instead
[perl #8611].
.IP \(bu 4
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 \f(CW\*(C`\e&$tied\*(C'\fR 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.
.SS "Version objects and vstrings"
.IX Subsection "Version objects and vstrings"
.IP \(bu 4
The 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
\&\f(CW\*(C`version\->new(~v1.2.3)\*(C'\fR would create a version looking like "v1.2.3"
even though the string passed to \f(CW\*(C`version\->new\*(C'\fR was actually
"\e376\e375\e374". This also caused B::Deparse to deparse \f(CW\*(C`~v1.2.3\*(C'\fR
incorrectly, without the \f(CW\*(C`~\*(C'\fR [perl #29070].
.IP \(bu 4
Assigning a vstring to a magic (e.g., tied, \f(CW$!\fR) variable and then
assigning something else used to blow away all magic. This meant that
tied variables would come undone, \f(CW$!\fR would stop getting updated on
failed system calls, \f(CW$|\fR would stop setting autoflush, and other
mischief would take place. This has been fixed.
.IP \(bu 4
\&\f(CW\*(C`version\->new("version")\*(C'\fR and \f(CW\*(C`printf "%vd", "version"\*(C'\fR no longer
crash [perl #102586].
.IP \(bu 4
Version comparisons, such as those that happen implicitly with \f(CW\*(C`use
v5.43\*(C'\fR, no longer cause locale settings to change [perl #105784].
.IP \(bu 4
Version objects no longer cause memory leaks in boolean context
[perl #109762].
.SS "Warnings, redefinition"
.IX Subsection "Warnings, redefinition"
.IP \(bu 4
Subroutines from the \f(CW\*(C`autouse\*(C'\fR 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 the \f(CW\*(C`autouse\*(C'\fR package, this stopped working in 5.10.
.IP \(bu 4
New XSUBs now produce redefinition warnings if they overwrite existing
subs, as they did in 5.8.x. (The \f(CW\*(C`autouse\*(C'\fR logic was reversed in
5.10\-14. Only subroutines from the \f(CW\*(C`autouse\*(C'\fR namespace would warn
when clobbered.)
.IP \(bu 4
\&\f(CW\*(C`newCONSTSUB\*(C'\fR 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, if \f(CW\*(C`newCONSTSUB\*(C'\fR redefined an existing
subroutine:
.Sp
.Vb 5
\& use warnings;
\& BEGIN {
\& no warnings;
\& some_XS_function_that_calls_new_CONSTSUB();
\& }
.Ve
.IP \(bu 4
Redefinition warnings for constant subroutines are on by default (what
are known as severe warnings in perldiag). This occurred only
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.
.IP \(bu 4
The internal check to see whether a redefinition warning should occur
used to emit "uninitialized" warnings in cases like this:
.Sp
.Vb 4
\& use warnings "uninitialized";
\& use constant {u => undef, v => undef};
\& sub foo(){u}
\& sub foo(){v}
.Ve
.SS "Warnings, ""Uninitialized"""
.IX Subsection "Warnings, ""Uninitialized"""
.IP \(bu 4
Various functions that take a filehandle argument in rvalue context
(\f(CW\*(C`close\*(C'\fR, \f(CW\*(C`readline\*(C'\fR, etc.) used to warn twice for an undefined handle
[perl #97482].
.IP \(bu 4
\&\f(CW\*(C`dbmopen\*(C'\fR now only warns once, rather than three times, if the mode
argument is \f(CW\*(C`undef\*(C'\fR [perl #90064].
.IP \(bu 4
The \f(CW\*(C`+=\*(C'\fR operator does not usually warn when the left-hand side is
\&\f(CW\*(C`undef\*(C'\fR, but it was doing so for tied variables. This has been fixed
[perl #44895].
.IP \(bu 4
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 \f(CW\*(C`%{...}\*(C'\fR or \f(CW\*(C`@{...}\*(C'\fR. This has been fixed
[perl #103766].
.IP \(bu 4
\&\f(CW\*(C`..\*(C'\fR and \f(CW\*(C`...\*(C'\fR in list context now mention the name of the variable in
"uninitialized" warnings for string (as opposed to numeric) ranges.
.SS "Weak references"
.IX Subsection "Weak references"
.IP \(bu 4
Weakening the first argument to an automatically-invoked \f(CW\*(C`DESTROY\*(C'\fR method
could result in erroneous "DESTROY created new reference" errors or
crashes. Now it is an error to weaken a read-only reference.
.IP \(bu 4
Weak references to lexical hashes going out of scope were not going stale
(becoming undefined), but continued to point to the hash.
.IP \(bu 4
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.
.IP \(bu 4
Creating a weak reference to an \f(CW@ISA\fR array or accessing the array index
(\f(CW$#ISA\fR) could result in confused internal bookkeeping for elements
later added to the \f(CW@ISA\fR array. For instance, creating a weak
reference to the element itself could push that weak reference on to \f(CW@ISA\fR;
and elements added after use of \f(CW$#ISA\fR would be ignored by method lookup
[perl #85670].
.SS "Other notable fixes"
.IX Subsection "Other notable fixes"
.IP \(bu 4
\&\f(CW\*(C`quotemeta\*(C'\fR now quotes consistently the same non-ASCII characters under
\&\f(CW\*(C`use feature \*(Aqunicode_strings\*(Aq\*(C'\fR, regardless of whether the string is
encoded in UTF\-8 or not, hence fixing the last vestiges (we hope) of the
notorious "The "Unicode Bug"" in perlunicode. [perl #77654].
.Sp
Which of these code points is quoted has changed, based on Unicode's
recommendations. See "quotemeta" in perlfunc for details.
.IP \(bu 4
\&\f(CW\*(C`study\*(C'\fR is now a no-op, presumably fixing all outstanding bugs related to
study causing regex matches to behave incorrectly!
.IP \(bu 4
When one writes \f(CW\*(C`open foo || die\*(C'\fR, 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 \f(CW\*(C`||\*(C'\fR. This
has been corrected.
.IP \(bu 4
After package aliasing (\f(CW\*(C`*foo:: = *bar::\*(C'\fR), \f(CW\*(C`select\*(C'\fR with 0 or 1 argument
would sometimes return a name that could not be used to refer to the
filehandle, or sometimes it would return \f(CW\*(C`undef\*(C'\fR even when a filehandle
was selected. Now it returns a typeglob reference in such cases.
.IP \(bu 4
\&\f(CW\*(C`PerlIO::get_layers\*(C'\fR 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).
.IP \(bu 4
Unrecognized switches on \f(CW\*(C`#!\*(C'\fR line
.Sp
If a switch, such as \fB\-x\fR, that cannot occur on the \f(CW\*(C`#!\*(C'\fR line is used
there, perl dies with "Can't emulate...".
.Sp
It used to produce the same message for switches that perl did not
recognize at all, whether on the command line or the \f(CW\*(C`#!\*(C'\fR line.
.Sp
Now it produces the "Unrecognized switch" error message [perl #104288].
.IP \(bu 4
\&\f(CW\*(C`system\*(C'\fR now temporarily blocks the SIGCHLD signal handler, to prevent the
signal handler from stealing the exit status [perl #105700].
.IP \(bu 4
The \f(CW%n\fR formatting code for \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`sprintf\*(C'\fR, which causes the number
of characters to be assigned to the next argument, now actually
assigns the number of characters, instead of the number of bytes.
.Sp
It also works now with special lvalue functions like \f(CW\*(C`substr\*(C'\fR and with
nonexistent hash and array elements [perl #3471, #103492].
.IP \(bu 4
Perl skips copying values returned from a subroutine, for the sake of
speed, if doing so would make no observable difference. Because of faulty
logic, this would happen with the
result of \f(CW\*(C`delete\*(C'\fR, \f(CW\*(C`shift\*(C'\fR or \f(CW\*(C`splice\*(C'\fR, even if the result was
referenced elsewhere. It also did so with tied variables about to be freed
[perl #91844, #95548].
.IP \(bu 4
\&\f(CW\*(C`utf8::decode\*(C'\fR now refuses to modify read-only scalars [perl #91850].
.IP \(bu 4
Freeing \f(CW$_\fR inside a \f(CW\*(C`grep\*(C'\fR or \f(CW\*(C`map\*(C'\fR block, a code block embedded in a
regular expression, or an \f(CW@INC\fR filter (a subroutine returned by a
subroutine in \f(CW@INC\fR) used to result in double frees or crashes
[perl #91880, #92254, #92256].
.IP \(bu 4
\&\f(CW\*(C`eval\*(C'\fR returns \f(CW\*(C`undef\*(C'\fR in scalar context or an empty list in list
context when there is a run-time error. When \f(CW\*(C`eval\*(C'\fR 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].
.IP \(bu 4
\&\f(CW\*(C`goto &func\*(C'\fR 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].
.IP \(bu 4
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]:
.Sp
.Vb 3
\& package Foo;
\& BEGIN {*Foo:: = *Bar::}
\& sub foo;
.Ve
.IP \(bu 4
The \f(CW\*(C`x\*(C'\fR repetition operator no longer crashes on 64\-bit builds with large
repeat counts [perl #94560].
.IP \(bu 4
Calling \f(CW\*(C`require\*(C'\fR on an implicit \f(CW$_\fR when \f(CW*CORE::GLOBAL::require\fR has
been overridden does not segfault anymore, and \f(CW$_\fR is now passed to the
overriding subroutine [perl #78260].
.IP \(bu 4
\&\f(CW\*(C`use\*(C'\fR and \f(CW\*(C`require\*(C'\fR are no longer affected by the I/O layers active in
the caller's scope (enabled by open.pm) [perl #96008].
.IP \(bu 4
\&\f(CW\*(C`our $::é; $é\*(C'\fR (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].
.IP \(bu 4
On 64\-bit systems, \f(CWread()\fR now understands large string offsets beyond
the 32\-bit range.
.IP \(bu 4
Errors that occur when processing subroutine attributes no longer cause the
subroutine's op tree to leak.
.IP \(bu 4
Passing the same constant subroutine to both \f(CW\*(C`index\*(C'\fR and \f(CW\*(C`formline\*(C'\fR no
longer causes one or the other to fail [perl #89218]. (5.14.1)
.IP \(bu 4
List assignment to lexical variables declared with attributes in the same
statement (\f(CW\*(C`my ($x,@y) : blimp = (72,94)\*(C'\fR) stopped working in Perl 5.8.0.
It has now been fixed.
.IP \(bu 4
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]. (5.14.2)
.IP \(bu 4
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., \f(CW\*(C`bless \e$a[0]\*(C'\fR) or if a closure referenced a
blessed variable (\f(CW\*(C`bless \emy @a; sub foo { @a }\*(C'\fR).
.Sp
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].
.IP \(bu 4
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)
.IP \(bu 4
\&\f(CWeach(\fR\f(CIARRAY\fR\f(CW)\fR is now wrapped in \f(CWdefined(...)\fR, like \f(CWeach(\fR\f(CIHASH\fR\f(CW)\fR,
inside a \f(CW\*(C`while\*(C'\fR condition [perl #90888].
.IP \(bu 4
A problem with context propagation when a \f(CW\*(C`do\*(C'\fR block is an argument to
\&\f(CW\*(C`return\*(C'\fR has been fixed. It used to cause \f(CW\*(C`undef\*(C'\fR to be returned in
certain cases of a \f(CW\*(C`return\*(C'\fR inside an \f(CW\*(C`if\*(C'\fR block which itself is followed by
another \f(CW\*(C`return\*(C'\fR.
.IP \(bu 4
Calling \f(CW\*(C`index\*(C'\fR with a tainted constant no longer causes constants in
subsequently compiled code to become tainted [perl #64804].
.IP \(bu 4
Infinite loops like \f(CW\*(C`1 while 1\*(C'\fR used to stop \f(CW\*(C`strict \*(Aqsubs\*(Aq\*(C'\fR mode from
working for the rest of the block.
.IP \(bu 4
For list assignments like \f(CW\*(C`($a,$b) = ($b,$a)\*(C'\fR, 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 if no one variable is mentioned on both sides, as in \f(CW\*(C`($a,$b) =
($c,$d)\*(C'\fR. The logic for determining when it can cheat was faulty, in that
\&\f(CW\*(C`&&\*(C'\fR and \f(CW\*(C`||\*(C'\fR on the right-hand side could fool it. So \f(CW\*(C`($a,$b) =
$some_true_value && ($b,$a)\*(C'\fR would end up assigning the value of \f(CW$b\fR to
both scalars.
.IP \(bu 4
Perl no longer tries to apply lvalue context to the string in
\&\f(CW\*(C`("string", $variable) ||= 1\*(C'\fR (which used to be an error). Since the
left-hand side of \f(CW\*(C`||=\*(C'\fR 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].
.IP \(bu 4
\&\f(CW\*(C`caller\*(C'\fR no longer leaks memory when called from the DB package if
\&\f(CW@DB::args\fR was assigned to after the first call to \f(CW\*(C`caller\*(C'\fR. Carp
was triggering this bug [perl #97010]. (5.14.2)
.IP \(bu 4
\&\f(CW\*(C`close\*(C'\fR and similar filehandle functions, when called on built-in global
variables (like \f(CW$+\fR), used to die if the variable happened to hold the
undefined value, instead of producing the usual "Use of uninitialized
value" warning.
.IP \(bu 4
When autovivified file handles were introduced in Perl 5.6.0, \f(CW\*(C`readline\*(C'\fR
was inadvertently made to autovivify when called as \f(CWreadline($foo)\fR (but
not as \f(CW\*(C`<$foo>\*(C'\fR). It has now been fixed never to autovivify.
.IP \(bu 4
Calling an undefined anonymous subroutine (e.g., what \f(CW$x\fR holds after
\&\f(CW\*(C`undef &{$x = sub{}}\*(C'\fR) used to cause a "Not a CODE reference" error, which
has been corrected to "Undefined subroutine called" [perl #71154].
.IP \(bu 4
Causing \f(CW@DB::args\fR to be freed between uses of \f(CW\*(C`caller\*(C'\fR no longer
results in a crash [perl #93320].
.IP \(bu 4
\&\f(CWsetpgrp($foo)\fR used to be equivalent to \f(CW\*(C`($foo, setpgrp)\*(C'\fR, because
\&\f(CW\*(C`setpgrp\*(C'\fR was ignoring its argument if there was just one. Now it is
equivalent to \f(CW\*(C`setpgrp($foo,0)\*(C'\fR.
.IP \(bu 4
\&\f(CW\*(C`shmread\*(C'\fR 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].
.IP \(bu 4
\&\f(CW\*(C`++\*(C'\fR and \f(CW\*(C`\-\-\*(C'\fR now work on copies of globs, instead of dying.
.IP \(bu 4
\&\f(CWsplice()\fR doesn't warn when truncating
.Sp
You can now limit the size of an array using \f(CW\*(C`splice(@a,MAX_LEN)\*(C'\fR without
worrying about warnings.
.IP \(bu 4
\&\f(CW$$\fR is no longer tainted. Since this value comes directly from
\&\f(CWgetpid()\fR, it is always safe.
.IP \(bu 4
The parser no longer leaks a filehandle if STDIN was closed before parsing
started [perl #37033].
.IP \(bu 4
\&\f(CW\*(C`die;\*(C'\fR with a non-reference, non-string, or magical (e.g., tainted)
value in $@ now properly propagates that value [perl #111654].
.SH "Known Problems"
.IX Header "Known Problems"
.IP \(bu 4
On Solaris, we have two kinds of failure.
.Sp
If \fImake\fR is Sun's \fImake\fR, we get an error about a badly formed macro
assignment in the \fIMakefile\fR. That happens when \fI./Configure\fR tries to
make depends. \fIConfigure\fR then exits 0, but further \fImake\fR\-ing fails.
.Sp
If \fImake\fR is \fIgmake\fR, \fIConfigure\fR completes, then we get errors related
to \fI/usr/include/stdbool.h\fR
.IP \(bu 4
On Win32, a number of tests hang unless STDERR is redirected. The cause of
this is still under investigation.
.IP \(bu 4
When building as root with a umask that prevents files from being
other-readable, \fIt/op/filetest.t\fR will fail. This is a test bug, not a
bug in perl's behavior.
.IP \(bu 4
Configuring with a recent gcc and link-time-optimization, such as
\&\f(CW\*(C`Configure \-Doptimize=\*(Aq\-O2 \-flto\*(Aq\*(C'\fR fails
because the optimizer optimizes away some of Configure's tests. A
workaround is to omit the \f(CW\*(C`\-flto\*(C'\fR flag when running Configure, but add
it back in while actually building, something like
.Sp
.Vb 2
\& sh Configure \-Doptimize=\-O2
\& make OPTIMIZE=\*(Aq\-O2 \-flto\*(Aq
.Ve
.IP \(bu 4
The following CPAN modules have test failures with perl 5.16. Patches have
been submitted for all of these, so hopefully there will be new releases
soon:
.RS 4
.IP \(bu 4
Date::Pcalc version 6.1
.IP \(bu 4
Module::CPANTS::Analyse version 0.85
.Sp
This fails due to problems in Module::Find 0.10 and File::MMagic
1.27.
.IP \(bu 4
PerlIO::Util version 0.72
.RE
.RS 4
.RE
.SH Acknowledgements
.IX Header "Acknowledgements"
Perl 5.16.0 represents approximately 12 months of development since Perl
5.14.0 and contains approximately 590,000 lines of changes across 2,500
files from 139 authors.
.PP
Perl continues to flourish into its third decade thanks to a vibrant
community of users and developers. The following people are known to
have contributed the improvements that became Perl 5.16.0:
.PP
Aaron Crane, Abhijit Menon-Sen, Abigail, Alan Haggai Alavi, Alberto
Simões, Alexandr Ciornii, Andreas König, Andy Dougherty, Aristotle
Pagaltzis, Bo Johansson, Bo Lindbergh, Breno G. de Oliveira, brian d
foy, Brian Fraser, Brian Greenfield, Carl Hayter, Chas. Owens,
Chia-liang Kao, Chip Salzenberg, Chris 'BinGOs' Williams, Christian
Hansen, Christopher J. Madsen, chromatic, Claes Jacobsson, Claudio
Ramirez, Craig A. Berry, Damian Conway, Daniel Kahn Gillmor, Darin
McBride, Dave Rolsky, David Cantrell, David Golden, David Leadbeater,
David Mitchell, Dee Newcum, Dennis Kaarsemaker, Dominic Hargreaves,
Douglas Christopher Wilson, Eric Brine, Father Chrysostomos, Florian
Ragwitz, Frederic Briere, George Greer, Gerard Goossen, Gisle Aas,
H.Merijn Brand, Hojung Youn, Ian Goodacre, James E Keenan, Jan Dubois,
Jerry D. Hedden, Jesse Luehrs, Jesse Vincent, Jilles Tjoelker, Jim
Cromie, Jim Meyering, Joel Berger, Johan Vromans, Johannes Plunien, John
Hawkinson, John P. Linderman, John Peacock, Joshua ben Jore, Juerd
Waalboer, Karl Williamson, Karthik Rajagopalan, Keith Thompson, Kevin J.
Woolley, Kevin Ryde, Laurent Dami, Leo Lapworth, Leon Brocard, Leon
Timmermans, Louis Strous, Lukas Mai, Marc Green, Marcel Grünauer, Mark
A. Stratman, Mark Dootson, Mark Jason Dominus, Martin Hasch, Matthew
Horsfall, Max Maischein, Michael G Schwern, Michael Witten, Mike
Sheldrake, Moritz Lenz, Nicholas Clark, Niko Tyni, Nuno Carvalho, Pau
Amma, Paul Evans, Paul Green, Paul Johnson, Perlover, Peter John Acklam,
Peter Martini, Peter Scott, Phil Monsen, Pino Toscano, Rafael
Garcia-Suarez, Rainer Tammer, Reini Urban, Ricardo Signes, Robin Barker,
Rodolfo Carvalho, Salvador Fandiño, Sam Kimbrel, Samuel Thibault, Shawn
M Moore, Shigeya Suzuki, Shirakata Kentaro, Shlomi Fish, Sisyphus,
Slaven Rezic, Spiros Denaxas, Steffen Müller, Steffen Schwigon, Stephen
Bennett, Stephen Oberholtzer, Stevan Little, Steve Hay, Steve Peters,
Thomas Sibley, Thorsten Glaser, Timothe Litt, Todd Rinaldo, Tom
Christiansen, Tom Hukins, Tony Cook, Vadim Konovalov, Vincent Pit,
Vladimir Timofeev, Walt Mankowski, Yves Orton, Zefram, Zsbán Ambrus,
Ævar Arnfjörð Bjarmason.
.PP
The list above is almost certainly incomplete as it is automatically
generated from version control history. In particular, it does not
include the names of the (very much appreciated) contributors who
reported issues to the Perl bug tracker.
.PP
Many of the changes included in this version originated in the CPAN
modules included in Perl's core. We're grateful to the entire CPAN
community for helping Perl to flourish.
.PP
For a more complete list of all of Perl's historical contributors,
please see the \fIAUTHORS\fR file in the Perl source distribution.
.SH "Reporting Bugs"
.IX Header "Reporting Bugs"
If you find what you think is a bug, you might check the articles
recently posted to the comp.lang.perl.misc newsgroup and the perl
bug database at . There may also be
information at , the Perl Home Page.
.PP
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 \f(CW\*(C`perl \-V\*(C'\fR, will be sent off to perlbug@perl.org to be
analysed by the Perl porting team.
.PP
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 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 use this address only for security issues in the Perl
core, not for modules independently distributed on CPAN.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
The \fIChanges\fR file for an explanation of how to view exhaustive details
on what changed.
.PP
The \fIINSTALL\fR file for how to build Perl.
.PP
The \fIREADME\fR file for general stuff.
.PP
The \fIArtistic\fR and \fICopying\fR files for copyright information.