perldeltas - every perl*delta in one file
perldelta - what is new for perl v5.14.0
This document describes differences between the 5.12.0 release and the 5.14.0 release.
If you are upgrading from an earlier release such as 5.10.0, first read "p5120-NAME", which describes differences between 5.10.0 and 5.12.0.
Some of the bug fixes in this release have been backported to subsequent releases of 5.12.x. Those are indicated with the 5.12.x version in parentheses.
XXX Any important notices here
Perl comes with the Unicode 6.0 data base updated with Corrigendum #8, with one exception noted below. See http://unicode.org/versions/Unicode6.0.0 for details on the new release. Perl does not support any Unicode provisional properties, including the new ones for this release.
Unicode 6.0 has chosen to use the name BELL
for the character at U+1F514,
which is a symbol that looks like a bell,
and is used in Japanese cell phones.
This conflicts with the long-standing Perl usage of having BELL
mean the ASCII BEL
character,
U+0007.
In Perl 5.14,
\N{BELL}
will continue to mean U+0007,
but its use will generate a deprecated warning message,
unless such warnings are turned off.
The new name for U+0007 in Perl is ALERT
,
which corresponds nicely with the existing shorthand sequence for it,
"\a"
.
\N{BEL}
means U+0007,
with no warning given.
The character at U+1F514 will not have a name in 5.14,
but can be referred to by \N{U+1F514}
.
The plan is that in Perl 5.16,
\N{BELL}
will refer to U+1F514,
and so all code that uses \N{BELL}
should convert by then to using \N{ALERT}
,
\N{BEL}
,
or "\a"
instead.
use feature 'unicode_strings'
This release provides full functionality for use feature 'unicode_strings'
.
Under its scope,
all string operations executed and regular expressions compiled (even if executed outside its scope) have Unicode semantics.
See feature.
This feature avoids most forms of the "Unicode Bug" (See "The "Unicode Bug"" in perlunicode for details.) If there is a possibility that your code will process Unicode strings, you are strongly encouraged to use this subpragma to avoid nasty surprises.
\N{name}
and charnames
enhancements\N{}
and charnames::vianame
now know about the abbreviated character names listed by Unicode,
such as NBSP,
SHY,
LRO,
ZWJ,
etc.,
all the customary abbreviations for the C0 and C1 control characters (such as ACK,
BEL,
CAN,
etc.),
and a few new variants of some C1 full names that are in common usage.\N{...}
now recognizes these.\N{}
,
charnames::vianame
,
charnames::viacode
now know about every character in Unicode.
Previously,
they didn't know about the Hangul syllables nor a number of CJK (Chinese/Japanese/Korean) characters.\N{...}
,
charnames::vianame()
,
and charnames::viacode()
.
Previously,
an alias had to be to an official Unicode character name.
This made it impossible to create an alias for a code point that had no name,
such as those reserved for private use.charnames::string_vianame()
,
has been added.
This function is a run-time version of \N{...}
,
returning the string of characters whose Unicode name is its parameter.
It can handle Unicode named character sequences,
whereas the pre-existing charnames::vianame()
cannot,
as the latter returns a single code point.See charnames for details on all these changes.
Three new warnings subcategories of "utf8" have been added.
These allow you to turn off some "utf8" warnings,
while allowing others warnings to remain on.
The three categories are: surrogate
when UTF-16 surrogates are encountered; nonchar
when Unicode non-character code points are encountered; and non_unicode
when code points that are above the legal Unicode maximum of 0x10FFFF are encountered.
With this release,
Perl is adopting a model that any unsigned value can be treated as a code point and encoded internally (as utf8) without warnings - not just the code points that are legal in Unicode.
However,
unless utf8 or the corresponding sub-category (see previous item) warnings have been explicitly lexically turned off,
outputting or performing a Unicode-defined operation (such as upper-casing) on such a code point will generate a warning.
Attempting to input these using strict rules (such as with the :encoding('UTF-8')
layer) will continue to fail.
Prior to this release the handling was very inconsistent,
and incorrect in places.
Also,
the Unicode non-characters,
some of which previously were erroneously considered illegal in places by Perl,
contrary to the Unicode standard,
are now always legal internally.
But inputting or outputting them will work the same as for the non-legal Unicode code points,
as the Unicode standard says they are illegal for "open interchange".
The Unicode database files are no longer installed with Perl. This doesn't affect any functionality in Perl and saves significant disk space. If you previously were explicitly opening and reading those files, you can download them from http://www.unicode.org/Public/zipped/6.0.0/.
(?^...)
construct to signify default modifiersAn ASCII caret (also called a "circumflex accent") "^"
immediately following a "(?"
in a regular expression now means that the subexpression does not inherit the surrounding modifiers such as /i
,
but reverts to the Perl defaults.
Any modifiers following the caret override the defaults.
The stringification of regular expressions now uses this notation.
E.g.,
before,
qr/hlagh/i
would be stringified as (?i-xsm:hlagh)
,
but now it's stringified as (?^i:hlagh)
.
The main purpose of this is to allow tests that rely on the stringification not to have to change when new modifiers are added. See "Extended Patterns" in perlre.
/d
,
/l
,
/u
,
/a
,
and /aa
modifiersFour new regular expression modifiers have been added. These are mutually exclusive; one only can be turned on at a time.
The /l
modifier says to compile the regular expression as if it were in the scope of use locale
,
even if it is not.
The /u
modifier says to compile the regular expression as if it were in the scope of a use feature "unicode_strings"
pragma.
The /d
(default) modifier is used to override any use locale
and use feature "unicode_strings"
pragmas that are in effect at the time of compiling the regular expression.
The /a
regular expression modifier restricts \s
,
\d
and \w
and the Posix ([[:posix:]]
) character classes to the ASCII range.
Their complements and \b
and \B
are correspondingly affected.
Otherwise,
/a
behaves like the /u
modifier,
in that case-insensitive matching uses Unicode semantics.
The /aa
modifier is like /a
,
except that,
in case-insensitive matching,
no ASCII character will match a non-ASCII character.
For example,
'k' =~ /\N{KELVIN SIGN}/ai
will match; it won't under /aa
.
See "Modifiers" in perlre for more detail.
The substitution (s///
) and transliteration (y///
) operators now support an /r
option that copies the input variable, carries out the substitution on the copy and returns the result. The original remains unmodified.
my $old = 'cat'; my $new = $old =~ s/cat/dog/r; # $old is 'cat' and $new is 'dog'
This is particularly useful with map
. See perlop for more examples.
It is now safe to use regular expressions within (?{...})
and (??{...})
code blocks inside regular expressions.
These block are still experimental, however, and still have problems with lexical (my
) variables and abnormal exiting.
use re '/flags';
The re
pragma now has the ability to turn on regular expression flags till the end of the lexical scope:
use re '/x'; "foo" =~ / (.+) /; # /x implied
See "'/flags' mode" in re for details.
There is a new octal escape sequence, "\o"
, in double-quote-like contexts. This construct allows large octal ordinals beyond the current max of 0777 to be represented. It also allows you to specify a character in octal which can safely be concatenated with other regex snippets and which won't be confused with being a backreference to a regex capture group. See "Capture groups" in perlre.
\p{Titlecase}
as a synonym for \p{Title}
This synonym is added for symmetry with the Unicode property names \p{Uppercase}
and \p{Lowercase}
.
Regular expression debugging output (turned on by use re 'debug';
) now uses hexadecimal when escaping non-ASCII characters, instead of octal.
delete $+{...}
Custom regular expression engines can now determine the return value of delete
on an entry of %+
or %-
.
All built-in functions that operate directly on array or hash containers now also accept hard references to arrays or hashes:
|----------------------------+---------------------------| | Traditional syntax | Terse syntax | |----------------------------+---------------------------| | push @$arrayref, @stuff | push $arrayref, @stuff | | unshift @$arrayref, @stuff | unshift $arrayref, @stuff | | pop @$arrayref | pop $arrayref | | shift @$arrayref | shift $arrayref | | splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 | | keys %$hashref | keys $hashref | | keys @$arrayref | keys $arrayref | | values %$hashref | values $hashref | | values @$arrayref | values $arrayref | | ($k,$v) = each %$hashref | ($k,$v) = each $hashref | | ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref | |----------------------------+---------------------------|
This allows these built-in functions to act on long dereferencing chains or on the return value of subroutines without needing to wrap them in @{}
or %{}
:
push @{$obj->tags}, $new_tag; # old way push $obj->tags, $new_tag; # new way for ( keys %{$hoh->{genres}{artists}} ) {...} # old way for ( keys $hoh->{genres}{artists} ) {...} # new way
For push
, unshift
and splice
, the reference will auto-vivify if it is not defined, just as if it were wrapped with @{}
.
For keys
, values
, each
, when overloaded dereferencing is present, the overloaded dereference is used instead of dereferencing the underlying reftype. Warnings are issued about assumptions made in ambiguous cases.
The +
prototype is a special alternative to $
that will act like \[@%]
when given a literal array or hash variable, but will otherwise force scalar context on the argument. See "Prototypes" in perlsub.
package
block syntaxA package declaration can now contain a code block, in which case the declaration is in scope only inside that block. So package Foo { ... }
is precisely equivalent to { package Foo; ... }
. It also works with a version number in the declaration, as in package Foo 1.2 { ... }
. See perlfunc.
Statement labels can now occur before any type of statement or declaration, such as package
.
Multiple statement labels can now appear before a single statement.
Literals may now use either upper case 0X...
or 0B...
prefixes, in addition to the already supported 0x...
and 0b...
syntax [perl #76296].
C, Ruby, Python and PHP already supported this syntax, and it makes Perl more internally consistent. A round-trip with eval sprintf "%#X", 0x10
now returns 16
, the way eval sprintf "%#x", 0x10
does.
tie
, tied
and untie
can now be overridden [perl #75902].
Several changes have been made to the way die
, warn
, and $@
behave, in order to make them more reliable and consistent.
When an exception is thrown inside an eval
, the exception is no longer at risk of being clobbered by code running during unwinding (e.g., destructors). Previously, the exception was written into $@
early in the throwing process, and would be overwritten if eval
was used internally in the destructor for an object that had to be freed while exiting from the outer eval
. Now the exception is written into $@
last thing before exiting the outer eval
, so the code running immediately thereafter can rely on the value in $@
correctly corresponding to that eval
. ($@
is still also set before exiting the eval
, for the sake of destructors that rely on this.)
Likewise, a local $@
inside an eval
will no longer clobber any exception thrown in its scope. Previously, the restoration of $@
upon unwinding would overwrite any exception being thrown. Now the exception gets to the eval
anyway. So local $@
is safe before a die
.
Exceptions thrown from object destructors no longer modify the $@
of the surrounding context. (If the surrounding context was exception unwinding, this used to be another way to clobber the exception being thrown.) Previously such an exception was sometimes emitted as a warning, and then either was string-appended to the surrounding $@
or completely replaced the surrounding $@
, depending on whether that exception and the surrounding $@
were strings or objects. Now, an exception in this situation is always emitted as a warning, leaving the surrounding $@
untouched. In addition to object destructors, this also affects any function call performed by XS code using the G_KEEPERR
flag.
Warnings for warn
can now be objects, in the same way as exceptions for die
. If an object-based warning gets the default handling, of writing to standard error, it is stringified as before, with the file and line number appended. But a $SIG{__WARN__}
handler will now receive an object-based warning as an object, where previously it was passed the result of stringifying the object.
$0
sets the legacy process name with prctl()
on LinuxOn Linux the legacy process name is now set with prctl(2), in addition to altering the POSIX name via argv[0]
as perl has done since version 4.000. Now system utilities that read the legacy process name such as ps, top and killall will recognize the name you set when assigning to $0
. The string you supply will be cut off at 16 bytes; this is a limitation imposed by Linux.
srand()
now returns the seedThis allows programs that need to have repeatable results not to have to come up with their own seed-generating mechanism. Instead, they can use srand()
and stash the return value for future use. Typical is a test program which has too many combinations to test comprehensively in the time available to it each run. It can test a random subset each time and, should there be a failure, log the seed used for that run so that it can later be used to reproduce the same results.
Perl's printf and sprintf operators, and Perl's internal printf replacement function, now understand the C90 size modifiers "hh" (char
), "z" (size_t
), and "t" (ptrdiff_t
). Also, when compiled with a C99 compiler, Perl now understands the size modifier "j" (intmax_t
).
So, for example, on any modern machine, sprintf('%hhd', 257)
returns '1'.
${^GLOBAL_PHASE}
A new global variable, ${^GLOBAL_PHASE}
, has been added to allow introspection of the current phase of the perl interpreter. It's explained in detail in "${^GLOBAL_PHASE}" in perlvar and "BEGIN, UNITCHECK, CHECK, INIT and END" in perlmod.
-d:-foo
calls Devel::foo::unimport
The syntax -d:foo
was extended in 5.6.1 to make -d:foo=bar
equivalent to -MDevel::foo=bar
, which expands internally to use Devel::foo 'bar';
. perl now allows prefixing the module name with -
, with the same semantics as -M
, i.e.
-d:-foo
Equivalent to -M-Devel::foo
, expands to no Devel::foo;
, calls Devel::foo->unimport()
if the method exists.
-d:-foo=bar
Equivalent to -M-Devel::foo=bar
, expands to no Devel::foo 'bar';
, calls Devel::foo->unimport('bar')
if the method exists.
This is particularly useful for suppressing the default actions of a Devel::*
module's import
method whilst still loading it for debugging.
When a method call on a filehandle would die because the method cannot be resolved, and IO::File has not been loaded, Perl now loads IO::File via require
and attempts method resolution again:
open my $fh, ">", $file; $fh->binmode(":raw"); # loads IO::File and succeeds
This also works for globs like STDOUT, STDERR and STDIN:
STDOUT->autoflush(1);
Because this on-demand load only happens if method resolution fails, the legacy approach of manually loading an IO::File parent class for partial method support still works as expected:
use IO::Handle; open my $fh, ">", $file; $fh->autoflush(1); # IO::File not loaded
The Socket
module provides new affordances for IPv6, including implementations of the Socket::getaddrinfo()
and Socket::getnameinfo()
functions, along with related constants, and a handful of new functions. See Socket.
The DTrace probes now include an additional argument (arg3
) which contains the package the subroutine being entered or left was compiled in.
For example using the following DTrace script:
perl$target:::sub-entry { printf("%s::%s\n", copyinstr(arg0), copyinstr(arg3)); }
and then running:
perl -e'sub test { }; test'
DTrace will print:
main::test
In "User-Defined Character Properties" in perlunicode, it says you can create custom properties by defining subroutines whose names begin with "In" or "Is". However, Perl did not actually enforce that naming restriction, so \p{foo::bar} could call foo::bar() if it existed. Now this convention has been enforced.
Also, Perl no longer allows a tainted regular expression to invoke a user-defined property. It simply dies instead [perl #82616].
Perl 5.14.0 is not binary-compatible with any previous stable release.
In addition to the sections that follow, see "p5140-C API Changes".
Use of \400
-\777
in regexes in certain circumstances has given different, anomalous behavior than their use in all other double-quote-like contexts. Since 5.10.1, a deprecated warning message has been raised when this happens. Now, all double-quote-like contexts have the same behavior, namely to be equivalent to \x{100}
- \x{1FF}
, with no deprecation warning. Use of these values in the command line option "-0"
retains the current meaning to slurp input files whole; previously, this was documented only for "-0777"
. It is recommended, however, because of various ambiguities, to use the new \o{...}
construct to represent characters in octal.
\p{}
properties are now immune to case-insensitive matchingFor most Unicode properties, it doesn't make sense to have them match differently under /i
case-insensitive matching than not. And doing so leads to unexpected results and potential security holes. For example
m/\p{ASCII_Hex_Digit}+/i
could previously match non-ASCII characters because of the Unicode matching rules (although there were a number of bugs with this). Now matching under /i
gives the same results as non-/i
matching except for those few properties where people have come to expect differences, namely the ones where casing is an integral part of their meaning, such as m/\p{Uppercase}/i
and m/\p{Lowercase}/i
, both of which match the exact same code points, namely those matched by m/\p{Cased}/i
. Details are in "Unicode Properties" in perlrecharclass.
User-defined property handlers that need to match differently under /i
must change to read the new boolean parameter passed to them which is non-zero if case-insensitive matching is in effect or 0 otherwise. See "User-Defined Character Properties" in perluniprops.
Now, a Unicode property match specified in the pattern will indicate that the pattern is meant for matching according to Unicode rules, the way \N{}
does.
Regular expressions compiled under "use locale"
now retain this when interpolated into a new regular expression compiled outside a "use locale"
, and vice-versa.
Previously, a regular expression interpolated into another one inherited the localeness of the surrounding one, losing whatever state it originally had. This is considered a bug fix, but may trip up code that has come to rely on the incorrect behavior.
Default regular expression modifiers are now notated by using (?^...)
. Code relying on the old stringification will fail. The purpose of this is so that when new modifiers are added, such code will not have to change (after this one time), as the stringification will automatically incorporate the new modifiers.
Code that needs to work properly with both old- and new-style regexes can avoid the whole issue by using (for Perls since 5.9.5; see re):
use re qw(regexp_pattern); my ($pat, $mods) = regexp_pattern($re_ref);
If the actual stringification is important, or older Perls need to be supported, you can use something like the following:
# Accept both old and new-style stringification my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
And then use $modifiers
instead of -xism
.
Code blocks in regular expressions ((?{...})
and (??{...})
) used not to inherit any pragmata (strict, warnings, etc.) if the regular expression was compiled at run time as happens in cases like these two:
use re 'eval'; $foo =~ $bar; # when $bar contains (?{...}) $foo =~ /$bar(?{ $finished = 1 })/;
This was a bug, which has now been fixed. But it has the potential to break any code that was relying on it.
In the following:
tie @a, ...; { local @a; # here, @a is a now a new, untied array } # here, @a refers again to the old, tied array
The new local array used to be made tied too, which was fairly pointless, and has now been fixed. This fix could however potentially cause a change in behaviour of some code.
defined %Foo::
now always returns true, even when no symbols have yet been defined in that package.
This is a side effect of removing a special case kludge in the tokeniser, added for 5.10.0, to hide side effects of changes to the internal storage of hashes that drastically reduce their memory usage overhead.
Calling defined on a stash has been deprecated since 5.6.0, warned on lexicals since 5.6.0, and warned for stashes (and other package variables) since 5.12.0. defined %hash
has always exposed an implementation detail - emptying a hash by deleting all entries from it does not make defined %hash
false, hence defined %hash
is not valid code to determine whether an arbitrary hash is empty. Instead, use the behaviour that an empty %hash
always returns false in a scalar context.
Stash list assignment %foo:: = ()
used to make the stash anonymous temporarily while it was being emptied. Consequently, any of its subroutines referenced elsewhere would become anonymous (showing up as "(unknown)" in caller
). Now they retain their package names, such that caller
will return the original sub name if there is still a reference to its typeglob, or "foo::__ANON__" otherwise [perl #79208].
If you assign a typeglob to a scalar variable:
$glob = *foo;
the glob that is copied to $glob
is marked with a special flag indicating that the glob is just a copy. This allows subsequent assignments to $glob
to overwrite the glob. The original glob, however, is immutable.
Some Perl operators did not distinguish between these two types of globs. This would result in strange behaviour in edge cases: untie $scalar
would not untie the scalar if the last thing assigned to it was a glob (because it treated it as untie *$scalar
, which unties a handle). Assignment to a glob slot (e.g., *$glob = \@some_array
) would simply assign \@some_array
to $glob
.
To fix this, the *{}
operator (including the *foo
and *$foo
forms) has been modified to make a new immutable glob if its operand is a glob copy. This allows operators that make a distinction between globs and scalars to be modified to treat only immutable globs as globs. (tie
, tied
and untie
have been left as they are for compatibility's sake, but will warn. See "p5140-Deprecations".)
This causes an incompatible change in code that assigns a glob to the return value of *{}
when that operator was passed a glob copy. Take the following code, for instance:
$glob = *foo; *$glob = *bar;
The *$glob
on the second line returns a new immutable glob. That new glob is made an alias to *bar
. Then it is discarded. So the second assignment has no effect.
See http://rt.perl.org/rt3/Public/Bug/Display.html?id=77810 for even more detail.
In previous versions of Perl, magic variables like $!
, %SIG
, etc. would 'leak' into other packages. So %foo::SIG
could be used to access signals, ${"foo::!"}
(with strict mode off) to access C's errno
, etc.
This was a bug, or an 'unintentional' feature, which caused various ill effects, such as signal handlers being wiped when modules were loaded, etc.
This has been fixed (or the feature has been removed, depending on how you see it).
local() on scalar variables will give them a new value, but keep all their magic intact. This has proven to be problematic for the default scalar variable $_, where perlsub recommends that any subroutine that assigns to $_ should localize it first. This would throw an exception if $_ is aliased to a read-only variable, and could have various unintentional side-effects in general.
Therefore, as an exception to the general rule, local($_) will not only assign a new value to $_, but also remove all existing magic from it as well.
The parsing of the names of packages and package variables has changed, in that multiple adjacent pairs of colons (as in foo::::bar) are all treated as package separators.
Regardless of this change, the exact parsing of package separators has never been guaranteed and is subject to change in future Perl versions.
given
return valuesgiven
blocks now return the last evaluated expression, or an empty list if the block was exited by break
. Thus you can now write:
my $type = do { given ($num) { break when undef; 'integer' when /^[+-]?[0-9]+$/; 'float' when /^[+-]?[0-9]+(?:\.[0-9]+)?$/; 'unknown'; } };
See "Return value" in perlsyn for details.
Functions declared with the following prototypes now behave correctly as unary functions:
* \$ \% \@ \* \& \[...] ;$ ;* ;\$ ;\% etc. ;\[...]
Due to this bug fix [perl #75904], functions using the (*)
, (;$)
and (;*)
prototypes are parsed with higher precedence than before. So in the following example:
sub foo($); foo $a < $b;
the second line is now parsed correctly as foo($a) < $b
, rather than foo($a < $b)
. This happens when one of these operators is used in an unparenthesised argument:
< > <= >= lt gt le ge == != <=> eq ne cmp ~~ & | ^ && || // .. ... ?: = += -= *= etc.
Previously, the following code resulted in a successful match:
my @a = qw(a y0 z); my @b = qw(a x0 z); @a[0 .. $#b] ~~ @b;
This odd behaviour has now been fixed [perl #77468].
The unary negation operator -
now treats strings that look like numbers as numbers [perl #57706].
Negative zero (-0.0), when converted to a string, now becomes "0" on all platforms. It used to become "-0" on some, but "0" on others.
If you still need to determine whether a zero is negative, use sprintf("%g", $zero) =~ /^-/
or the Data::Float module on CPAN.
:=
is now a syntax errorPreviously my $pi := 4;
was exactly equivalent to my $pi : = 4;
, with the :
being treated as the start of an attribute list, ending before the =
. The use of :=
to mean : =
was deprecated in 5.12.0, and is now a syntax error. This will allow the future use of :=
as a new token.
We find no Perl 5 code on CPAN using this construction, outside the core's tests for it, so we believe that this change will have very little impact on real-world codebases.
If it is absolutely necessary to have empty attribute lists (for example, because of a code generator) then avoid the error by adding a space before the =
.
Characters outside the Unicode "XIDStart" set are no longer allowed at the beginning of an identifier. This means that certain accents and marks that normally follow an alphabetic character may no longer be the first character of an identifier.
On systems other than Windows that do not have a fchdir
function, newly-created threads no longer inherit directory handles from their parent threads. Such programs would usually have crashed anyway [perl #75154].
close
on shared pipesThe close
function no longer waits for the child process to exit if the underlying file descriptor is still in use by another thread, to avoid deadlocks. It returns true in such cases.
On Windows parent processes would not terminate until all forked childred had terminated first. However, kill('KILL', ...)
is inherently unstable on pseudo-processes, and kill('TERM', ...)
might not get delivered if the child is blocked in a system call.
To avoid the deadlock and still provide a safe mechanism to terminate the hosting process, Perl will now no longer wait for children that have been sent a SIGTERM signal. It is up to the parent process to waitpid() for these children if child clean-up processing must be allowed to finish. However, it is also the responsibility of the parent then to avoid the deadlock by making sure the child process can't be blocked on I/O either.
See perlfork for more information about the fork() emulation on Windows.
Several long-standing typos and naming confusions in Policy_sh.SH have been fixed, standardizing on the variable names used in config.sh.
This will change the behavior of Policy.sh if you happen to have been accidentally relying on its incorrect behavior.
Perl scripts used to be read in binary mode on Windows for the benefit of the ByteLoader module (which is no longer part of core Perl). This had the side effect of breaking various operations on the DATA filehandle, including seek()/tell(), and even simply reading from DATA after file handles have been flushed by a call to system(), backticks, fork() etc.
The default build options for Windows have been changed to read Perl source code on Windows in text mode now. Hopefully ByteLoader will be updated on CPAN to automatically handle this situation [perl #28106].
See also "p5140-Deprecated C APIs".
Omitting a space between a regular expression operator or its modifiers and the following word is deprecated. For example, m/foo/sand $bar
will still be parsed as m/foo/s and $bar
but will issue a warning.
\cX
The backslash-c construct was designed as a way of specifying non-printable characters, but there were no restrictions (on ASCII platforms) on what the character following the c
could be. Now, a deprecation warning is raised if that character isn't an ASCII character. Also, a deprecation warning is raised for "\c{"
(which is the same as simply saying ";"
).
"\b{"
and "\B{"
In regular expressions, a literal "{"
immediately following a "\b"
(not in a bracketed character class) or a "\B{"
is now deprecated to allow for its future use by Perl itself.
This is a mandatory warning, not obeying -X or lexical warning bits. The warning is modelled on that supplied by deprecate.pm for deprecated-in-core .pm libraries. It points to the specific CPAN distribution that contains the .pl libraries. The CPAN version, of course, does not generate the warning.
$[
Assignment to $[
was deprecated and started to give warnings in Perl version 5.12.0. This version of perl also starts to emit a warning when assigning to $[
in list context. This fixes an oversight in 5.12.0.
Historically the parser fooled itself into thinking that qw(...)
literals were always enclosed in parentheses, and as a result you could sometimes omit parentheses around them:
for $x qw(a b c) { ... }
The parser no longer lies to itself in this way. Wrap the list literal in parentheses, like this:
for $x (qw(a b c)) { ... }
\N{BELL}
is deprecatedThis is because Unicode is using that name for a different character. See "p5140-Unicode Version 6.0 is now supported (mostly)" for more explanation.
?PATTERN?
is deprecated?PATTERN?
(without the initial m) has been deprecated and now produces a warning. This is to allow future use of ?
in new operators. The match-once functionality is still available in the form of m?PATTERN?
.
Calling a tie function (tie
, tied
, untie
) with a scalar argument acts on a file handle if the scalar happens to hold a typeglob.
This is a long-standing bug that will be removed in Perl 5.16, as there is currently no way to tie the scalar itself when it holds a typeglob, and no way to untie a scalar that has had a typeglob assigned to it.
Now there is a deprecation warning whenever a tie function is used on a handle without an explicit *
.
This feature is being deprecated due to its many issues, as documented in "User-Defined Case Mappings (for serious hackers only)" in perlunicode. It is planned to remove this feature in Perl 5.16. Instead use the CPAN module Unicode::Casing, which provides improved functionality.
The following modules will be removed from the core distribution in a future release, and should be installed from CPAN instead. Distributions on CPAN which require these should add them to their prerequisites. The core versions of these modules will issue a deprecation warning.
If you ship a packaged version of Perl, either alone or as part of a larger system, then you should carefully consider the repercussions of core module deprecations. You may want to consider shipping your default build of Perl with packages for some or all deprecated modules which install into vendor
or site
perl library directories. This will inhibit the deprecation warnings.
Alternatively, you may want to consider patching lib/deprecate.pm to provide deprecation warnings specific to your packaging system or distribution of Perl, consistent with how your packaging system or distribution manages a staged transition from a release where the installation of a single package provides the given functionality, to a later release where the system administrator needs to know to install multiple packages to get that same functionality.
You can silence these deprecation warnings by installing the modules in question from CPAN. To install the latest version of all of them, just install Task::Deprecations::5_14
.
We strongly recommend that you install and used Devel::NYTProf in preference, as it offers significantly improved profiling and reporting.
Signal dispatch has been moved from the runloop into control ops. This should give a few percent speed increase, and eliminates almost all of the speed penalty caused by the introduction of "safe signals" in 5.8.0. Signals should still be dispatched within the same statement as they were previously - if this is not the case, or it is possible to create uninterruptible loops, this is a bug, and reports are encouraged of how to recreate such issues.
Two fewer OPs are used for shift and pop calls with no argument (with implicit @_
). This change makes shift;
5% faster than shift @_;
on non-threaded perls and 25% faster on threaded.
The foldEQ_utf8 API function for case-insensitive comparison of strings (which is used heavily by the regexp engine) was substantially refactored and optimised - and its documentation much improved as a free bonus gift.
Compiling regular expressions has been made faster for the case where upgrading the regex to utf8 is necessary but that isn't known when the compilation begins.
When doing a lot of string appending, perl could end up allocating a lot more memory than needed in a very inefficient way, if perl was configured to use the system's malloc
implementation instead of its own.
sv_grow
, which is what's being used to allocate more memory if necessary when appending to a string, has now been taught how to round up the memory it requests to a certain geometric progression, making it much faster on certain platforms and configurations. On Win32, it's now about 100 times faster.
PL_*
accessor functions under ithreadsWhen MULTIPLICITY
was first developed, and interpreter state moved into an interpreter struct, thread and interpreter local PL_*
variables were defined as macros that called accessor functions, returning the address of the value, outside of the perl core. The intent was to allow members within the interpreter struct to change size without breaking binary compatibility, so that bug fixes could be merged to a maintenance branch that necessitated such a size change.
However, some non-core code defines PERL_CORE
, sometimes intentionally to bypass this mechanism for speed reasons, sometimes for other reasons but with the inadvertent side effect of bypassing this mechanism. As some of this code is widespread in production use, the result is that the core can't change the size of members of the interpreter struct, as it will break such modules compiled against a previous release on that maintenance branch. The upshot is that this mechanism is redundant, and well-behaved code is penalised by it. Hence it can and should be removed (and has been).
When an object has many weak references to it, freeing that object can under some some circumstances take O(N^2) time to free (where N is the number of references). The number of circumstances has been reduced [perl #75254]
An earlier optimisation to speed up my @array = ...
and my %hash = ...
assignments caused a bug and was disabled in Perl 5.12.0.
Now we have found another way to speed up these assignments [perl #82110].
@_
uses less memoryPreviously, @_
was allocated for every subroutine at compile time with enough space for four entries. Now this allocation is done on demand when the subroutine is called [perl #72416].
xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash and on some systems will cause struct xpvhv to become cache-aligned. To avoid this memory saving causing a slowdown elsewhere, boolean use of HvFILL now calls HvTOTALKEYS instead (which is equivalent) - so while the fill data when actually required are now calculated on demand, the cases when this needs to be done should be few and far between.
The order of structure elements in SV bodies has changed. Effectively, the NV slot has swapped location with STASH and MAGIC. As all access to SV members is via macros, this should be completely transparent. This change allows the space saving for PVHVs documented above, and may reduce the memory allocation needed for PVIVs on some architectures.
XPV
, XPVIV
, and XPVNV
now only allocate the parts of the SV
body they actually use, saving some space.
Scalars containing regular expressions now only allocate the part of the SV
body they actually use, saving some space.
The @EXPORT_FAIL AV is no longer created unless required, hence neither is the typeglob backing it. This saves about 200 bytes for every package that uses Exporter but doesn't use this functionality.
For weak references, the common case of just a single weak reference per referent has been optimised to reduce the storage required. In this case it saves the equivalent of one small Perl array per referent.
%+
and %-
use less memoryThe bulk of the Tie::Hash::NamedCapture
module used to be in the perl core. It has now been moved to an XS module, to reduce the overhead for programs that do not use %+
or %-
.
The internal structures of threading now make fewer API calls and fewer allocations, resulting in noticeably smaller object code. Additionally, many thread context checks have been deferred so that they're only done when required (although this is only possible for non-debugging builds).
Previously, in code such as
use constant DEBUG => 0; sub GAK { warn if DEBUG; print "stuff\n"; }
the ops for warn if DEBUG;
would be folded to a null
op (ex-const
), but the nextstate
op would remain, resulting in a runtime op dispatch of nextstate
, nextstate
, ....
The execution of a sequence of nextstate
ops is indistinguishable from just the last nextstate
op so the peephole optimizer now eliminates the first of a pair of nextstate
ops, except where the first carries a label, since labels must not be eliminated by the optimizer and label usage isn't conclusively known at compile time.
CPAN::Meta::YAML
0.003 has been added as a dual-life module. It supports a subset of YAML sufficient for reading and writing META.yml and MYMETA.yml files included with CPAN distributions or generated by the module installation toolchain. It should not be used for any other general YAML parsing or generation task.CPAN::Meta
version 2.110440 has been added as a dual-life module. It provides a standard library to read, interpret and write CPAN distribution metadata files (e.g. META.json and META.yml) which describes a distribution, its contents, and the requirements for building it and installing it. The latest CPAN distribution metadata specification is included as CPAN::Meta::Spec
and notes on changes in the specification over time are given in CPAN::Meta::History
.HTTP::Tiny
0.012 has been added as a dual-life module. It is a very small, simple HTTP/1.1 client designed for simple GET requests and file mirroring. It has has been added to enable CPAN.pm and CPANPLUS to "bootstrap" HTTP access to CPAN using pure Perl without relying on external binaries like curl or wget.JSON::PP
2.27105 has been added as a dual-life module, for the sake of reading META.json files in CPAN distributions.Module::Metadata
1.000004 has been added as a dual-life module. It gathers package and POD information from Perl module files. It is a standalone module based on Module::Build::ModuleInfo for use by other module installation toolchain components. Module::Build::ModuleInfo has been deprecated in favor of this module instead.Perl::OSType
1.002 has been added as a dual-life module. It maps Perl operating system names (e.g. 'dragonfly' or 'MSWin32') to more generic types with standardized names (e.g. "Unix" or "Windows"). It has been refactored out of Module::Build and ExtUtils::CBuilder and consolidates such mappings into a single location for easier maintenance.Unicode::Collate
upgrade. See below for details.
Unicode::Collate::CJK::Big5
Unicode::Collate::CJK::GB2312
Unicode::Collate::CJK::JISX0208
Unicode::Collate::CJK::Korean
Unicode::Collate::CJK::Pinyin
Unicode::Collate::CJK::Stroke
Version::Requirements
version 0.101020 has been added as a dual-life module. It provides a standard library to model and manipulates module prerequisites and version constraints as defined in the CPAN::Meta::Spec.attributes
has been upgraded from version 0.12 to 0.14.Archive::Extract
has been upgraded from version 0.38 to 0.48.
Updates since 0.38 include: a safe print method that guards Archive::Extract from changes to $\; a fix to the tests when run in core perl; support for TZ files; a modification for the lzma logic to favour IO::Uncompress::Unlzma; and a fix for an issue with NetBSD-current and its new unzip executable.
Archive::Tar
has been upgraded from version 1.54 to 1.76.
Important changes since 1.54 include the following:
write()
and create_archive()
close only handles they openedptar
utility has a new option to allow safe creation of tarballs without world-writable files on Windows, allowing those archives to be uploaded to CPAN.Attribute::Handlers
has been upgraded from version 0.87 to 0.89.autodie
has been upgraded from version 2.06_01 to 2.1001.AutoLoader
has been upgraded from version 5.70 to 5.71.B
has been upgraded from version 1.23 to 1.29.
It no longer crashes when taking apart a y///
containing characters outside the octet range or compiled in a use utf8
scope.
The size of the shared object has been reduced by about 40%, with no reduction in functionality.
B::Concise
has been upgraded from version 0.78 to 0.83.
B::Concise marks rv2sv, rv2av and rv2hv ops with the new OPpDEREF flag as "DREFed".
It no longer produces mangled output with the -tree
option [perl #80632].
B::Debug
has been upgraded from version 1.12 to 1.16.B::Deparse
has been upgraded from version 0.96 to 1.03.
The deparsing of a nextstate op has changed when it has both a change of package (relative to the previous nextstate), or a change of %^H
or other state, and a label. Previously the label was emitted first, but now the label is emitted last (5.12.1).
The no 5.13.2
or similar form is now correctly handled by B::Deparse (5.12.3).
B::Deparse now properly handles the code that applies a conditional pattern match against implicit $_
as it was fixed in [perl #20444].
Deparsing of our
followed by a variable with funny characters (as permitted under the utf8
pragma) has also been fixed [perl #33752].
B::Lint
has been upgraded from version 1.11_01 to 1.13.base
has been upgraded from version 2.15 to 2.16.Benchmark
has been upgraded from version 1.11 to 1.12.bignum
has been upgraded from version 0.23 to 0.27.Carp
has been upgraded from version 1.15 to 1.20.
Carp now detects incomplete caller() overrides and avoids using bogus @DB::args
. To provide backtraces, Carp relies on particular behaviour of the caller
built-in. Carp now detects if other code has overridden this with an incomplete implementation, and modifies its backtrace accordingly. Previously incomplete overrides would cause incorrect values in backtraces (best case), or obscure fatal errors (worst case).
This fixes certain cases of Bizarre copy of ARRAY
caused by modules overriding caller()
incorrectly (5.12.2).
It now also avoids using regular expressions that cause perl to load its Unicode tables, in order to avoid the 'BEGIN not safe after errors' error that will ensue if there has been a syntax error [perl #82854].
CGI
has been upgraded from version 3.48 to 3.52.
This provides the following security fixes: the MIME boundary in multipart_init is now random and the handling of newlines embedded in header values has been improved.
Compress::Raw::Bzip2
has been upgraded from version 2.024 to 2.033.
It has been updated to use bzip2 1.0.6.
Compress::Raw::Zlib
has been upgraded from version 2.024 to 2.033.CPAN
has been upgraded from version 1.94_56 to 1.9600.
Major highlights:
CPANPLUS
has been upgraded from version 0.90 to 0.9103.
A change to cpanp-run-perl resolves RT #55964 and RT #57106, both of which related to failures to install distributions that use Module::Install::DSL
(5.12.2).
A dependency on Config was not recognised as a core module dependency. This has been fixed.
CPANPLUS now includes support for META.json and MYMETA.json.
CPANPLUS::Dist::Build
has been upgraded from version 0.46 to 0.54.Data::Dumper
has been upgraded from version 2.125 to 2.130_02.
The indentation used to be off when $Data::Dumper::Terse
was set. This has been fixed [perl #73604].
This upgrade also fixes a crash when using custom sort functions that might cause the stack to change [perl #74170].
Dumpxs
no longer crashes with globs returned by *$io_ref
[perl #72332].
DB_File
has been upgraded from version 1.820 to 1.821.DBM_Filter
has been upgraded from version 0.03 to 0.04.Devel::DProf
has been upgraded from version 20080331.00 to 20110228.00.
Merely loading Devel::DProf
now no longer triggers profiling to start. use Devel::DProf
and perl -d:DProf ...
still behave as before and start the profiler.
NOTE: Devel::DProf
is deprecated and will be removed from a future version of Perl. We strongly recommend that you install and use Devel::NYTProf instead, as it offers significantly improved profiling and reporting.
Devel::Peek
has been upgraded from version 1.04 to 1.07.Devel::SelfStubber
has been upgraded from version 1.03 to 1.05.diagnostics
has been upgraded from version 1.19 to 1.22.
It now renders pod links slightly better, and has been taught to find descriptions for messages that share their descriptions with other messages.
Digest::MD5
has been upgraded from version 2.39 to 2.51.
It is now safe to use this module in combination with threads.
Digest::SHA
has been upgraded from version 5.47 to 5.61.
shasum
now more closely mimics sha1sum
/md5sum
.
Addfile
accepts all POSIX filenames.
New SHA-512/224 and SHA-512/256 transforms (ref. NIST Draft FIPS 180-4 [February 2011])
DirHandle
has been upgraded from version 1.03 to 1.04.Dumpvalue
has been upgraded from version 1.13 to 1.16.DynaLoader
has been upgraded from version 1.10 to 1.13.
It fixes a buffer overflow when passed a very long file name.
It no longer inherits from AutoLoader; hence it no longer produces weird error messages for unsuccessful method calls on classes that inherit from DynaLoader [perl #84358].
Encode
has been upgraded from version 2.39 to 2.42.
Now, all 66 Unicode non-characters are treated the same way U+FFFF has always been treated; in cases when it was disallowed, all 66 are disallowed; in those cases where it warned, all 66 warn.
Env
has been upgraded from version 1.01 to 1.02.Errno
has been upgraded from version 1.11 to 1.13.
The implementation of Errno
has been refactored to use about 55% less memory.
On some platforms with unusual header files, like Win32/gcc using mingw64 headers, some constants which weren't actually error numbers have been exposed by Errno
. This has been fixed [perl #77416].
Exporter
has been upgraded from version 5.64_01 to 5.64_03.
Exporter no longer overrides $SIG{__WARN__}
[perl #74472]
ExtUtils::CBuilder
has been upgraded from version 0.27 to 0.280203.ExtUtils::Command
has been upgraded from version 1.16 to 1.17.ExtUtils::Constant
has been upgraded from 0.22 to 0.23.
The AUTOLOAD
helper code generated by ExtUtils::Constant::ProxySubs
can now croak
for missing constants, or generate a complete AUTOLOAD
subroutine in XS, allowing simplification of many modules that use it (Fcntl
, File::Glob
, GDBM_File
, I18N::Langinfo
, POSIX
, Socket
).
ExtUtils::Constant::ProxySubs
can now optionally push the names of all constants onto the package's @EXPORT_OK
.
ExtUtils::Install
has been upgraded from version 1.55 to 1.56.ExtUtils::MakeMaker
has been upgraded from version 6.56 to 6.57_05.ExtUtils::Manifest
has been upgraded from version 1.57 to 1.58.ExtUtils::ParseXS
has been upgraded from version 2.21 to 2.2210.Fcntl
has been upgraded from version 1.06 to 1.11.File::Basename
has been upgraded from version 2.78 to 2.82.File::CheckTree
has been upgraded from version 4.4 to 4.41.File::Copy
has been upgraded from version 2.17 to 2.21.File::DosGlob
has been upgraded from version 1.01 to 1.04.
It allows patterns containing literal parentheses (they no longer need to be escaped). On Windows, it no longer adds an extra ./ to the file names returned when the pattern is a relative glob with a drive specification, like c:*.pl [perl #71712].
File::Fetch
has been upgraded from version 0.24 to 0.32.
HTTP::Lite
is now supported for 'http' scheme.
The fetch
utility is supported on FreeBSD, NetBSD and Dragonfly BSD for the http
and ftp
schemes.
File::Find
has been upgraded from version 1.15 to 1.19.
It improves handling of backslashes on Windows, so that paths like c:\dir\/file are no longer generated [perl #71710].
File::Glob
has been upgraded from version 1.07 to 1.12.File::Spec
has been upgraded from version 3.31 to 3.33.
Several portability fixes were made in File::Spec::VMS
: a colon is now recognized as a delimiter in native filespecs; caret-escaped delimiters are recognized for better handling of extended filespecs; catpath()
returns an empty directory rather than the current directory if the input directory name is empty; abs2rel()
properly handles Unix-style input (5.12.2).
File::stat
has been upgraded from 1.02 to 1.05.
The -x
and -X
file test operators now work correctly under the root user.
Filter::Simple
has been upgraded from version 0.84 to 0.86.GDBM_File
has been upgraded from 1.10 to 1.14.
This fixes a memory leak when DBM filters are used.
Hash::Util
has been upgraded from 0.07 to 0.11.
Hash::Util no longer emits spurious "uninitialized" warnings when recursively locking hashes that have undefined values [perl #74280].
Hash::Util::FieldHash
has been upgraded from version 1.04 to 1.09.I18N::Collate
has been upgraded from version 1.01 to 1.02.I18N::Langinfo
has been upgraded from version 0.03 to 0.08.
langinfo()
now defaults to using $_
if there is no argument given, just as the documentation has always claimed.
I18N::LangTags
has been upgraded from version 0.35 to 0.35_01.if
has been upgraded from version 0.05 to 0.0601.IO
has been upgraded from version 1.25_02 to 1.25_04.
This version of IO
includes a new IO::Select
, which now allows IO::Handle objects (and objects in derived classes) to be removed from an IO::Select set even if the underlying file descriptor is closed or invalid.
IPC::Cmd
has been upgraded from version 0.54 to 0.70.
Resolves an issue with splitting Win32 command lines. An argument consisting of the single character "0" used to be omitted (CPAN RT #62961).
IPC::Open3
has been upgraded from 1.05 to 1.09.
open3
now produces an error if the exec
call fails, allowing this condition to be distinguished from a child process that exited with a non-zero status [perl #72016].
The internal xclose
routine now knows how to handle file descriptors, as documented, so duplicating STDIN in a child process using its file descriptor now works [perl #76474].
IPC::SysV
has been upgraded from version 2.01 to 2.03.lib
has been upgraded from version 0.62 to 0.63.Locale::Maketext
has been upgraded from version 1.14 to 1.19.
Locale::Maketext now supports external caches.
This upgrade also fixes an infinite loop in Locale::Maketext::Guts::_compile()
when working with tainted values (CPAN RT #40727).
->maketext
calls will now back up and restore $@
so that error messages are not suppressed (CPAN RT #34182).
Log::Message
has been upgraded from version 0.02 to 0.04.Log::Message::Simple
has been upgraded from version 0.06 to 0.08.Math::BigInt
has been upgraded from version 1.89_01 to 1.994.
This fixes, among other things, incorrect results when computing binomial coefficients [perl #77640].
It also prevents sqrt($int)
from crashing under use bigrat;
[perl #73534].
Math::BigInt::FastCalc
has been upgraded from version 0.19 to 0.28.Math::BigRat
has been upgraded from version 0.24 to 0.26_02.Memoize
has been upgraded from version 1.01_03 to 1.02.MIME::Base64
has been upgraded from 3.08 to 3.13.
Includes new functions to calculate the length of encoded and decoded base64 strings.
Now provides encode_base64url
and decode_base64url
functions to process the base64 scheme for "URL applications".
Module::Build
has been upgraded from version 0.3603 to 0.3800.
A notable change is the deprecation of several modules. Module::Build::Version has been deprecated and Module::Build now relies directly upon version. Module::Build::ModuleInfo has been deprecated in favor of a standalone copy of it called Module::Metadata. Module::Build::YAML has been deprecated in favor of CPAN::Meta::YAML.
Module::Build now also generates META.json and MYMETA.json files in accordance with version 2 of the CPAN distribution metadata specification, CPAN::Meta::Spec. The older format META.yml and MYMETA.yml files are still generated, as well.
Module::CoreList
has been upgraded from version 2.29 to 2.47.
Besides listing the updated core modules of this release, it also stops listing the Filespec
module. That module never existed in core. The scripts generating Module::CoreList
confused it with VMS::Filespec
, which actually is a core module as of perl 5.8.7.
Module::Load
has been upgraded from version 0.16 to 0.18.Module::Load::Conditional
has been upgraded from version 0.34 to 0.44.mro
has been upgraded from version 1.02 to 1.07.NDBM_File
has been upgraded from version 1.08 to 1.12.
This fixes a memory leak when DBM filters are used.
Net::Ping
has been upgraded from version 2.36 to 2.38.NEXT
has been upgraded from version 0.64 to 0.65.Object::Accessor
has been upgraded from version 0.36 to 0.38.ODBM_File
have been upgraded from version 1.07 to 1.10.
This fixes a memory leak when DBM filters are used.
Opcode
has been upgraded from version 1.15 to 1.18.overload
has been upgraded from 1.10 to 1.13.
overload::Method
can now handle subroutines that are themselves blessed into overloaded classes [perl #71998].
The documentation has greatly improved. See "p5140-Documentation" below.
Params::Check
has been upgraded from version 0.26 to 0.28.parent
has been upgraded from version 0.223 to 0.225.Parse::CPAN::Meta
has been upgraded from version 1.40 to 1.4401.
The latest Parse::CPAN::Meta can now read YAML and JSON files using CPAN::Meta::YAML and JSON::PP, which are now part of the Perl core.
PerlIO::encoding
has been upgraded from version 0.12 to 0.14.PerlIO::scalar
has been upgraded from 0.07 to 0.11.
A read
after a seek
beyond the end of the string no longer thinks it has data to read [perl #78716].
PerlIO::via
has been upgraded from version 0.09 to 0.11.Pod::Html
has been upgraded from version 1.09 to 1.11.Pod::LaTeX
has been upgraded from version 0.58 to 0.59.Pod::Perldoc
has been upgraded from version 3.15_02 to 3.15_03.Pod::Simple
has been upgraded from version 3.13 to 3.16.POSIX
has been upgraded from 1.19 to 1.24.
It now includes constants for POSIX signal constants.
re
has been upgraded from version 0.11 to 0.18.
New use re "/flags"
pragma
The regmust
function used to crash when called on a regular expression belonging to a pluggable engine. Now it croaks instead.
regmust
no longer leaks memory.
Safe
has been upgraded from version 2.25 to 2.29.
Coderefs returned by reval()
and rdo()
are now wrapped via wrap_code_refs
(5.12.1).
This fixes a possible infinite loop when looking for coderefs.
It adds several version::vxs::* routines to the default share.
SDBM_File
has been upgraded from version 1.06 to 1.09.SelfLoader
has been upgraded from 1.17 to 1.18.
It now works in taint mode [perl #72062].
sigtrap
has been upgraded from version 1.04 to 1.05.
It no longer tries to modify read-only arguments when generating a backtrace [perl #72340].
Socket
has been upgraded from version 1.87 to 1.94.
See "p5140-IPv6 support", above.
Storable
has been upgraded from version 2.22 to 2.27.
Includes performance improvement for overloaded classes.
This adds support for serialising code references that contain UTF-8 strings correctly. The Storable minor version number changed as a result, meaning that Storable users who set $Storable::accept_future_minor
to a FALSE
value will see errors (see "FORWARD COMPATIBILITY" in Storable for more details).
Freezing no longer gets confused if the Perl stack gets reallocated during freezing [perl #80074].
Sys::Hostname
has been upgraded from version 1.11 to 1.16.Term::ANSIColor
has been upgraded from version 2.02 to 3.00.Term::UI
has been upgraded from version 0.20 to 0.26.Test::Harness
has been upgraded from version 3.17 to 3.23.Test::Simple
has been upgraded from version 0.94 to 0.98.
Among many other things, subtests without a plan
or no_plan
now have an implicit done_testing()
added to them.
Thread::Semaphore
has been upgraded from version 2.09 to 2.12.
It provides two new methods that give more control over the decrementing of semaphores: down_nb
and down_force
.
Thread::Queue
has been upgraded from version 2.11 to 2.12.threads
has been upgraded from version 1.75 to 1.83.threads::shared
has been upgraded from version 1.32 to 1.36.Tie::Hash
has been upgraded from version 1.03 to 1.04.
Calling Tie::Hash->TIEHASH()
used to loop forever. Now it croak
s.
Tie::Hash::NamedCapture
has been upgraded from version 0.06 to 0.08.Tie::RefHash
has been upgraded from version 1.38 to 1.39.Time::HiRes
has been upgraded from version 1.9719 to 1.9721_01.Time::Local
has been upgraded from version 1.1901_01 to 1.2000.Time::Piece
has been upgraded from version 1.15_01 to 1.20_01.Unicode::Collate
has been upgraded from version 0.52_01 to 0.73.
Unicode::Collate has been updated to use Unicode 6.0.0.
Unicode::Collate::Locale now supports a plethora of new locales: ar, be, bg, de__phonebook, hu, hy, kk, mk, nso, om, tn, vi, hr, ig, ja, ko, ru, sq, se, sr, to, uk, zh, zh__big5han, zh__gb2312han, zh__pinyin and zh__stroke.
The following modules have been added:
Unicode::Collate::CJK::Big5
for zh__big5han
which makes tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering.
Unicode::Collate::CJK::GB2312
for zh__gb2312han
which makes tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering.
Unicode::Collate::CJK::JISX0208
which makes tailoring of 6355 kanji (CJK Unified Ideographs) in the JIS X 0208 order.
Unicode::Collate::CJK::Korean
which makes tailoring of CJK Unified Ideographs in the order of CLDR's Korean ordering.
Unicode::Collate::CJK::Pinyin
for zh__pinyin
which makes tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering.
Unicode::Collate::CJK::Stroke
for zh__stroke
which makes tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering.
This also sees the switch from using the pure-perl version of this module to the XS version.
Unicode::Normalize
has been upgraded from version 1.03 to 1.10.Unicode::UCD
has been upgraded from version 0.27 to 0.32.
A new function, Unicode::UCD::num()
, has been added. This function returns the numeric value of the string passed it or undef
if the string in its entirety has no "safe" numeric value. (For more detail, and for the definition of "safe", see "num" in Unicode::UCD.)
This upgrade also includes a number of bug fixes:
This now correctly returns "Unknown" instead of undef
for the script of a code point that hasn't been assigned another one.
This now correctly returns "No_Block" instead of undef
for the block of a code point that hasn't been assigned to another one.
version
has been upgraded from 0.82 to 0.88.
Due to a bug, now fixed, the is_strict
and is_lax
functions did not work when exported (5.12.1).
warnings
has been upgraded from version 1.09 to 1.12.
Calling use warnings
without arguments is now significantly more efficient.
warnings::register
have been upgraded from version 1.01 to 1.02.
It is now possible to register warning categories other than the names of packages using warnings::register
. See perllexwarn for more information.
XSLoader
has been upgraded from version 0.10 to 0.13.VMS::DCLsym
has been upgraded from version 1.03 to 1.05.
Two bugs have been fixed [perl #84086]:
The symbol table name was lost when tying a hash, due to a thinko in TIEHASH
. The result was that all tied hashes interacted with the local symbol table.
Unless a symbol table name had been explicitly specified in the call to the constructor, querying the special key ':LOCAL' failed to identify objects connected to the local symbol table.
Win32
has been upgraded from version 0.39 to 0.44.
This release has several new functions: Win32::GetSystemMetrics
, Win32::GetProductInfo
, Win32::GetOSDisplayName
.
The names returned by Win32::GetOSName
and Win32::GetOSDisplayName
have been corrected.
XS::Typemap
has been upgraded from version 0.03 to 0.05.The following modules have been removed from the core distribution, and if needed should be installed from CPAN instead.
Class::ISA
has been removed from the Perl core. Prior version was 0.36.Pod::Plainer
has been removed from the Perl core. Prior version was 1.02.Switch
has been removed from the Perl core. Prior version was 2.16.The removal of Shell
has been deferred until after 5.14, as the implementation of Shell
shipped with 5.12.0 did not correctly issue the warning that it was to be removed from core.
perlgpl has been updated to contain GPL version 1, as is included in the README distributed with perl (5.12.1).
The perldelta files for Perl 5.12.1 to 5.12.3 have been added from the maintenance branch: "p5121-NAME", "p5122-NAME", "p5123-NAME".
New style guide for POD documentation, split mostly from the NOTES section of the pod2man man page.
See "p5140-perlhack and perlrepository revamp", below.
The perlmodlib page that came with Perl 5.12.0 was missing a lot of modules, due to a bug in the script that generates the list. This has been fixed [perl #74332] (5.12.1).
perlebcdic contains a helpful table to use in tr/// to convert between EBCDIC and Latin1/ASCII. Unfortunately, the table was the inverse of the one it describes, though the code that used the table worked correctly for the specific example given.
The table has been changed to its inverse, and the sample code changed to correspond, as this is easier for the person trying to follow the instructions since deriving the old table is somewhat more complicated.
The table has also been changed to hex from octal, as that is more the norm these days, and the recipes in the pod altered to print out leading zeros to make all the values the same length.
perlunicode now contains an explanation of how to override, mangle and otherwise tweak the way perl handles upper-, lower- and other-case conversions on Unicode data, and how to provide scoped changes to alter one's own code's behaviour without stomping on anybody else.
This was already true but it's now Officially Stated For The Record (5.12.2).
\xHH
and \oOOO
escapesperlop has been updated with more detailed explanation of these two character escapes.
-0NNN
switchIn perlrun, the behavior of the -0NNN
switch for -0400
or higher has been clarified (5.12.2).
perlpolicy now contains the policy on what patches are acceptable for maintenance branches (5.12.1).
perlpolicy now contains the policy on compatibility and deprecation along with definitions of terms like "deprecation" (5.12.2).
The following existing diagnostics are now documented:
perlbook has been expanded to cover many more popular books.
SvTRUE
macroThe documentation for the SvTRUE
macro in perlapi was simply wrong in stating that get-magic is not processed. It has been corrected.
perlvar reorders the variables and groups them by topic. Each variable introduced after Perl 5.000 notes the first version in which it is available. perlvar also has a new section for deprecated variables to note when they were removed.
These are now documented in perldata.
use locale
and formatsperlform and perllocale have been corrected to state that use locale
affects formats.
overload's documentation has practically undergone a rewrite. It is now much more straightforward and clear.
The perlhack and perlrepository documents have been heavily edited and split up into several new documents.
The perlhack document is now much shorter, and focuses on the Perl 5 development process and submitting patches to Perl. The technical content has been moved to several new documents, perlsource, perlinterp, perlhacktut, and perlhacktips. This technical content has only been lightly edited.
The perlrepository document has been renamed to perlgit. This new document is just a how-to on using git with the Perl source code. Any other content that used to be in perlrepository has been moved to perlhack.
Examples in perlfaq4 have been updated to show the use of Time::Piece.
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.
This error occurs when a subroutine reference passed to an attribute handler is called, if the subroutine is a closure [perl #68560].
Perl detected tainted data when trying to compile a regular expression that contains a call to a user-defined character property function, i.e. \p{IsFoo}
or \p{InFoo}
. See "User-Defined Character Properties" in perlunicode and perlsec.
This new error is triggered if a destructor called on an object in a typeglob that is being freed creates a new typeglob entry containing an object with a destructor that creates a new entry containing an object....
This new fatal error is produced when parsing code supplied by an extension violates the parser's API in a detectable way.
This new error only occurs if a internal consistency check fails when a pipe is about to be closed.
The regular expression pattern has one of the mutually exclusive modifiers repeated.
The regular expression pattern has more than one of the mutually exclusive modifiers.
This error occurs when !~
is used with s///r
or y///r
.
Use of an unescaped "{" immediately following a \b
or \B
is now deprecated so as to reserve its use for Perl itself in a future release.
Performing an operation requiring Unicode semantics (such as case-folding) on a Unicode surrogate or a non-Unicode character now triggers this warning.
See "p5140-Use of qw(...) as parentheses", above, for details.
strict 'vars'
error has now been assigned the "misc" category, so that no warnings
will suppress it [perl #73712].warn
and die
now produce 'Wide character' warnings when fed a character outside the byte range if STDERR is a byte-sized handle.use constant
, since the value of the constant may not be known at the time the program is written [perl #77762].gethostbyaddr
, gethostbyname
and gethostent
functions were implemented on a given platform, they would all die with the message 'Unsupported socket function "gethostent" called', with analogous messages for getnet*
and getserv*
. This has been corrected.Many systems these days don't have a valid Internet domain name and perlbug@perl.org does not accept email with a return-path that does not resolve. So the user's address is now passed to sendmail so it's less likely to get stuck in a mail queue somewhere [perl #82996].
-d
and -v
options (5.12.2).Archive::Tar
.See also "p5140-Naming fixes in Policy_sh.SH may invalidate Policy.sh", above.
This means the 'incpath', 'libpth', 'ldflags', 'lddlflags' and 'ldflags_nolargefiles' values in Config.pm and Config_heavy.pl are now set correctly.
-Wwrite-strings
is now added to cflags by default.Encode
module can now (once again) be included in a static Perl build. The special-case handling for this situation got broken in Perl 5.11.0, and has now been repaired../Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N
where N is the desired size in bytes; it should probably be a multiple of your page size.
clang
has been fixed (5.12.2).File::Copy
tests on partitions it detects to be mounted as nosuid
(5.12.2).Perl now builds on AIX 4.2 (5.12.1).
The last vestiges of support for this platform have been excised from the Perl distribution. It was officially discontinued in version 5.12.0. It had not worked for years before that.
The last vestiges of support for this platform have been excised from the Perl distribution. It was officially discontinued in an earlier version.
d_u32align
configuration probe on ARM has been fixed (5.12.2).If a dll is updated on cygwin the old imagebase address is reused. This solves most rebase errors, especially when updating on core dll's. See http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README for more information.
setregid
, setreuid
, setrgid
and setruid
functions, so perl would pretend they did not exist.
These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and higher, as they have been fixed [perl #72990].
DCL symbol length was limited to 1K up until about seven years or so ago, but there was no particularly deep reason to prevent those older systems from configuring and building Perl (5.12.1).
-Uuseperlio
build on VMS.
We were checking a variable that doesn't exist in the non-default case of disabling perlio. Now we only look at it when it exists (5.12.1).
Formerly it only worked if you went through all the questions interactively and explicitly answered no (5.12.1).
PerlIOUnix_open
now honours the default permissions on VMS.
When perlio
became the default and unixio
became the default bottom layer, the most common path for creating files from Perl became PerlIOUnix_open
, which has always explicitly used 0666
as the permission mask.
To avoid this, 0777
is now passed as the permissions to open()
. In the VMS CRTL, 0777
has a special meaning over and above intersecting with the current umask; specifically, it allows Unix syscalls to preserve native default permissions (5.12.3).
Perl_rename()
due to a double allocation has been fixed (5.12.2).vms_fid_to_name()
(used by realpath()
and realname()
) has been fixed (5.12.2).See also "p5140-fork() emulation will not wait for signalled children" and "p5140-Perl source code is read in text mode on Windows", above.
_USE_32BIT_TIME_T
will now be set in $Config{ccflags}
. This improves portability when compiling XS extensions using new compilers, but for a perl compiled with old 32-bit compilers.$Config{gccversion}
is now set correctly when perl is built using the mingw64 compiler from http://mingw64.org [perl #73754].incpath
, libpth
, ldflags
, lddlflags
and ldflags_nolargefiles
values in Config.pm and Config_heavy.pl were not previously being set correctly because, with that compiler, the include and lib directories are not immediately below $(CCHOME)
(5.12.2).Cwd
fix.crypt()
, or to build with no crypt()
at all, has been removed. Perl supplies its own crypt()
implementation for Windows, and the political situation that required this part of the distribution to sometimes be omitted is long gone.Modules that create threads should now create CLONE_PARAMS
structures by calling the new function Perl_clone_params_new()
, and free them with Perl_clone_params_del()
. This will ensure compatibility with any future changes to the internals of the CLONE_PARAMS
structure layout, and that it is correctly allocated and initialised.
Several functions have been added for parsing statements or multiple statements:
parse_fullstmt
parses a complete Perl statement.parse_stmtseq
parses a sequence of statements, up to closing brace or EOF.parse_block
parses a block [perl #78222].parse_barestmt
parses a statement without a label.parse_label
parses a statement label, separate from statements.The parse_fullexpr()
, parse_listexpr()
, parse_termexpr()
, and parse_arithexpr()
functions have been added to the API. They perform recursive-descent parsing of expressions at various precedence levels. They are expected to be used by syntax plugins.
See perlapi for details.
A new C API for introspecting the hinthash %^H
at runtime has been added. See cop_hints_2hv
, cop_hints_fetchpvn
, cop_hints_fetchpvs
, cop_hints_fetchsv
, and hv_copy_hints_hv
in perlapi for details.
A new, experimental API has been added for accessing the internal structure that Perl uses for %^H
. See the functions beginning with cophh_
in perlapi.
caller()
The caller_cx
function has been added as an XSUB-writer's equivalent of caller()
. See perlapi for details.
XS code in an extension module can now annotate a subroutine (whether implemented in XS or in Perl) so that nominated XS code will be called at compile time (specifically as part of op checking) to change the op tree of that subroutine. The compile-time check function (supplied by the extension module) can implement argument processing that can't be expressed as a prototype, generate customised compile-time warnings, perform constant folding for a pure function, inline a subroutine consisting of sufficiently simple ops, replace the whole call with a custom op, and so on. This was previously all possible by hooking the entersub
op checker, but the new mechanism makes it easy to tie the hook to a specific subroutine. See "cv_set_call_checker" in perlapi.
To help in writing custom check hooks, several subtasks within standard entersub
op checking have been separated out and exposed in the API.
Custom ops can now be registered with the new custom_op_register
C function and the XOP
structure. This will make it easier to add new properties of custom ops in the future. Two new properties have been added already, xop_class
and xop_peep
.
xop_class
is one of the OA_*OP constants, and allows B and other introspection mechanisms to work with custom ops that aren't BASEOPs. xop_peep
is a pointer to a function that will be called for ops of this type from Perl_rpeep
.
See "Custom Operators" in perlguts and "Custom Operators" in perlapi for more detail.
The old PL_custom_op_names
/PL_custom_op_descs
interface is still supported but discouraged.
It is now possible for XS code to hook into Perl's lexical scope mechanism at compile time, using the new Perl_blockhook_register
function. See "Compile-time scope hooks" in perlguts.
In addition to PL_peepp
, for hooking into the toplevel peephole optimizer, a PL_rpeepp
is now available to hook into the optimizer recursing into side-chains of the optree.
The following functions/macros have been added to the API. The *_nomg
macros are equivalent to their non-_nomg variants, except that they ignore get-magic. Those ending in _flags
allow one to specify whether get-magic is processed.
sv_2bool_flags SvTRUE_nomg sv_2nv_flags SvNV_nomg sv_cmp_flags sv_cmp_locale_flags sv_eq_flags sv_collxfrm_flags
In some of these cases, the non-_flags functions have been replaced with wrappers around the new functions.
Many functions ending with pvn now have equivalent pv/pvs/sv versions.
List op-building functions have been added to the API. See op_append_elem, op_append_list, and op_prepend_elem in perlapi.
LINKLIST
The LINKLIST macro, part of op building that constructs the execution-order op chain, has been added to the API.
The save_freeop
, save_op
, save_pushi32ptr
and save_pushptrptr
functions have been added to the API.
A stash can now have a list of effective names in addition to its usual name. The first effective name can be accessed via the HvENAME
macro, which is now the recommended name to use in MRO linearisations (HvNAME
being a fallback if there is no HvENAME
).
These names are added and deleted via hv_ename_add
and hv_ename_delete
. These two functions are not part of the API.
The mg_findext()
and sv_unmagicext()
functions have been added to the API. They allow extension authors to find and remove magic attached to scalars based on both the magic type and the magic virtual table, similar to how sv_magicext()
attaches magic of a certain type and with a given virtual table to a scalar. This eliminates the need for extensions to walk the list of MAGIC
pointers of an SV
to find the magic that belongs to them.
find_rundefsv
This function returns the SV representing $_
, whether it's lexical or dynamic.
Perl_croak_no_modify
Perl_croak_no_modify()
is short-hand for Perl_croak("%s", PL_no_modify)
.
PERL_STATIC_INLINE
defineThe PERL_STATIC_INLINE
define has been added to provide the best-guess incantation to use for static inline functions, if the C compiler supports C99-style static inline. If it doesn't, it'll give a plain static
.
HAS_STATIC_INLINE
can be used to check if the compiler actually supports inline functions.
pv_escape
option for hexadecimal escapesA new option, PERL_PV_ESCAPE_NONASCII
, has been added to pv_escape
to dump all characters above ASCII in hexadecimal. Before, one could get all characters as hexadecimal or the Latin1 non-ASCII as octal.
lex_start
lex_start
has been added to the API, but is considered experimental.
op_scope()
and op_lvalue()
The op_scope()
and op_lvalue()
functions have been added to the API, but are considered experimental.
PERL_POLLUTE
has been removedThe option to define PERL_POLLUTE
to expose older 5.005 symbols for backwards compatibility has been removed. It's use was always discouraged, and MakeMaker contains a more specific escape hatch:
perl Makefile.PL POLLUTE=1
This can be used for modules that have not been upgraded to 5.6 naming conventions (and really should be completely obsolete by now).
When perl's API changes in incompatible ways (which usually happens between major releases), XS modules compiled for previous versions of perl will not work anymore. They will need to be recompiled against the new perl.
In order to ensure that modules are recompiled, and to prevent users from accidentally loading modules compiled for old perls into newer ones, the XS_APIVERSION_BOOTCHECK
macro has been added. That macro, which is called when loading every newly compiled extension, compares the API version of the running perl with the version a module has been compiled for and raises an exception if they don't match.
The first argument of the C API function Perl_fetch_cop_label
has changed from struct refcounted he *
to COP *
, to insulate the user from implementation details.
This API function was marked as "may change", and likely isn't in use outside the core. (Neither an unpacked CPAN, nor Google's codesearch, finds any other references to it.)
The new GvCV_set() and GvGP_set() macros are now provided to replace assignment to those two macros.
This allows a future commit to eliminate some backref magic between GV and CVs, which will require complete control over assignment to the gp_cv slot.
Under some circumstances, the CvGV()
field of a CV is now reference-counted. To ensure consistent behaviour, direct assignment to it, for example CvGV(cv) = gv
is now a compile-time error. A new macro, CvGV_set(cv,gv)
has been introduced to perform this operation safely. Note that modification of this field is not part of the public API, regardless of this new macro (and despite its being listed in this section).
The CvSTASH()
macro can now only be used as an rvalue. CvSTASH_set()
has been added to replace assignment to CvSTASH()
. This is to ensure that backreferences are handled properly. These macros are not part of the API.
newFOROP
and newWHILEOP
The way the parser handles labels has been cleaned up and refactored. As a result, the newFOROP()
constructor function no longer takes a parameter stating what label is to go in the state op.
The newWHILEOP()
and newFOROP()
functions no longer accept a line number as a parameter.
uvuni_to_utf8_flags
and utf8n_to_uvuni
Some of the flags parameters to uvuni_to_utf8_flags() and utf8n_to_uvuni() have changed. This is a result of Perl's now allowing internal storage and manipulation of code points that are problematic in some situations. Hence, the default actions for these functions has been complemented to allow these code points. The new flags are documented in perlapi. Code that requires the problematic code points to be rejected needs to change to use the new flags. Some flag names are retained for backward source compatibility, though they do nothing, as they are now the default. However the flags UNICODE_ALLOW_FDD0
, UNICODE_ALLOW_FFFF
, UNICODE_ILLEGAL
, and UNICODE_IS_ILLEGAL
have been removed, as they stem from a fundamentally broken model of how the Unicode non-character code points should be handled, which is now described in "Non-character code points" in perlunicode. See also the Unicode section under "p5140-Selected Bug Fixes".
Perl_ptr_table_clear
Perl_ptr_table_clear
is no longer part of Perl's public API. Calling it now generates a deprecation warning, and it will be removed in a future release.
sv_compile_2op
The sv_compile_2op()
API function is now deprecated. Searches suggest that nothing on CPAN is using it, so this should have zero impact.
It attempted to provide an API to compile code down to an optree, but failed to bind correctly to lexicals in the enclosing scope. It's not possible to fix this problem within the constraints of its parameters and return value.
find_rundefsvoffset
The find_rundefsvoffset
function has been deprecated. It appeared that its design was insufficient for reliably getting the lexical $_
at run-time.
Use the new find_rundefsv
function or the UNDERBAR
macro instead. They directly return the right SV representing $_
, whether it's lexical or dynamic.
CALL_FPTR
and CPERLscope
Those are left from an old implementation of MULTIPLICITY
using C++ objects, which was removed in Perl 5.8. Nowadays these macros do exactly nothing, so they shouldn't be used anymore.
For compatibility, they are still defined for external XS
code. Only extensions defining PERL_CORE
must be updated now.
The protocol for unwinding the C stack at the last stage of a die
has changed how it identifies the target stack frame. This now uses a separate variable PL_restartjmpenv
, where previously it relied on the blk_eval.cur_top_env
pointer in the eval
context frame that has nominally just been discarded. This change means that code running during various stages of Perl-level unwinding no longer needs to take care to avoid destroying the ghost frame.
The format of entries on the scope stack has been changed, resulting in a reduction of memory usage of about 10%. In particular, the memory used by the scope stack to record each active lexical variable has been halved.
Memory allocation for pointer tables has been changed. Previously Perl_ptr_table_store
allocated memory from the same arena system as SV
bodies and HE
s, with freed memory remaining bound to those arenas until interpreter exit. Now it allocates memory from arenas private to the specific pointer table, and that memory is returned to the system when Perl_ptr_table_free
is called. Additionally, allocation and release are both less CPU intensive.
UNDERBAR
The UNDERBAR
macro now calls find_rundefsv
. dUNDERBAR
is now a noop but should still be used to ensure past and future compatibility.
The ibcmp_* functions have been renamed and are now called foldEQ, foldEQ_locale and foldEQ_utf8. The old names are still available as macros.
chop
and chomp
implementations mergedThe opcode bodies for chop
and chomp
and for schop
and schomp
have been merged. The implementation functions Perl_do_chop()
and Perl_do_chomp()
, never part of the public API, have been merged and moved to a static function in pp.c. This shrinks the perl binary slightly, and should not affect any code outside the core (unless it is relying on the order of side effects when chomp
is passed a list of values).
$ perl -we 'open my $f, ">", \my $x; binmode $f, "scalar"' Use of uninitialized value in binmode at -e line 1.
open $fh, ">", \*glob
will no longer cause the glob to be corrupted when the filehandle is printed to. This would cause perl to crash whenever the glob's contents were accessed [perl #77492].use warnings 'unopened'
is necessary to trigger these warnings (as was always meant to be the case).When binmode FH, ":crlf"
pushes the :crlf
layer on top of the stack, it no longer enables crlf layers lower in the stack, to avoid unexpected results [perl #38456].
Opening a file in :raw
mode now does what it advertises to do (first open the file, then binmode it), instead of simply leaving off the top layer [perl #80764].
The three layers :pop
, :utf8
and :bytes
didn't allow stacking when opening a file. For example this:
open FH, '>:pop:perlio', 'some.file' or die $!;
Would throw an error: "Invalid argument". This has been fixed in this release [perl #82484].
"\N{LATIN SMALL LIGATURE FF}" =~ /f+/i
and similar expressions [perl #72998] (5.12.1).(?{...})
blocks no longer cause panic messages [perl #2353].(?:(o){2})?
no longer causes a "panic" error [perl #39233].(.*?)
when processing UTF-8 data has been fixed [perl #75680] (5.12.2).*COMMIT
sometimes to be ignored has been removed.[\8\9]
was effectively the same as [89\000]
, incorrectly matching a NULL character. It also gave incorrect warnings that the 8
and 9
were ignored. Now [\8\9]
is the same as [89]
and gives legitimate warnings that \8
and \9
are unrecognized escape sequences, passed-through.s///g
) that is in the same scope will no longer cause match variables to have the wrong values on subsequent iterations. This can happen when an array or hash subscript is interpolated in the right-hand side, as in s|(.)|@a{ print($1), /./ }|g
[perl #19078].\w
and \W
[perl #78464] [perl #18281] [perl #60156].qq{\x{30ab}} =~ /\xab|\xa9/
) would cause erroneous warnings [perl #70998]./\A(?:(?:)foo|bar|zot)\z/
[perl #78356].+
inside a lookahead would sometimes cause an incorrect match failure in a global match (e.g., /(?=(\S+))/g
) [perl #68564].{n,m}
quantifier to fail when it should match [perl #79152].use locale
now works much more sanely when the pattern or target string is encoded internally in UTF8. Previously, under these conditions the localeness was completely lost. Now, code points above 255 are treated as Unicode, but code points between 0 and 255 are treated using the current locale rules, regardless of whether the pattern or the string is encoded in UTF8. The few case-insensitive matches that cross the 255/256 boundary are not allowed. For example, 0xFF does not caselessly match the character at 0x178, LATIN CAPITAL LETTER Y WITH DIAERESIS, because 0xFF may not be LATIN SMALL LETTER Y in the current locale, and Perl has no way of knowing if that character even exists in the locale, much less what code point it is.(?|...)
regular expression construct no longer crashes if the final branch has more sets of capturing parentheses than any other branch. This was fixed in Perl 5.10.1 for the case of a single branch, but that fix did not take multiple branches into account [perl #84746].{...}
quantifiers in regular expressions that prevented the code block in /((\w+)(?{ print $2 })){2}/
from seeing the $2
sometimes [perl #84294].when(scalar){...}
no longer crashes, but produces a syntax error [perl #74114] (5.12.1).foo: eval $string
) no longer causes the label to be associated also with the first statement inside the eval [perl #74290] (5.12.1).no 5.13.2;
form of no
no longer tries to turn on features or pragmata (i.e., strict) [perl #70075] (5.12.2).BEGIN {require 5.12.0}
now behaves as documented, rather than behaving identically to use 5.12.0;
. Previously, require
in a BEGIN
block was erroneously executing the use feature ':5.12.0'
and use strict;
behaviour, which only use
was documented to provide [perl #69050].my $x = 3; $x = length(undef)
result in $x
set to 3
has been fixed. $x
will now be undef
[perl #85508] (5.12.2).%{...}
in rvalue context returns undef
if its argument is undefined. An optimisation introduced in perl 5.12.0 to make keys %{...}
faster when used as a boolean did not take this into account, causing keys %{+undef}
(and keys %$foo
when $foo
is undefined) to be an error, which it should only be in strict mode [perl #81750].$text =~ ( 1 ? /phoo/ : /bear/)
to turn into
$text =~ /phoo/
at compile time. Now it correctly matches against $_
[perl #20444].
eval
or by loading modules) from within a UNITCHECK
block no longer causes the interpreter to crash [perl #70614].$hash{\"foo"}
) used to be stringified, even if the hash was tied [perl #79178].if
statement followed by a constant or variable is no longer treated as a constant [perl #63540].state
can now be used with attributes. It used to mean the same thing as my
if attributes were present [perl #68658].@$a > 3
no longer cause $a
to be mentioned in the "Use of uninitialized value in numeric gt" warning when $a
is undefined (since it is not part of the >
expression, but the operand of the @
) [perl #72090].*d = *a; print $d[0]; undef *d; print $d[0];
-C
command line option, when used on the shebang line, can now be followed by other options [perl #72434].B
module was returning B::OP
s instead of B::LOGOP
s for entertry
[perl #80622]. This was due to a bug in the perl core, not in B
itself.Perl 5.10.0 introduced a new internal mechanism for caching MROs (method resolution orders, or lists of parent classes; aka "isa" caches) to make method lookup faster (so @ISA arrays would not have to be searched repeatedly). Unfortunately, this brought with it quite a few bugs. Almost all of these have been fixed now, along with a few MRO-related bugs that existed before 5.10.0:
undef *Foo::
)undef *Foo::ISA
)delete $Foo::{ISA}
)*Foo::ISA = \@Bar::ISA
or *Foo::ISA = *Bar::ISA
) [perl #77238]undef *Foo::ISA
would even stop a new @Foo::ISA
array from updating caches.
PL_isarev
, which is accessible to Perl via mro::get_isarev
is now updated properly when packages are deleted or removed from the @ISA
of other classes. This allows many packages to be created and deleted without causing a memory leak [perl #75176].In addition, various other bugs related to typeglobs and stashes have been fixed:
for $x (...) { *x = *y; }
sub { $_[0] = *foo }->($hash{key}); # $_[0] would have been the string "*main::foo"
It also happened when a glob was assigned to, or returned from, an element of a tied array or hash [perl #36051].
Use of uninitialized value $Foo::BAR
, crashes could occur if the glob holding the global variable in question had been detached from its original stash by, for example, delete $::{'Foo::'}
. This has been fixed by disabling the reporting of variable names in those cases.local *@; eval { die bless [] }; # puts an object in $@ sub DESTROY { local $@; # boom }
Now the glob entries are cleared before any destructors are called. This also means that destructors can vivify entries in the glob. So perl tries again and, if the entries are re-created too many times, dies with a 'panic: gp_free...' error message.
use feature 'unicode_strings'
(which is automatically selected by use 5.012
and above), the internal storage format of a string no longer affects the external semantics. [perl #58182].
There are two known exceptions:
The now-deprecated user-defined case changing functions require utf8-encoded strings to function. The CPAN module Unicode::Casing has been written to replace this feature, without its drawbacks, and the feature is scheduled to be removed in 5.16.
quotemeta
(and its in-line equivalent \Q
) also can give different results if a string is encoded in UTF-8 or not. See "The "Unicode Bug"" in perlunicode.
"/i"
regular expression matching of Unicode characters which match multiple characters now works much more as intended. For example
"\N{LATIN SMALL LIGATURE FFI}" =~ /ffi/ui
and
"ffi" =~ /\N{LATIN SMALL LIGATURE FFI}/ui
are both true. Previously, there were many bugs with this feature. What hasn't been fixed are the places where the pattern contains the multiple characters, but the characters are split up by other things, such as in
"\N{LATIN SMALL LIGATURE FFI}" =~ /(f)(f)i/ui
or
"\N{LATIN SMALL LIGATURE FFI}" =~ /ffi*/ui
or
"\N{LATIN SMALL LIGATURE FFI}" =~ /[a-f][f-m][g-z]/ui
None of these match.
Also, this matching doesn't fully conform to the current Unicode standard, which asks that the matching be made upon the NFD (Normalization Form Decomposed) of the text. However, as of this writing, March 2010, the Unicode standard is currently in flux about what they will recommend doing with regard to such cases. It may be that they will throw out the whole concept of multi-character matches. [perl #71736].
chop
now correctly handles characters above "\x{7fffffff}" [perl #73246].index
an offset beyond the end of the string when the string is encoded internally in UTF8 no longer causes panics [perl #75898].warn()
and die()
now respect utf8-encoded scalars [perl #45549].length(substr($uni_string,...))
to give wrong answers. With ${^UTF8CACHE}
set to -1, it would produce a 'panic' error message, too [perl #77692].$tied->()
did not always call FETCH [perl #8438].y///
and tr///
were calling FETCH too many times.=
operator used to ignore magic on its right-hand side if the scalar happened to hold a typeglob (if a typeglob was the last thing returned from or assigned to a tied scalar) [perl #77498].splice
now calls set-magic (so changes made by splice @ISA
are respected by method calls) [perl #78400].open $fh, '>' \$buffer
were not calling FETCH/STORE at all [perl #43789] (5.12.2).$t
returned 2 the first time and 3 the second, then $t/$t
would evaluate to 1.5. This has been fixed [perl #87708].eval
now detects taintedness of overloaded or tied arguments [perl #75716].eval
and regular expression matches against objects with string overloading no longer cause memory corruption or crashes [perl #77084].<>
overloading on tied arguments.
always respects overloading now if the expression is overloaded.
Due to the way that '<> as glob' was parsed differently from '<> as filehandle' from 5.6 onwards, something like <$foo[0]>
did not handle overloading, even if $foo[0]
was an overloaded object. This was contrary to the documentation for overload, and meant that <>
could not be used as a general overloaded iterator operator.
$AUTOLOAD
used to remain tainted forever if it ever became tainted. Now it is correctly untainted if an autoloaded method is called and the method name was not tainted.sprintf
now dies when passed a tainted scalar for the format. It did already die for arbitrary expressions, but not for simple scalars [perl #82250].lc
, uc
, lcfirst
and ucfirst
no longer return untainted strings when the argument is tainted. This has been broken since perl 5.8.9 [perl #87336].-d
is used on the shebang (#!
) line, the debugger now has access to the lines of the main program. In the past, this sometimes worked and sometimes did not, depending on what order things happened to be arranged in memory [perl #71806].@DB::args
has been fixed (5.12.2).#line
directives in string evals were not properly updating the arrays of lines of code (@{"_<..."}
) that the debugger (or any debugging or profiling module) uses. In threaded builds, they were not being updated at all. In non-threaded builds, the line number was ignored, so any change to the existing line number would cause the lines to be misnumbered [perl #79442].Now directory handles are cloned properly, on Windows and on systems that have a fchdir
function. On other systems, new threads simply do not inherit directory handles from their parent threads [perl #75154].
*,
, which holds the scalar variable $,
(output field separator), had the wrong reference count in child threads.close
function (and any implicit close, such as on thread exit) no longer blocks.require
no longer causes caller
to return the wrong file name for the scope that called require
and other scopes higher up that had the same file name [perl #68712].sort
with a ($$)-prototyped comparison routine used to cause the value of @_ to leak out of the sort. Taking a reference to @_ within the sorting routine could cause a crash [perl #72334].$1
) no longer persist between calls to a sort subroutine [perl #76026].foreach
over an array returned by an lvalue sub now works [perl #23790].$@
is now localised during calls to binmode
to prevent action at a distance [perl #78844].eval
no longer causes the variable to become writable [perl #19135].$!
is now implicitly localized.POSIX::sigprocmask
[perl #82040].++
and --
, used to cause leaks when being used on references. This has now been fixed.map
and grep
blocks no longer leak memory when processing large lists [perl #48004].use VERSION
and no VERSION
no longer leak memory [perl #78436] [perl #69050]..=
followed by <>
or readline
would leak memory if $/
contained characters beyond the octet range and the scalar assigned to happened to be encoded as UTF8 internally [perl #72246].eval "BEGIN{die}"
no longer leaks memory on non-threaded builds.@a = %h = (list with some duplicate keys);
This has now been fixed [perl #31865].
Perl now only frees the affected slots of the GV, rather than freeing the GV itself. This makes sure that there are no dangling refs or corrupted state during destruction.
use encoding
no longer causes perl to crash [perl #78674].->import
on a class lacking an import method could corrupt the stack, resulting in strange behaviour. For instance,
push @a, "foo", $b = bar->import;
would assign 'foo' to $b
[perl #63790].
recv
function could crash when called with the MSG_TRUNC flag [perl #75082].formline
no longer crashes when passed a tainted format picture. It also taints $^A
now if its arguments are tainted [perl #79138].unpack()
now handles scalar context correctly for %32H
and %32u
, fixing a potential crash. split()
would crash because the third item on the stack wasn't the regular expression it expected. unpack("%2H", ...)
would return both the unpacked result and the checksum on the stack, as would unpack("%2u", ...)
[perl #73814] (5.12.2).&
|
^
bitwise operators no longer coerce read-only arguments [perl #20661].sprintf
was ignoring locales when called with constant arguments [perl #78632].lex_stuff_pvn
function would sometimes cause a spurious syntax error on the last line of the file if it lacked a final semicolon [perl #74006] (5.12.1).eval_sv
and eval_pv
C functions now set $@
correctly when there is a syntax error and no G_KEEPERR
flag, and never set it if the G_KEEPERR
flag is present [perl #3719].SvPVbyte
function available to XS modules now calls magic before downgrading the SV, to avoid warnings about wide characters [perl #72398].sv_catsv_flags
no longer calls mg_get
on its second argument (the source string) if the flags passed to it do not include SV_GMAGIC. So it now matches the documentation.my_strftime
no longer leaks memory. This fixes a memory leak in POSIX::strftime
[perl #73520].fputc()
or fputs()
: on Windows could cause an error due to their arguments being swapped [perl #72704] (5.12.1).T_PRTOBJ
default typemap has been fixed (5.12.2).call_sv(code, G_EVAL)
is called from an XS destructor has been fixed (5.12.2).XXX Many of these have probably already been solved. There are also unresolved BBC articles linked to #77718 that are awaiting CPAN releases. These may need to be listed here. See also #84444. Enbugger may also need to be listed if there is no new release in time (see #82152). JJORE/overload-eval-0.08.tar.gz appears to be broken, too. See http://www.nntp.perl.org/group/perl.perl5.porters/2010/11/msg165773.html
List::Util::first
misbehaves in the presence of a lexical $_
(typically introduced by my $_
or implicitly by given
). The variable which gets set for each iteration is the package variable $_
, not the lexical $_
.
A similar issue may occur in other modules that provide functions which take a block as their first argument, like
foo { ... $_ ...} list
See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=67694
prove ./test.sh
instead of prove test.sh
These issues are being solved upstream, but didn't make it into this release. They're expected to be fixed in time for perl v5.13.4. (RT #59457)version
now prevents object methods from being called as class methods (d808b68)HTML::Parser
<= 3.66. A fixed HTML::Parser
is available as versions 3.67 on CPAN.Switch
. A patch has been sent upstream and will hopefully appear on CPAN soon.keys
, values
and each
work on arraysYou can now use the keys
, values
, each
builtin functions on arrays (previously you could only use them on hashes). See perlfunc for details. This is actually a change introduced in perl 5.12.0, but it was missed from that release's perldelta.
split
and @_
split
no longer modifies @_
when called in scalar or void context. In void context it now produces a "Useless use of split" warning. This was also a perl 5.12.0 changed that missed the perldelta.
Randy Kobes, creator of the kobesearch alternative to search.cpan.org and contributor/maintainer to several core Perl toolchain modules, passed away on September 18, 2010 after a battle with lung cancer. His contributions to the Perl community will be missed.
XXX The list of people to thank goes here.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl51311delta - what is new for perl v5.13.11
This document describes differences between the 5.13.10 release and the 5.13.11 release.
If you are upgrading from an earlier release such as 5.13.9, first read "p5139-NAME", which describes differences between 5.13.9 and 5.13.10.
Perl no longer allows a tainted regular expression to invoke a user-defined property via \p{...}
syntax. It simply dies instead [perl #82616].
local() on scalar variables will give them a new value, but keep all their magic intact. This has proven to be problematic for the default scalar variable $_, where perlsub recommends that any subroutine that assigns to $_ should localize it first. This would throw an exception if $_ is aliased to a read-only variable, and could have various unintentional side-effects in general.
Therefore, as an exception to the general rule, local($_) will not only assign a new value to $_, but also remove all existing magic from it as well.
An earlier Perl 5.13.x release changed warn($ref)
to leave the reference unchanged, allowing $SIG{__WARN__}
handlers to access the original reference. But this stopped warnings that were references from having the file and line number appended even when there was no $SIG{__WARN__}
handler in place.
Now warn
checks for the presence of such a handler and, if there is none, proceeds to stringify the reference and append the file and line number. This allows simple uses of warn
for debugging to continue to work as they did before.
On Windows parent processes would not terminate until all forked childred had terminated first. However, kill('KILL', ...)
is inherently unstable on pseudo-processes, and kill('TERM', ...)
might not get delivered if the child if blocked in a system call.
To avoid the deadlock and still provide a safe mechanism to terminate the hosting process, Perl will now no longer wait for children that have been sent a SIGTERM signal. It is up to the parent process to waitpid() for these children if child clean-up processing must be allowed to finish. However, it is also the responsibility of the parent then to avoid the deadlock by making sure the child process can't be blocked on I/O either.
See perlfork for more information about the fork() emulation on Windows.
Perl scripts used to be read in binary mode on Windows for the benefit of the ByteLoader module (which is no longer part of core Perl). This had the side effect of breaking various operations on the DATA filehandle, including seek()/tell(), and even simply reading from DATA after file handles have been flushed by a call to system(), backticks, fork() etc.
The default build options for Windows have been changed to read Perl source code on Windows in text mode now. Hopefully ByteLoader will be updated on CPAN to automatically handle this situation.
my @array = ...
and my %hash = ...
assignments caused a bug and was disabled in Perl 5.12.0.
Now we have found another way to speed up these assignments [perl #82110].
attributes
has been upgraded from version 0.13 to 0.14.base
has been upgraded from version 2.15 to 2.16.CPAN
has been upgraded from version 1.94_65 to 1.9600.CPANPLUS
has been upgraded from version 0.9101 to 0.9103CPANPLUS::Dist::Build
has been upgraded from version 0.52 to 0.54Cwd
has been downgraded from version 3.37 to 3.36.
An optimisation that recent core changes have rendered unnecessary has been reverted.
Devel::DProf
has been upgraded from version 20110225.01 to 20110228.00.Digest::SHA
has been upgraded from version 5.50 to 5.61
New SHA-512/224 and SHA-512/256 transforms ref. NIST Draft FIPS 180-4 (February 2011)
ExtUtils::Command
has been upgraded from version 1.16 to 1.17.File::Copy
has been downgraded from version 2.22 to 2.21.
An optimisation that recent core changes have rendered unnecessary has been reverted.
File::Glob
has been upgraded from version 1.11 to 1.12.GDBM_File
has been upgraded from version 1.13 to 1.14.Hash::Util
has been upgraded from version 0.10 to 0.11.Hash::Util::FieldHash
has been upgraded from version 1.08 to 1.09.HTTP::Tiny
has been upgraded from version 0.010 to 0.011.I18N::Langinfo
has been upgraded from version 0.07 to 0.08.IO
has been upgraded from version 1.25_03 to 1.25_04.JSON::PP
has been upgraded from version 2.27103 to 2.27105Locale::Codes
has been upgraded from version 3.15 to 3.16Math::BigInt
has been upgraded from version 1.992 to 1.994Math::BigInt::FastCalc
has been upgraded from version 0.24_02 to 0.28Module::Build
has been upgraded from version 0.37_05 to 0.3800Module::CoreList
has been upgraded from version 2.45 to 2.46.mro
has been upgraded from version 1.06 to 1.07.NDBM_File
has been upgraded from version 1.11 to 1.12.parent
has been upgraded from version 0.224 to 0.225Pod::Simple
has been upgraded from version 3.15 to 3.16Storable
has been upgraded from version 2.26 to 2.27.Sys::Hostname
has been upgraded from version 1.15 to 1.16.Test::Harness
has been upgraded from version 3.22 to 3.23Test::Simple
has been upgraded from version 0.97_01 to 0.98Tie::Hash::NamedCapture
has been upgraded from version 0.07 to 0.08.
Some of the Perl code has been converted to XS for efficency's sake.
Tie::RefHash
has been upgraded from version 1.38 to 1.39.Unicode::Collate
has been upgraded from version 0.72 to 0.73
DUCET has been updated for Unicode 6.0.0 as Collate/allkeys.txt and the default UCA_Version is 22.
Unicode::UCD
has been upgraded from version 0.31 to 0.32. This includes a number of bug fixes:
This now correctly returns "Unknown" instead of undef
for the script of a code point that hasn't been assigned another one.
This now correctly returns "No_Block" instead of undef
for the block of a code point that hasn't been assigned to another one.
XS::Typemap
has been upgraded from version 0.04 to 0.05.$@
and $!
after do FILE
. (RT #80626)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.
(F syntax) The regular expression pattern had one of the mutually exclusive modifiers repeated. Remove all but one of the occurrences.
(F syntax) The regular expression pattern had more than one of the mutually exclusive modifiers. Retain only the modifier that is supposed to be there.
(F) Perl detected tainted data when trying to compile a regular expression that contains a call to a user-defined character property function, i.e. \p{IsFoo}
or \p{InFoo}
. See "User-Defined Character Properties" in perlunicode and perlsec.
Many of the tests have been refactored to use testing libraries more consistently. In some cases test files were created or deleted:
split /\s/
and Unicode have been moved from t/op/split.t to the new t/op/split_unicode.t.length(undef)
in 5.13.4 introduced a regression that meant print length undef
did not warn when warnings were enabled. It now correctly warns [perl #85508].(?|...)
regular expression construct no longer crashes if the final branch has more sets of capturing parentheses than any other branch. This was fixed in Perl 5.10.1 for the case of a single branch, but that fix did not take multiple branches into account [perl #84746].*d = *a; print $d[0]; undef *d; print $d[0];
#line
directives in string evals were not properly updating the arrays of lines of code (@{"_<..."}
) that the debugger (or any debugging or profiling module) uses. In threaded builds, they were not being updated at all. In non-threaded builds, the line number was ignored, so any change to the existing line number would cause the lines to be misnumbered [perl #79442].$AUTOLOAD
used to remain tainted forever if it ever became tainted. Now it is correctly untainted if an autoloaded method is called and the method name was not tainted.{...}
quantifiers in regular expressions that prevented the code block in /((\w+)(?{ print $2 })){2}/
from seeing the $2
sometimes [perl #84294].sprintf
now dies when passed a tainted scalar for the format. It did already die for arbitrary expressions, but not for simple scalars [perl #82250].See also "p51311-fork() emulation will not wait for signalled children" for a better way to terminate child processes that avoids deadlocks altogether.
exists &Errno::EFOO
idiom continues to work as documented.
A change post-5.12 caused the documented idiom not to work if Errno was loaded after the exists
code had been compiled, as the compiler implicitly creates typeglobs in the Errno symbol table when it builds the optree for the exists code
.
Perl 5.13.11 represents approximately one month of development since Perl 5.13.10 and contains approximately 80,000 lines of changes across 549 files from 31 authors and committers:
Alastair Douglas, Arvan, Boris Ratner, brian d foy, Chris 'BinGOs' Williams, Craig A. Berry, David Golden, David Leadbeater, David Mitchell, Father Chrysostomos, Florian Ragwitz, Jan Dubois, Karl Williamson, Kevin Ryde, Leon Brocard, Leon Timmermans, Michael Stevens, Michael Witten, Moritz Lenz, Nicholas Clark, Paul Johnson, Peter John Acklam, Reini Urban, Robin Barker, Steve Hay, Sullivan Beck, Tony Cook, Vadim Konovalov, Yves Orton, Zefram and Ævar Arnfjörð Bjarmason
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl51310delta - what is new for perl v5.13.10
This document describes differences between the 5.13.9 release and the 5.13.10 release.
If you are upgrading from an earlier release such as 5.13.8, first read "p5139-NAME", which describes differences between 5.13.8 and 5.13.9.
Various releases of the 5.13.x series have added new regular expression modifiers, /a
, /d
, /l
, and /u
. They were only available in infix form (e.g., (?a:...)
) until this release; now they are usable in suffix form. This change was made too late to change all the affected documentation, so there are a number of places that erroneously say these must be used in infix form.
However, there is an ambiguity with the construct, s/foo/bar/le...
. Due to backward compatibility constraints, in Perl 5.14 only, it will be resolved as s/foo/bar/ le...
, that is, as meaning to take the result of the substitution, and see if it is stringwise less-than-or-equal-to what follows. In Perl 5.16 and later, it will instead be resolved as meaning to do the pattern match using the rules of the current locale, and evaluate the rhs as an expression when doing the substitution. In 5.14, if you want the latter interpretation, you can write "el" instead.
\p{Titlecase}
as a synonym for \p{Title}
This synonym is added for symmetry with the Unicode property names \p{Uppercase}
and \p{Lowercase}
.
/aa
Doubling the /a
regular expression modifier increases its effect, so that in case-insensitive matching, no ASCII character will match a non-ASCII character. For example, normally,
'k' =~ /\N{KELVIN SIGN}/i
will match; it won't under /aa
.
Three new warnings subcategories of surrogate
when UTF-16 surrogates are encountered; nonchar
when Unicode non-character code points are encountered; and non_unicode
when code points that are above the legal Unicode maximum of 0x10FFFF are encountered.
\p{}
properties are now immune from case-insensitive matchingFor most Unicode properties, it doesn't make sense to have them match differently under /i
case-insensitive matching than not. And doing so leads to unexpected results and potential security holes. For example
m/\p{ASCII_Hex_Digit}+/i
could previously match non-ASCII characters because of the Unicode matching rules. There were a number of bugs in this feature until an earlier release in the 5.13 series. Now this release reverts, and removes the feature completely except for the few properties where people have come to expect it, namely the ones where casing is an integral part of their functionality, such as m/\p{Uppercase}/i
and m/\p{Lowercase}/i
, both of which match the exact same code points, namely those matched by m/\p{Cased}/i
. Details are in "Unicode Properties" in perlrecharclass.
User-defined property handlers that need to match differently under /i
must change to read the new boolean parameter passed it which is non-zero if case-insensitive matching is in effect; 0 if not. See "User-Defined Character Properties" in perluniprops.
Now, a Unicode property match specified in the pattern will indicate that the pattern is meant for matching according to Unicode rules (e40e74f)
This allows a future commit to eliminate some backref magic between GV and CVs, which will require complete control over assignment to the gp_cv slot.
If you've been using GvGP() in lvalue context this change will break your code, you should use GvGP_set() instead. (c43ae56)
This function shouldn't be called from XS code. (4c2e113)
The fix for [perl #36347], which made sure that destructors were called on unreferenced objects, broke the tests for three CPAN modules, which apparently rely on the bug.
To provide more time for fixing them (as this is such a minor bug), we have reverted the fix until after perl 5.14.0.
This resolves [perl #82542] and other related tickets.
close
on shared pipesThe close
function no longer waits for the child process to exit if the underlying file descriptor is still in use by another thread, to avoid deadlocks. It returns true in such cases.
The following modules will be removed from the core distribution in a future release, and should be installed from CPAN instead. Distributions on CPAN which require these should add them to their prerequisites. The core versions of these modules warnings will issue a deprecation warning.
If you ship a packaged version of Perl, either alone or as part of a larger system, then you should carefully consider the repercussions of core module deprecations. You may want to consider shipping your default build of Perl with packages for some or all deprecated modules which install into vendor
or site
perl library directories. This will inhibit the deprecation warnings.
Alternatively, you may want to consider patching lib/deprecate.pm to provide deprecation warnings specific to your packaging system or distribution of Perl, consistent with how your packaging system or distribution manages a staged transition from a release where the installation of a single package provides the given functionality, to a later release where the system administrator needs to know to install multiple packages to get that same functionality.
You can silence these deprecation warnings by installing the modules in question from CPAN. To install the latest version of all of them, just install Task::Deprecations::5_14
.
We strongly recommend that you install and used Devel::NYTProf in preference, as it offers significantly improved profiling and reporting.
This feature is being deprecated due to its many issues, as documented in "User-Defined Case Mappings (for serious hackers only)" in perlunicode. It is planned to remove this feature in Perl 5.16. A CPAN module providing improved functionality is being prepared for release by the time 5.14 is.
CPAN::Meta
version 2.110440 has been added as a dual-life module. It provides a standard library to read, interpret and write CPAN distribution metadata files (e.g. META.json and META.yml) which describes a distribution, its contents, and the requirements for building it and installing it. The latest CPAN distribution metadata specification is included as CPAN::Meta::Spec
and notes on changes in the specification over time are given in CPAN::Meta::History
.Version::Requirements
version 0.101020 has been added as a dual-life module. It provides a standard library to model and manipulates module prerequisites and version constraints as defined in the CPAN::Meta::Spec.B
has been upgraded from version 1.27 to 1.28.Carp
has been upgraded from version 1.19 to 1.20.
[perl #82854] It now avoids using regular expressions that cause perl to load its Unicode tables, in order to avoid the 'BEGIN not safe after errors' error that will ensue if there has been a syntax error.
CGI
has been upgraded from version 3.51 to 3.52CPAN
has been upgraded from version 1.94_64 to 1.94_65
Includes support for META.json and MYMETA.json.
CPANPLUS
has been upgraded from version 0.9011 to 0.9101
Includes support for META.json and MYMETA.json and a change to using Digest::SHA for CPAN checksums.
deprecate
has been upgraded from version 0.01 to 0.02.diagnostics
has been upgraded from version 1.21 to 1.22.
It now renders pod links slightly better, and has been taught to find descriptions for messages that share their descriptions with other messages.
Devel::DProf
has been upgraded from version 20080331.00 to 20110217.00.
Merely loading Devel::DProf
now no longer triggers profiling to start. use Devel::DProf
and perl -d:DProf ...
still behave as before and start the profiler.
NOTE: Devel::DProf
is deprecated and will be removed from a future version of Perl. We strongly recommend that you install and use Devel::NYTProf instead, as it offers significantly improved profiling and reporting.
DynaLoader
has been upgraded from version 1.12 to 1.13.
[perl #84358] It no longer inherits from AutoLoader; hence it no longer produces weird error messages for unsuccessful method calls on classes that inherit from DynaLoader.
IO::Select
has been upgraded from version 1.17 to 1.18.
It now allows IO::Handle objects (and objects in derived classes) to be removed from an IO::Select set even if the underlying file descriptor is closed or invalid.
IPC::Cmd
has been upgraded from version 0.68 to 0.70HTTP::Tiny
has been upgraded from version 0.009 to 0.010Math::BigInt
has been upgraded from version 1.99_04 to 1.992.Module::Build
has been upgraded from version 0.3607 to 0.37_05.
A notable change is the deprecation of several modules. Module::Build::Version has been deprecated and Module::Build now relies directly upon version. Module::Build::ModuleInfo has been deprecated in favor of a standalone copy of it called Module::Metadata. Module::Build::YAML has been deprecated in favor of CPAN::Meta::YAML.
Module::Build now also generates META.json and MYMETA.json files in accordance with version 2 of the CPAN distribution metadata specification, CPAN::Meta::Spec. The older format META.yml and MYMETA.yml files are still generated, as well.
Module::Load::Conditional
has been upgraded from version 0.40 to 0.44Module::Metadata
has been upgraded from version 1.000003 to 1.000004.overload
has been upgraded from version 1.12 to 1.13.
The documentation has greatly improved. See "p51310-Documentation" below.
Parse::CPAN::Meta
has been upgraded from version 1.40 to 1.4401.
The latest Parse::CPAN::Meta can now read YAML or JSON files using CPAN::Meta::YAML and JSON::PP, which are now part of the Perl core.
re
has been upgraded from version 0.16 to 0.17.
It now supports the double-a flag: use re '/aa';
The regmust
function used to crash when called on a regular expression belonging to a pluggable engine. Now it has been disabled for those.
regmust
no longer leaks memory.
Term::UI
has been upgraded from version 0.24 to 0.26Unicode::Collate
has been upgraded from version 0.68 to 0.72
This also sees the switch from using the pure-perl version of this module to the XS version.`
VMS::DCLsym
has been upgraded from version 1.04 to 1.05.
Two bugs have been fixed [perl #84086]:
The symbol table name was lost when tying a hash, due to a thinko in TIEHASH
. The result was that all tied hashes interacted with the local symbol table.
Unless a symbol table name had been explicitly specified in the call to the constructor, querying the special key ':LOCAL' failed to identify objects connected to the local symbol table.
Unicode::UCD::num()
. This function will return the numeric value of the string passed it; undef
if the string in its entirety has no safe numeric value.
To be safe, a string must be a single character which has a numeric value, or consist entirely of characters that match \d, coming from the same Unicode block of digits. Thus, a mix of Bengali and Western digits would be considered unsafe, as well as a mix of half- and full-width digits, but strings consisting entirely of Devanagari digits or of "Mathematical Bold" digits would would be safe.
CPAN
has been upgraded from version 1.94_63 to 1.94_64.The perlhack document is now much shorter, and focuses on the Perl 5 development process and submitting patches to Perl. The technical content has been moved to several new documents, perlsource, perlinterp, perlhacktut, and perlhacktips. This technical content has only been lightly edited.
The perlrepository document has been renamed to perlgit. This new document is just a how-to on using git with the Perl source code. Any other content that used to be in perlrepository has been moved to perlhack.
map
function now contains more examples, see perldoc -f map (f947627)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.
Use of an unescaped "{" immediately following a \b
or \B
is now deprecated so as to reserve its use for Perl itself in a future release.
\p
implies Unicode matching rules, which are likely going to be different than the locale's.
This new error is triggered if a destructor called on an object in a typeglob that is being freed creates a new typeglob entry containing an object with a destructor that creates a new entry containing an object....
This new error only occurs if a internal consistency check fails when a pipe is about to be closed.
binmode $fh, ':scalar'
no longer warns (8250589)
Perl will now no longer produce this warning:
$ perl -we 'open my $f, ">", \my $x; binmode $f, "scalar"' Use of uninitialized value in binmode at -e line 1.
Many systems these days don't have a valid Internet domain name and perlbug@perl.org does not accept email with a return-path that does not resolve. Therefore pass the user's address to sendmail so it's less likely to get stuck in a mail queue somewhere. (019cfd2)
Some of the TODO tests in reg_eval_scope.t spuriously passed under non-threaded builds. Make the tests harder so they always fail.
Since one of the key bugs in (?{..}) is the trashing of the parent pad, add some extra lexical vars to the parent scope and check they're still there at the end.
It used to use the same paths for temporary files in all tests. This blew up randomly when the tests were run in parallel.
test-prep
build target now depends on pod/perltoc.pod to allow the t/porting/buildtoc.t test to run successfully.Skip a hanging test under MirBSD that was already being skipped under OpenBSD.
[perl #2460] described a case where electric fence reported an invalid read. This could be reproduced under valgrind with blead and -e'/x/', but only on a non-debugging build.
This was because it was checking for certain pairs of nodes (e.g. BOL + END) and wasn't allowing for EXACT nodes, which have the string at the next node position when using a naive NEXTOPER(first). In the non-debugging build, the nodes aren't initialised to zero, and a 1-char EXACT node isn't long enough to spill into the type field of the "next node".
Fix this by only using NEXTOPER(first) when we know the first node is kosher.
As it and Perl_yylex() both need FEATURE_IS_ENABLED, feature_is_enabled() is no longer static, and the two macro definitions move from toke.c to perl.h
Previously, one had to cut and paste the output of perl_keywords.pl into the middle of toke.c, and it was not clear that it was generated code.
The previous default size of a PerlIO buffer (4096 bytes) has been increased to the larger of 8192 bytes and your local BUFSIZ. Benchmarks show that doubling this decade-old default increases read and write performance in the neighborhood of 25% to 50% when using the default layers of perlio on top of unix. To choose a non-default size, such as to get back the old value or to obtain and even larger value, configure with:
./Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N
where N is the desired size in bytes; it should probably be a multiple of your page size.
\p{}
property match in a regular expression pattern will now force Unicode rules for the rest of the regular expressionWhen pushed on top of the stack, crlf will no longer enable crlf layers lower in the stack. This will prevent unexpected results.
Made a ':raw' open do what it advertises to do (first open the file, then binmode it), instead of leaving off the top layer.
Three of Perl's builtin PerlIO layers (:pop
, :utf8
and :bytes
) didn't allow stacking when opening a file. For example this:
open FH, '>:pop:perlio', 'some.file' or die $!;
Would throw an error: "Invalid argument". This has been fixed in this release.
%{...}
in rvalue context returns undef
if its argument is undefined. An optimisation introduced in perl 5.12.0 to make keys %{...}
faster when used as a boolean did not take this into account, causing keys %{+undef}
(and keys %$foo
when $foo
is undefined) to be an error, which it should only be in strict mode.length(substr($uni_string,...))
to give wrong answers. With ${^UTF8CACHE}
set to -1, it would produce a 'panic' error message, too.local *@; eval { die bless [] }; # puts an object in $@ sub DESTROY { local $@; # boom }
Now the glob entries are cleared before any destructors are called. This also means that destructors can vivify entries in the glob. So perl tries again and, if the entries are re-created too many times, dies with a 'panic: gp_free...' error message.
close
function (and any implicit close, such as on thread exit) no longer blocks.use locale
now works much more sanely when the pattern and/or target string are encoded in UTF-8. Previously, under these conditions the localeness was completely lost. Now, code points above 255 are treated as Unicode, but code points between 0 and 255 are treated using the current locale rules, regardless of whether the pattern or string are encoded in UTF-8. The few case insensitive matches that cross the 255/256 boundary are not allowed. For example, 0xFF does not caselessly match the character at 0x178, LATIN CAPITAL LETTER Y WITH DIAERESIS, because 0xFF may not be LATIN SMALL LETTER Y in the current locale, and Perl has no way of knowing if that character even exists in the locale, much less what code point it is.Perl 5.13.10 represents approximately one month of development since Perl 5.13.9 and contains approximately 63000 lines of changes across 609 files from 38 authors and committers:
Abigail, Alexander Hartmaier, brian d foy, Charles Bailey, Chip Salzenberg, Chris 'BinGOs' Williams, Craig A. Berry, Curtis Jewell, Dave Rolsky, David Golden, David Leadbeater, David Mitchell, David Wheeler, Father Chrysostomos, Florian Ragwitz, Franz Fasching, George Greer, H.Merijn Brand, Hongwen Qiu, Hugo van der Sanden, Jay Hannah, Jesse Vincent, Karl Williamson, Larwan Berke, Leon Timmermans, Michael Breen, Michael Stevens, Nicholas Clark, Noirin Shirley, Paul Evans, Peter John Acklam, Ricardo Signes, Robin Barker, Steven Schubiger, Tom Christiansen, Tony Cook, Zsbán Ambrus and Ævar Arnfjörð Bjarmason
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5139delta - what is new for perl v5.13.9
This document describes differences between the 5.13.8 release and the 5.13.9 release.
If you are upgrading from an earlier release such as 5.13.7, first read "p5138-NAME", which describes differences between 5.13.7 and 5.13.8.
/a
The /a
regular expression modifier restricts \s
to match precisely the five characters [ \f\n\r\t]
, \d
to match precisely the 10 characters [0-9]
, \w
to match precisely the 63 characters [A-Za-z0-9_]
, and the Posix ([[:posix:]]
) character classes to match only the appropriate ASCII characters. The complements, of course, match everything but; and \b
and \B
are correspondingly affected. Otherwise, /a
behaves like the /u
modifier, in that case-insensitive matching uses Unicode semantics; for example, "k" will match the Unicode \N{KELVIN SIGN}
under /i
matching, and code points in the Latin1 range, above ASCII will have Unicode semantics when it comes to case-insensitive matching. Like its cousins (/u
, /l
, and /d
), and in spite of the terminology, /a
in 5.14 will not actually be able to be used as a suffix at the end of a regular expression (this restriction is planned to be lifted in 5.16). It must occur either as an infix modifier, such as (?a:...)
or ((?a)...
, or it can be turned on within the lexical scope of use re '/a'
. Turning on /a
turns off the other "character set" modifiers.
With this release, Perl is adopting a model that any unsigned value can be treated as a code point and encoded internally (as utf8) without warnings -- not just the code points that are legal in Unicode. However, unless utf8 warnings have been explicitly lexically turned off, outputting or performing a Unicode-defined operation (such as upper-casing) on such a code point will generate a warning. Attempting to input these using strict rules (such as with the :encoding('UTF-8')
layer) will continue to fail. Prior to this release the handling was very inconsistent, and incorrect in places. Also, the Unicode non-characters, some of which previously were erroneously considered illegal in places by Perl, contrary to the Unicode standard, are now always legal internally. But inputting or outputting them will work the same as for the non-legal Unicode code points, as the Unicode standard says they are illegal for "open interchange".
Regular expression debugging output (turned on by use re 'debug';
) now uses hexadecimal when escaping non-ASCII characters, instead of octal.
In "User-Defined Character Properties" in perlunicode, it says you can create custom properties by defining subroutines whose names begin with "In" or "Is". However, perl doesn't actually enforce that naming restriction, so \p{foo::bar} will call foo::Bar() if it exists.
This commit finally enforces this convention. Note that this broke a number of existing tests for properties, since they didn't always use an Is/In prefix.
It used to be possible to prevent a destructor from being called during global destruction by artificially increasing the reference count of an object.
Now such objects will will be destroyed, as a result of a bug fix [perl #81230].
This has the potential to break some XS modules. (In fact, it break some. See "p5139-Known Problems", below.)
CPAN::Meta::YAML
0.003 has been added as a dual-life module. It supports a subset of YAML sufficient for reading and writing META.yml and MYMETA.yml files included with CPAN distributions or generated by the module installation toolchain. It should not be used for any other general YAML parsing or generation task.HTTP::Tiny
0.009 has been added as a dual-life module. It is a very small, simple HTTP/1.1 client designed for simple GET requests and file mirroring. It has has been added to enable CPAN.pm and CPANPLUS to "bootstrap" HTTP access to CPAN using pure Perl without relying on external binaries like curl or wget.JSON::PP
2.27103 has been added as a dual-life module, for the sake of reading META.json files in CPAN distributions.Module::Metadata
1.000003 has been added as a dual-life module. It gathers package and POD information from Perl module files. It is a standalone module based on Module::Build::ModuleInfo for use by other module installation toolchain components. Module::Build::ModuleInfo has been deprecated in favor of this module instead.Perl::OSType
1.002 has been added as a dual-life module. It maps Perl operating system names (e.g. 'dragonfly' or 'MSWin32') to more generic types with standardized names (e.g. "Unix" or "Windows"). It has been refactored out of Module::Build and ExtUtils::CBuilder and consolidates such mappings into a single location for easier maintenance.Archive::Extract
has been upgraded from version 0.46 to 0.48Archive::Tar
has been upgraded from version 1.74 to 1.76CGI
has been upgraded from version 3.50 to 3.51
Further improvements have been made to guard against newline injections in headers.
Compress::Raw::Bzip2
has been upgraded from version 2.031 to 2.033Compress::Raw::Zlib
has been upgraded from version 2.030 to 2.033CPAN
has been upgraded from version 1.94_62 to 1.94_63CPANPLUS
has been upgraded from version 0.9010 to 0.9011CPANPLUS::Dist::Build
has been upgraded from version 0.50 to 0.52DB_File
has been upgraded from version 1.820 to 1.821Encode
has been upgraded from version 2.40 to 2.42. Now, all 66 Unicode non-characters are treated the same way U+FFFF has always been treated; if it was disallowed, all 66 are disallowed; if it warned, all 66 warn.File::Fetch
has been upgraded from version 0.28 to 0.32IO::Compress
has been upgraded from version 2.030 to 2.033IPC::Cmd
has been upgraded from version 0.66 to 0.68Log::Message
has been upgraded from version 0.02 to 0.04Log::Message::Simple
has been upgraded from version 0.06 to 0.08Module::Load::Conditional
has been upgraded from version 0.38 to 0.40Object::Accessor
has been upgraded from version 0.36 to 0.38Params::Check
has been upgraded from version 0.26 to 0.28Pod::LaTeX
has been upgraded from version 0.58 to 0.59Socket
has been updated with new affordances for IPv6, including implementations of the Socket::getaddrinfo()
and Socket::getnameinfo()
functions, along with related constants.Term::UI
has been upgraded from version 0.20 to 0.24Thread::Queue
has been upgraded from version 2.11 to 2.12.Thread::Semaphore
has been upgraded from version 2.11 to 2.12.threads
has been upgraded from version 1.81_03 to 1.82threads::shared
has been upgraded from version 1.35 to 1.36Time::Local
has been upgraded from version 1.1901_01 to 1.2000.Unicode::Normalize
has been upgraded from version 1.07 to 1.10version
has been upgraded from 0.86 to 0.88.Win32
has been upgraded from version 0.41 to 0.44.perlhack
perlhack
was extensively reorganized.perlfunc
ord
returns 0 for an empty string.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.
gethostbyaddr
, gethostbyname
and gethostent
functions were implemented on a given platform, they would all die with the message 'Unsupported socket function "gethostent" called', with analogous messages for getnet*
and getserv*
. This has been corrected.perlbug
perlbug
did not previously generate a From: header, potentially resulting in dropped mail. Now it does include that header.buildtoc
lib/File/DosGlob.t
has been modernized and now uses Test::More
.t/porting/filenames.t
, makes sure that filenames and paths are reasonably portable.t/porting/diag.t
is now several orders of magnitude faster.t/porting/buildtoc.t
now tests that the documentation TOC file is current and well-formed.t/base/while.t
now tests the basics of a while loop with minimal dependencies.t/cmd/while.t
now uses test.pl for better maintainability.t/op/split.t
now tests calls to split
without any pattern specified.The last vestiges of support for this platform have been excised from the Perl distribution. It was officially discontinued in version 5.12.0. It had not worked for years before that.
The last vestiges of support for this platform have been excised from the Perl distribution. It was officially discontinued in an earlier version.
If a dll is updated on cygwin reuse the old imagebase address. This solves most rebase errors, esp when updating on core dll's. See http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README for more information.
DTrace is now supported on Solaris. There used to be build failures, but these have been fixed [perl #73630].
chop
and chomp
and for schop
and schomp
have been merged. The implementation functions Perl_do_chop()
and Perl_do_chomp()
, never part of the public API, have been merged and moved to a static function in pp.c. This shrinks the perl binary slightly, and should not affect any code outside the core (unless it is relying on the order of side effects when chomp
is passed a list of values).UNICODE_ALLOW_FDD0
, UNICODE_ALLOW_FFFF
, UNICODE_ILLEGAL
, and UNICODE_IS_ILLEGAL
have been removed, as they stem from a fundamentally broken model of how the Unicode non-character code points should be handled, which is now described in "Non-character code points" in perlunicode. See also "p5139-Selected Bug Fixes".pmop.op_pmflags
and regexp.extflags
structures have been removed. These are: Rxf_Pmf_LOCALE
, Rxf_Pmf_UNICODE
, and PMf_LOCALE
. Instead there are encodes and three static in-line functions for accessing the information: get_regex_charset()
, set_regex_charset()
, and get_regex_charset_name()
, which are defined in the places where the original flags were.pv_escape
to dump all characters above ASCII in hexadecimal. Before, one could get all characters as hexadecimal or the Latin1 non-ASCII as octalEliminate the #define pp_foo Perl_pp_foo(pTHX) macros, and update the 13 locations that relied on them.
regen/opcode.pl now generates prototypes for the PP functions directly, into pp_proto.h. It no longer writes pp.sym, and regen/embed.pl no longer reads this, removing the only ordering dependency in the regen scripts. opcode.pl is now responsible for prototypes for pp_* functions. (embed.pl remains responsible for ck_* functions, reading from regen/opcodes)
use warnings 'unopened'
is necessary to trigger these warnings (as was always meant to be the case.
always respects overloading now if the expression is overloaded.
Due to the way that '<> as glob' was parsed differently from '<> as filehandle' from 5.6 onwards, something like <$foo[0]>
did not handle overloading, even if $foo[0]
was an overloaded object. This was contrary to the documentation for overload, and meant that <>
could not be used as a general overloaded iterator operator.
bless \$a[0]
) or if a closure referenced a blessed variable (bless \my @a; sub foo { @a }
).
Now there is an extra pass during global destruction to fire destructors on any objects that might be left after the usual passes that check for objects referenced by scalars [perl #36347].
\w
and \W
, depending on the UTF-8-ness of the regular expression pattern and target string. Fixing this did expose some bugs in various modules and tests that relied on the previous behavior of [[:alpha:]]
not ever matching U+00FF, "LATIN SMALL LETTER Y WITH DIAERESIS", even when it should, in Unicode mode; now it does match when appropriate. [perl #60156].Tk
version 804.029. This is still being investigated.Perl 5.13.9 represents approximately one month of development since Perl 5.13.8 and contains approximately 48000 lines of changes across 809 files from 35 authors and committers:
Abigail, Ævar Arnfjörð Bjarmason, brian d foy, Chris 'BinGOs' Williams, Craig A. Berry, David Golden, David Leadbeater, David Mitchell, Father Chrysostomos, Florian Ragwitz, Gerard Goossen, H.Merijn Brand, Jan Dubois, Jerry D. Hedden, Jesse Vincent, John Peacock, Karl Williamson, Leon Timmermans, Michael Parker, Michael Stevens, Nicholas Clark, Nuno Carvalho, Paul "LeoNerd" Evans, Peter J. Acklam, Peter Martini, Rainer Tammer, Reini Urban, Renee Baecker, Ricardo Signes, Robin Barker, Tony Cook, Vadim Konovalov, Vincent Pit, Zefram, and Zsbán Ambrus.
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5138delta - what is new for perl v5.13.8
This document describes differences between the 5.13.7 release and the 5.13.8 release.
If you are upgrading from an earlier release such as 5.13.6, first read "p5137-NAME", which describes differences between 5.13.6 and 5.13.7.
-d:-foo
calls Devel::foo::unimport
The syntax -d:foo
was extended in 5.6.1 to make -d:foo=bar
equivalent to -MDevel::foo=bar
, which expands internally to use Devel::foo 'bar';
. perl now allows prefixing the module name with -
, with the same semantics as -M
, i.e.
-d:-foo
Equivalent to -M-Devel::foo
, expands to no Devel::foo;
, calls Devel::foo->unimport()
if the method exists.
-d:-foo=bar
Equivalent to -M-Devel::foo=bar
, expands to no Devel::foo 'bar';
, calls Devel::foo->unimport('bar')
if the method exists.
This is particularly useful to suppresses the default actions of a Devel::*
module's import
method whilst still loading it for debugging.
When a method call on a filehandle would die because the method cannot be resolved, and IO::File has not been loaded, Perl now loads IO::File via require
and attempts method resolution again:
open my $fh, ">", $file; $fh->binmode(":raw"); # loads IO::File and succeeds
This also works for globs like STDOUT, STDERR and STDIN:
STDOUT->autoflush(1);
Because this on-demand load only happens if method resolution fails, the legacy approach of manually loading an IO::File parent class for partial method support still works as expected:
use IO::Handle; open my $fh, ">", $file; $fh->autoflush(1); # IO::File not loaded
use feature 'unicode_strings'
This release provides full functionality for use feature 'unicode_strings'
. Under its scope, all string operations executed and regular expressions compiled (even if executed outside its scope) have Unicode semantics. See feature.
This feature avoids most forms of the "Unicode Bug" (See "The "Unicode Bug"" in perlunicode for details.) If there is a possibility that your code will process Unicode strings, you are strongly encouraged to use this subpragma to avoid nasty surprises.
The availability of this should strongly affect the whole tone of various documents, such as perlunicode and perluniintro, but this work has not been done yet.
When an exception is thrown in an eval BLOCK
, $@
is now set before unwinding, as well as being set after unwinding as the eval block exits. This early setting supports code that has historically treated $@
during unwinding as an indicator of whether the unwinding was due to an exception. These modules had been broken by 5.13.1's change from setting $@
early to setting it late. This double setting arrangement is a stopgap until the reason for unwinding can be made properly introspectable. $@
has never been a reliable indicator of the reason for unwinding.
Perl's printf and sprintf operators, and Perl's internal printf replacement function, now understand the C90 size modifiers "hh" (char
), "z" (size_t
), and "t" (ptrdiff_t
). Also, when compiled with a C99 compiler, Perl now understands the size modifier "j" (intmax_t
).
So, for example, on any modern machine, sprintf('%hhd', 257)
returns '1'.
The DTrace probes now include an additional argument (arg3
) which contains the package the subroutine being entered or left was compiled in.
For example using the following DTrace script:
perl$target:::sub-entry { printf("%s::%s\n", copyinstr(arg0), copyinstr(arg3)); }
and then running:
perl -e'sub test { }; test'
DTrace will print:
main::test
Multiple statement labels can now appear before a single statement.
:=
is now a syntax errorPreviously my $pi := 4;
was exactly equivalent to my $pi : = 4;
, with the :
being treated as the start of an attribute list, ending before the =
. The use of :=
to mean : =
was deprecated in 5.12.0, and is now a syntax error. This will allow the future use of :=
as a new token.
We find no Perl 5 code on CPAN using this construction, outside the core's tests for it, so we believe that this change will have very little impact on real-world codebases.
If it is absolutely necessary to have empty attribute lists (for example, because of a code generator) then avoid the error by adding a space before the =
.
Code blocks in regular expressions ((?{...})
and (??{...})
) used not to inherit any pragmata (strict, warnings, etc.) if the regular expression was compiled at run time as happens in cases like these two:
use re 'eval'; $foo =~ $bar; # when $bar contains (?{...}) $foo =~ /$bar(?{ $finished = 1 })/;
This was a bug, which has now been fixed. But it has the potential to break any code that was relying on this bug.
?PATTERN?
is deprecated?PATTERN?
(without the initial m) has been deprecated and now produces a warning. This is to allow future use of ?
in new operators. The match-once functionality is still available in the form of m?PATTERN?
.
sv_compile_2op()
is now deprecatedThe sv_compile_2op()
API function is now deprecated. Searches suggest that nothing on CPAN is using it, so this should have zero impact.
It attempted to provide an API to compile code down to an optree, but failed to bind correctly to lexicals in the enclosing scope. It's not possible to fix this problem within the constraints of its parameters and return value.
Calling a tie function (tie
, tied
, untie
) with a scalar argument acts on a file handle if the scalar happens to hold a typeglob.
This is a long-standing bug that will be removed in Perl 5.16, as there is currently no way to tie the scalar itself when it holds a typeglob, and no way to untie a scalar that has had a typeglob assigned to it.
This bug was fixed in 5.13.7 but, because of the breakage it caused, the fix has been reverted. Now there is a deprecation warning whenever a tie function is used on a handle without an explicit *
.
Archive::Tar
has been upgraded from version 1.72 to 1.74.
Skip extracting pax extended headers.
autodie
has been upgraded from version 2.10 to 2.1001.
Test fix in blead for VMS.
B
has been upgraded from version 1.26 to 1.27.
Avoid compiler warnings.
B::Concise
has been upgraded from version 0.81 to 0.82.
It no longer produces mangled output with the -tree
option [perl #80632].
B::Deparse
has been upgraded from version 1.01 to 1.02.
Test improvements.
Cwd
has been upgraded from version 3.34 to 3.35.
Avoid compiler warnings.
Data::Dumper
has been upgraded from version 2.130_01 to 2.130_02.
Avoid compiler warnings.
Devel::Peek
has been upgraded from version 1.05 to 1.06.
Avoid compiler warnings.
Test improvements.
Devel::SelfStubber
has been upgraded from version 1.03 to 1.05.
Whitespace changes.
Digest::SHA
has been upgraded from 5.48 to 5.50.
shasum
now more closely mimics sha1sum
/md5sum
.
Addfile
accepts all POSIX filenames.
Dumpvalue
has been upgraded from version 1.14 to 1.15.
Test improvements.
DynaLoader
has been upgraded from version 1.11 to 1.12.
Remove obsolete RCS keywords.
Env
has been upgraded from version 1.01 to 1.02.
Test improvements.
ExtUtils::CBuilder
has been upgraded from 0.2703 to 0.280201.
Handle C and C++ compilers separately.
Preserves exit status on VMS.
Test improvements.
ExtUtils::Constant::Utils
has been upgraded from 0.02 to 0.03.
Refactoring and fixing of backcompat code, preparing for resynchronisation with CPAN.
ExtUtils::Embed
has been upgraded from 1.29 to 1.30.
Remove obsolete RCS keywords.
ExtUtils::ParseXS
has been upgraded from 2.2207 to 2.2208.
Avoid compiler warnings.
Fcntl
has been upgraded from 1.10 to 1.11.
Avoid compiler warnings.
Test improvements.
feature
has been upgraded from 1.18 to 1.19.
Documentation and test updates for the unicode_strings
feature. See "p5138-Full functionality for use feature 'unicode_strings'
".
File::CheckTree
has been upgraded from 4.4 to 4.41.
Whitespace changes.
File::Glob
has been upgraded from 1.10 to 1.11.
Avoid compiler warnings.
Test improvements.
GDBM_File
has been upgraded from 1.12 to 1.13.
Test improvements.
Remove obsolete RCS keywords.
Hash::Util::FieldHash
has been upgraded from 1.06 to 1.07.
Avoid compiler warnings.
I18N::Collate
has been upgraded from 1.01 to 1.02.
Whitespace changes.
Test improvements.
if
has been upgraded from 0.06 to 0.0601.
Test improvements.
IO
has been upgraded from 1.25_02 to 1.25_03.
Avoid compiler warnings.
IPC::Cmd
has been upgraded from 0.64 to 0.66.
Resolves an issue with splitting Win32 command lines.
Documentation enhancements.
IPC::Open3
has been upgraded from 1.07 to 1.08.
Remove obsolete RCS keywords.
Test improvements.
Locale::Codes
has been upgraded from version 3.14 to 3.15.
Adds some codes.
Math::BigInt
has been upgraded from 1.99_01 to 1.99_02.
Documentation and comment spelling fixes.
Memoize
has been upgraded from version 1.01_03 to 1.02.
Remove obsolete RCS keywords.
Whitespace changes.
MIME::Base64
has been upgraded from 3.10 to 3.13.
Now provides encode_base64url
and decode_base64url
functions to process the base64 scheme for "URL applications".
mro
has been upgraded from version 1.05 to 1.06.
next::method
et al. now take into account that every class inherits from UNIVERSAL [perl #68654].
NDBM_File
has been upgraded from 1.10 to 1.11.
Remove obsolete RCS keywords.
Test improvements.
Net::Ping
has been upgraded from 2.36 to 2.37.
Remove obsolete RCS keywords.
ODBM_File
has been upgraded from 1.09 to 1.10.
Remove obsolete RCS keywords.
Test improvements.
Opcode
has been upgraded from 1.17 to 1.18.
Avoid compiler warnings.
Test improvements.
overload
has been upgraded from 1.11 to 1.12.
Avoid a taint problem in use of sprintf.
Test asymmetric fallback cases [perl #71286].
PerlIO::encoding
has been upgraded from 0.13 to 0.14.
Avoid compiler warnings.
Remove obsolete RCS keywords.
Test improvements.
PerlIO::scalar
has been upgraded from 0.10 to 0.11.
A read
after a seek
beyond the end of the string no longer thinks it has data to read [perl #78716].
Avoid compiler warnings.
PerlIO::via
has been upgraded from 0.10 to 0.11.
Avoid compiler warnings.
POSIX
has been upgraded from 1.22 to 1.23.
Avoid compiler warnings.
re
has been upgraded from 0.14 to 0.15.
Enforce that /d
, /u
, and /l
are mutually exclusive.
SDBM_File
has been upgraded from 1.08 to 1.09.
Avoid compiler warnings.
Remove obsolete RCS keywords.
Test improvements.
Socket
has been upgraded from 1.91 to 1.92.
It has several new functions for handling IPv6 addresses.
Storable
has been upgraded from 2.24 to 2.25.
This adds support for serialising code references that contain UTF-8 strings correctly. The Storable minor version number changed as a result, meaning that Storable users who set $Storable::accept_future_minor
to a FALSE
value will see errors (see "FORWARD COMPATIBILITY" in Storable for more details).
Freezing no longer gets confused if the Perl stack gets reallocated during freezing [perl #80074].
Avoid compiler warnings.
threads
has been upgraded from 1.81_02 to 1.81_03.
Avoid compiler warnings.
threads::shared
has been upgraded from 1.34 to 1.35.
Avoid compiler warnings.
Time::HiRes
has been upgraded from 1.9721 to 1.9721_01.
Build fix in blead for VMS.
Unicode::Collate
has been upgraded from 0.67 to 0.6801.
Documentation clarification.
Test improvements.
Unicode::Normalize
has been upgraded from 1.07 to 1.08.
Avoid compiler warnings.
Unicode::UCD
has been upgraded from 0.29 to 0.30.
Add info about named sequence alternatives.
Don't use CompositionExclusions.txt
.
version
has been upgraded from 0.82 to 0.86.
Modify export logic for is_strict
and is_lax
.
Various backcompat fixes.
Win32
has been upgraded from 0.39 to 0.41.
Add several functions.
Corrections to names returned by Win32::GetOSName
and Win32::GetOSDisplayName
.
XS::APItest
has been upgraded from 0.26 to 0.27.
Test new API functions.
Avoid compiler warnings.
These modules were formerly distributed only in the Perl core distribution, and are now dual-lifed (meaning they are now also available separately on CPAN):
autouse
Devel::SelfStubber
Dumpvalue
Env
File::CheckTree
I18N::Collate
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.
use constant
, since the value of the constant may not be known at the time the program is written [perl #77762].Encode
module can now (once again) be included in a static Perl build. The special-case handling for this situation got broken in Perl 5.11.0, and has now been repaired.Fcntl
, File::Glob
, GDBM_File
, IPC::Open3
, NDBM_File
, ODBM_File
, Opcode
, PerlIO::encoding
, SDBM_File
, and Storable
now use the Test::More framework.The NetBSD hints file has been changed to make the system's malloc the default.
The option to use an externally-supplied crypt()
, or to build with no crypt()
at all, has been removed. Perl supplies its own crypt()
implementation for Windows, and the political situation that required this part of the distribution to sometimes be omitted is long gone.
mg_findext()
and sv_unmagicext()
functions have been added to the API. They allow extension authors to find and remove magic attached to scalars based on both the magic type and the magic virtual table, similar to how sv_magicext()
attaches magic of a certain type and with a given virtual table to a scalar. This eliminates the need for extensions to walk the list of MAGIC
pointers of an SV
to find the magic that belongs to them.parse_fullexpr()
, parse_listexpr()
, parse_termexpr()
, and parse_arithexpr()
functions have been added to the API. They perform recursive-descent parsing of expressions at various precedence levels. They are expected to be used by syntax plugins.BEGIN {require 5.12.0}
now behaves as documented, rather than behaving identically to use 5.12.0;
. Previously, require
in a BEGIN
block was erroneously executing the use feature ':5.12.0'
and use strict; use warnings;
behaviour, which only use
was documented to provide [perl #69050].use 5.42
[perl #69050], use 6
and no 5
no longer leak memory.eval "BEGIN{die}"
no longer leaks memory on non-threaded builds.$hash{\"foo"}
) used to be stringified, even if the hash was tied [perl #79178].if
statement followed by a constant or variable is no longer treated as a constant [perl #63540].{n,m}
quantifier to fail when it should match [perl #79152].use feature 'unicode_strings'
, the internal storage format of a string no longer affects the external semantics. There are two known exceptions. User-defined case changing functions, which are planned to be deprecated in 5.14, require utf8-encoded strings to function; and the character LATIN SMALL LETTER SHARP S
in regular expression case-insensitive matching has a somewhat different set of bugs depending on the internal storage format. Case-insensitive matching of all characters that have multi-character matches, as this one does, is problematical in Perl. [perl #58182].eval
no longer causes the variable to become writable [perl #19135].state
can now be used with attributes. It used to mean the same thing as my
if attributes were present [perl #68658].@$a > 3
no longer cause $a
to be mentioned in the "Use of uninitialized value in numeric gt" warning when $a
is undefined (since it is not part of the >
expression, but the operand of the @
) [perl #72090].require
no longer causes caller
to return the wrong file name for the scope that called require
and other scopes higher up that had the same file name [perl #68712].$1
) no longer persist between calls to a sort subroutine [perl #76026].B
module was returning B::OP
s instead of B::LOGOP
s for entertry
[perl #80622]. This was due to a bug in the perl core, not in B
itself.Perl 5.13.8 represents approximately one month of development since Perl 5.13.7 and contains 38715 lines of changes across 546 files from 38 authors and committers.
Thank you to the following for contributing to this release:
Abhijit Menon-Sen, Abigail, Andreas König, Ben Morrow, Brad Gilbert, brian d foy, Chip Salzenberg, Chris 'BinGOs' Williams, Craig A. Berry, David Golden, David Leadbeater, David Mitchell, Father Chrysostomos, Florian Ragwitz, Goro Fuji, H.Merijn Brand, Jan Dubois, Jerry D. Hedden, Jesse Vincent, John Peacock, Karl Williamson, Lukas Mai, Marvin Humphrey, Max Maischein, Michael Breen, Michael Fig, Nicholas Clark, Nick Cleaton, Paul Evans, Peter J. Holzer, Peter John Acklam, Rafael Garcia-Suarez, Reini Urban, Renee Baecker, Ricardo Signes, Tony Cook, Yves Orton, Zefram
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5137delta - what is new for perl v5.13.7
This document describes differences between the 5.13.6 release and the 5.13.7 release.
If you are upgrading from an earlier release such as 5.13.5, first read "p5136-NAME", which describes differences between 5.13.5 and 5.13.6.
The +
prototype is a special alternative to $
that will act like \[@%]
when given a literal array or hash variable, but will otherwise force scalar context on the argument. This is useful for functions which should accept either a literal array or an array reference as the argument:
sub smartpush (+@) { my $aref = shift; die "Not an array or arrayref" unless ref $aref eq 'ARRAY'; push @$aref, @_; }
When using the +
prototype, your function must check that the argument is of an acceptable type.
use re '/flags';
The re
pragma now has the ability to turn on regular expression flags till the end of the lexical scope:
use re '/x'; "foo" =~ / (.+) /; # /x implied
See "'/flags' mode" in re for details.
Statement labels can now occur before any type of statement or declaration, such as package
.
use feature "unicode_strings"
now applies to more regex matchingAnother chunk of the "The "Unicode Bug"" in perlunicode is fixed in this release. Now, regular expressions compiled within the scope of the "unicode_strings" feature (or under the "u" regex modifier (specifiable currently only with infix notation (?u:...)
or via use re '/u'
) will match the same whether or not the target string is encoded in utf8, with regard to [[:posix:]]
character classes
Work is underway to add the case sensitive matching to the control of this feature, but was not complete in time for this dot release.
All built-in functions that operate directly on array or hash containers now also accept hard references to arrays or hashes:
|----------------------------+---------------------------| | Traditional syntax | Terse syntax | |----------------------------+---------------------------| | push @$arrayref, @stuff | push $arrayref, @stuff | | unshift @$arrayref, @stuff | unshift $arrayref, @stuff | | pop @$arrayref | pop $arrayref | | shift @$arrayref | shift $arrayref | | splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 | | keys %$hashref | keys $hashref | | keys @$arrayref | keys $arrayref | | values %$hashref | values $hashref | | values @$arrayref | values $arrayref | | ($k,$v) = each %$hashref | ($k,$v) = each $hashref | | ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref | |----------------------------+---------------------------|
This allows these built-in functions to act on long dereferencing chains or on the return value of subroutines without needing to wrap them in @{}
or %{}
:
push @{$obj->tags}, $new_tag; # old way push $obj->tags, $new_tag; # new way for ( keys %{$hoh->{genres}{artists}} ) {...} # old way for ( keys $hoh->{genres}{artists} ) {...} # new way
For push
, unshift
and splice
, the reference will auto-vivify if it is not defined, just as if it were wrapped with @{}
.
Calling keys
or values
directly on a reference gives a substantial performance improvement over explicit dereferencing.
For keys
, values
, each
, when overloaded dereferencing is present, the overloaded dereference is used instead of dereferencing the underlying reftype. Warnings are issued about assumptions made in the following three ambiguous cases:
(a) If both %{} and @{} overloading exists, %{} is used (b) If %{} overloading exists on a blessed arrayref, %{} is used (c) If @{} overloading exists on a blessed hashref, @{} is used
The /r
flag, which was added to s///
in 5.13.2, has been extended to the y///
operator.
It causes it to perform the substitution on a copy of its operand, returning that copy instead of a character count.
${^GLOBAL_PHASE}
A new global variable, ${^GLOBAL_PHASE}
, has been added to allow introspection of the current phase of the perl interpreter. It's explained in detail in "${^GLOBAL_PHASE}" in perlvar and "BEGIN, UNITCHECK, CHECK, INIT and END" in perlmod.
Perl comes with the Unicode 6.0 data base updated with Corrigendum #8, with one exception noted below. See http://unicode.org/versions/Unicode6.0.0 for details on the new release. Perl does not support any Unicode provisional properties, including the new ones for this release, but their database files are packaged with Perl.
Unicode 6.0 has chosen to use the name BELL
for the character at U+1F514, which is a symbol that looks like a bell, and used in Japanese cell phones. This conflicts with the long-standing Perl usage of having BELL
mean the ASCII BEL
character, U+0007. In Perl 5.14, \N{BELL}
will continue to mean U+0007, but its use will generate a deprecated warning message, unless such warnings are turned off. The new name for U+0007 in Perl will be ALERT
, which corresponds nicely with the existing shorthand sequence for it, "\a"
. \N{BEL}
will mean U+0007, with no warning given. The character at U+1F514 will not have a name in 5.14, but can be referred to by \N{U+1F514}
. The plan is that in Perl 5.16, \N{BELL}
will refer to U+1F514, and so all code that uses \N{BELL}
should convert by then to using \N{ALERT}
, \N{BEL}
, or "\a"
instead.
Custom ops can now be registered with the new custom_op_register
C function and the XOP
structure. This will make it easier to add new properties of custom ops in the future. Two new properties have been added already, xop_class
and xop_peep
.
xop_class
is one of the OA_*OP constants, and allows B and other introspection mechanisms to work with custom ops that aren't BASEOPs. xop_peep
is a pointer to a function that will be called for ops of this type from Perl_rpeep
.
See "Custom Operators" in perlguts and "Custom Operators" in perlapi for more detail.
The old PL_custom_op_names
/PL_custom_op_descs
interface is still supported but discouraged.
If you assign a typeglob to a scalar variable:
$glob = *foo;
the glob that is copied to $glob
is marked with a special flag indicating that the glob is just a copy. This allows subsequent assignments to $glob
to overwrite the glob. The original glob, however, is immutable.
Many Perl operators did not distinguish between these two types of globs. This would result in strange behaviour in edge cases: untie $scalar
would do nothing if the last thing assigned to the scalar was a glob (because it treated it as untie *$scalar
, which unties a handle). Assignment to a glob slot (e.g., (*$glob) = \@some_array
) would simply assign \@some_array
to $glob
.
To fix this, the *{}
operator (including the *foo
and *$foo
forms) has been modified to make a new immutable glob if its operand is a glob copy. Various operators that make a distinction between globs and scalars have been modified to treat only immutable globs as globs.
This causes an incompatible change in code that assigns a glob to the return value of *{}
when that operator was passed a glob copy. Take the following code, for instance:
$glob = *foo; *$glob = *bar;
The *$glob
on the second line returns a new immutable glob. That new glob is made an alias to *bar
. Then it is discarded. So the second assignment has no effect.
It also means that tie $handle
will now tie $handle
as a scalar, even if it has had a glob assigned to it.
The upside to this incompatible change is that bugs [perl #77496], [perl #77502], [perl #77508], [perl #77688], and [perl #77812], and maybe others, too, have been fixed.
See http://rt.perl.org/rt3/Public/Bug/Display.html?id=77810 for even more detail.
Stash list assignment %foo:: = ()
used to make the stash anonymous temporarily while it was being emptied. Consequently, any of its subroutines referenced elsewhere would become anonymous (showing up as "(unknown)" in caller
). Now they retain their package names, such that caller
will return the original sub name if there is still a reference to its typeglob, or "foo::__ANON__" otherwise [perl #79208].
\N{BELL}
is deprecatedThis is because Unicode is using that name for a different character. See "p5137-Unicode Version 6.0 is now supported (mostly)" for more explanation.
Unicode::Collate
upgrade from 0.63 to 0.67. See below for details.
Unicode::Collate::CJK::Big5
Unicode::Collate::CJK::GB2312
Unicode::Collate::CJK::JISX0208
Unicode::Collate::CJK::Korean
Unicode::Collate::CJK::Pinyin
Unicode::Collate::CJK::Stroke
Archive::Extract
has been upgraded from 0.44 to 0.46
Resolves an issue with NetBSD-current and its new unzip executable.
Archive::Tar
has been upgraded from 1.68 to 1.72
This adds the ptargrep utility for using regular expressions against the contents of files in a tar archive.
B
has been upgraded from 1.24 to 1.26.
It no longer crashes when taking apart a y///
containing characters outside the octet range or compiled in a use utf8
scope.
The size of the shared object has been reduced by about 40%, with no reduction in functionality.
B::Deparse
has been upgraded from 0.99 to 1.01.
It fixes deparsing of our
followed by a variable with funny characters (as permitted under the utf8
pragma) [perl #33752].
CGI
has been upgraded from 3.49 to 3.50
This provides the following security fixes: the MIME boundary in multipart_init is now random and improvements to the handling of newlines embedded in header values.
The documentation for param_fetch() has been corrected and clarified.
CPAN
has been upgraded from 1.94_61 to 1.94_62CPANPLUS
has been upgraded from 0.9007 to 0.9010
Fixes for the SQLite source engine and resolving of issues with the testsuite when run under local::lib and/or cpanminus
CPANPLUS::Dist::Build
has been upgraded from 0.48 to 0.50Data::Dumper
has been upgraded from 2.129 to 2.130_01.DynaLoader
has been upgraded from 1.10 to 1.11.
It fixes a buffer overflow when passed a very long file name.
ExtUtils::Constant
has been upgraded from 0.22 to 0.23.
The AUTOLOAD
helper code generated by ExtUtils::Constant::ProxySubs
can now croak
for missing constants, or generate a complete AUTOLOAD
subroutine in XS, allowing simplification of many modules that use it. (Fcntl
, File::Glob
, GDBM_File
, I18N::Langinfo
, POSIX
, Socket
)
ExtUtils::Constant::ProxySubs
can now optionally push the names of all constants onto the package's C{@EXPORT_OK}. This has been used to replace less space-efficient code in B
, helping considerably shrink the size of its shared object.
Fcntl
has been upgraded from 1.09 to 1.10.File::Fetch
has been upgraded from 0.24 to 0.28
HTTP::Lite
is now supported for 'http' scheme.
The fetch
utility is supported on FreeBSD, NetBSD and Dragonfly BSD for the http
and ftp
schemes.
File::Glob
has been upgraded from 1.09 to 1.10.File::stat
has been upgraded from 1.03 to 1.04.
The -x
and -X
file test operators now work correctly under the root user.
GDBM_File
has been upgraded from 1.11 to 1.12.
This fixes a memory leak when DBM filters are used.
Hash::Util
has been upgraded from 0.09 to 0.10.Hash::Util::FieldHash
has been upgraded from 1.05 to 1.06.I18N::Langinfo
has been upgraded from 0.06 to 0.07.Locale::Maketext
has been upgraded from 1.16 to 1.17.Math::BigInt
has been upgraded from 1.97 to 1.99_01.Math::BigRat
has been upgraded from 0.26 to 0.26_01Math::BigInt::FastCalc
has been upgraded from 0.22 to 0.24_01.MIME::Base64
has been upgraded from 3.09 to 3.10
Includes new functions to calculate the length of encoded and decoded base64 strings.
mro
has been upgraded from 1.04 to 1.05.NDBM_File
has been upgraded from 1.09 to 1.10.
This fixes a memory leak when DBM filters are used.
ODBM_File
has been upgraded from 1.08 to 1.09.
This fixes a memory leak when DBM filters are used.
Opcode
has been upgraded from 1.16 to 1.17.parent
has been upgraded from 0.223 to 0.224Pod::Simple
has been upgraded from 3.14 to 3.15
Includes various fixes to HTML
and XHTML
handling.
POSIX
has been upgraded from 1.21 to 1.22.re
has been upgraded from 0.13 to 0.14, for the sake of the new use re "/flags"
pragma.Safe
has been upgraded from 2.28 to 2.29.
It adds &version::vxs::VCMP
to the default share.
SDBM_File
has been upgraded from 1.07 to 1.08.SelfLoader
has been upgraded from 1.17 to 1.18.
It now works in taint mode [perl #72062].
Socket
has been upgraded from 1.90 to 1.91.Storable
has been upgraded from 2.22 to 2.24
Includes performance improvement for overloaded classes.
Sys::Hostname
has been upgraded from 1.13 to 1.14.Unicode::Collate
has been upgraded from 0.63 to 0.67
This release newly adds locales ja
ko
and zh
and its variants ( zh__big5han
, zh__gb2312han
, zh__pinyin
, zh__stroke
).
Supported UCA_Version 22 for Unicode 6.0.0.
The following modules have been added:
Unicode::Collate::CJK::Big5
for zh__big5han
which makes tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering.
Unicode::Collate::CJK::GB2312
for zh__gb2312han
which makes tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering.
Unicode::Collate::CJK::JISX0208
which makes tailoring of 6355 kanji (CJK Unified Ideographs) in the JIS X 0208 order.
Unicode::Collate::CJK::Korean
which makes tailoring of CJK Unified Ideographs in the order of CLDR's Korean ordering.
Unicode::Collate::CJK::Pinyin
for zh__pinyin
which makes tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering.
Unicode::Collate::CJK::Stroke
for zh__stroke
which makes tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering.
perlvar reorders the variables and groups them by topic. Each variable introduced after Perl 5.000 notes the first version in which it is available. perlvar also has a new section for deprecated variables to note when they were removed.
New style guide for POD documentation, split mostly from the NOTES section of the pod2man man page.
( This was added to v5.13.6
but was not documented with that release ).
use locale
affects formats.y///
operator, and has been documented.Archive::Tar
.*Foo::ISA = *Bar::ISA
works properly.PL_isarev
(accessible at the Perl level via mro::get_isarev
) is updated properly.Directory handles are now properly cloned when threads are created. In perl 5.13.6, child threads simply stopped inheriting directory handles. In previous versions, threads would share handles, resulting in crashes.
Support for building with Visual C++ 2010 is now underway, but is not yet complete. See README.win32 for more details.
Record-oriented files (record format variable or variable with fixed control) opened for write by the perlio layer will now be line buffered to prevent the introduction of spurious line breaks whenever the perlio buffer fills up.
lex_start
has been added to the API, but is considered experimental.parse_block
function has been added to the API [perl #78222].%^H
. See the functions beginning with cophh_
in perlapi.HvENAME
macro, which is now the recommended name to use in MRO linearisations (HvNAME
being a fallback if there is no HvENAME
).
These names are added and deleted via hv_ename_add
and hv_ename_delete
. These two functions are not part of the API.
newFOROP()
constructor function no longer takes a parameter stating what label is to go in the state op.newWHILEOP()
and newFOROP()
functions no longer accept a line number as a parameter.parse_barestmt()
function has been added, for parsing a statement without a label.parse_label()
function has been added, that parses a statement label, separate from statements.CvSTASH()
macro can now only be used as an rvalue. CvSTASH_set()
has been added to replace assignment to CvSTASH()
. This is to ensure that backreferences are handled properly. These macros are not part of the API.op_scope()
and op_lvalue()
functions have been added to the API, but are considered experimental.parse_stmt
C function added in earlier in the 5.13.x series has been fixed to work with statements ending with }
[perl #78222].parse_fullstmt
C function added in 5.13.5 has been fixed to work when called while an expression is being parsed.Encode::decode_utf8("\303\200") =~ /(\xc0)+/
) [perl #78464].(?d)
regular expression construct now overrides a previous (?u)
or use feature "unicode_string"
[perl #78508].do "file"
, introduced in perl 5.13.6, has been fixed [perl #78488].SvPVbyte
function available to XS modules now calls magic before downgrading the SV, to avoid warnings about wide characters [perl #72398].=
operator used to ignore magic (e.g., tie methods) on its right-hand side if the scalar happened to hold a typeglob. This could happen if a typeglob was the last thing returned from or assigned to a tied scalar [perl #77498].sprintf
was ignoring locales when called with constant arguments [perl #78632].[[:alnum:]]
, and its inverse [[:^alnum:]]
. This is now fixed for regular expressions compiled under the "u"
modifier. See "p5137-use feature "unicode_strings"
now applies to more regex matching". [perl #18281].use encoding
no longer causes perl to crash [perl #78674].->import
on a class lacking an import method could corrupt the stack, resulting in strange behaviour. For instance,
push @a, "foo", $b = bar->import;
would assign 'foo' to $b
[perl #63790].
.=
followed by <>
or readline
would leak memory if $/
contained characters beyond the octet range and the scalar assigned to happened to be encoded as UTF8 internally [perl #72246].recv
function could crash when called with the MSG_TRUNC flag [perl #75082].*a
) was calling get-magic on the glob, even when its contents were not being used [perl #78580].
This bug was introduced in 5.13.2 and did not affect earlier perl versions.
qq{\x{30ab}} =~ /\xab|\xa9/
) would cause erroneous warnings [perl #70998].s///r
(added in 5.13.2) no longer leaks./\A(?:(?:)foo|bar|zot)\z/
[perl #78356].+
inside a lookahead would sometimes cause an incorrect match failure in a global match (e.g., /(?=(\S+))/g
) [perl #68564].foreach
over an array returned by an lvalue sub now works [perl #23790].$@
is now localised during calls to binmode
to prevent action at a distance [perl #78844].PL_isarev
, which is accessible to Perl via mro::get_isarev
is now updated properly when packages are deleted or removed from the @ISA
of other classes. This allows many packages to be created and deleted without causing a memory leak [perl #75176].undef *Foo::
and undef *Foo::ISA
and delete $package::{ISA}
used not to update the internal isa caches if the stash or @ISA
array had a reference elsewhere. In fact, undef *Foo::ISA
would stop a new @Foo::ISA
array from updating caches.@ISA
arrays can now be shared between classes via *Foo::ISA = \@Bar::ISA
or *Foo::ISA = *Bar::ISA
[perl #77238].formline
no longer crashes when passed a tainted format picture. It also taints $^A
now if its arguments are tainted [perl #79138].Use of uninitialized value $Foo::BAR
, crashes could occur if the GLOB of the global variable causing the warning has been detached from its original stash by, for example delete $::{'Foo::'}
. This has been fixed by disabling the reporting of variable names in the warning in those cases.Randy Kobes, creator of the kobesearch alternative to search.cpan.org and contributor/maintainer to several core Perl toolchain modules, passed away on September 18, 2010 after a battle with lung cancer. His contributions to the Perl community will be missed.
Perl 5.13.7 represents approximately one month of development since Perl 5.13.6 and contains 73100 lines of changes across 518 files from 39 authors and committers:
Abhijit Menon-Sen, Abigail, Ben Morrow, Chas. J. Owens IV, Chris 'BinGOs' Williams, Craig A. Berry, David Golden, David Mitchell, Father Chrysostomos, Fingle Nark, Florian Ragwitz, George Greer, Grant McLean, H.Merijn Brand, Ian Goodacre, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Karl Williamson, Lubomir Rintel, Marty Pauley, Moritz Lenz, Nicholas Clark, Nicolas Kaiser, Niko Tyni, Peter John Acklam, Rafael Garcia-Suarez, Shlomi Fish, Steffen Mueller, Steve Hay, Tatsuhiko Miyagawa, Tim Bunce, Todd Rinaldo, Tom Christiansen, Tom Hukins, Tony Cook, Yves Orton, Zefram and brian d foy
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5136delta - what is new for perl v5.13.6
This document describes differences between the 5.13.5 release and the 5.13.6 release.
If you are upgrading from an earlier release such as 5.13.4, first read "p5135-NAME", which describes differences between 5.13.4 and 5.13.5.
(?^...)
regex construct added to signify default modifiersA caret (also called a "circumflex accent") "^"
immediately following a "(?"
in a regular expression now means that the subexpression is to not inherit the surrounding modifiers such as /i
, but to revert to the Perl defaults. Any modifiers following the caret override the defaults.
The stringification of regular expressions now uses this notation. E.g., before, qr/hlagh/i
would be stringified as (?i-xsm:hlagh)
, but now it's stringified as (?^i:hlagh)
.
The main purpose of this is to allow tests that rely on the stringification to not have to change when new modifiers are added. See "Extended Patterns" in perlre.
"d"
, "l"
, and "u"
regex modifiers addedThese modifiers are currently only available within a (?...)
construct.
The "l"
modifier says to compile the regular expression as if it were in the scope of use locale
, even if it is not.
The "u"
modifier says to compile the regular expression as if it were in the scope of a use feature "unicode_strings"
pragma.
The "d"
modifier is used to override any use locale
and use feature "unicode_strings"
pragmas that are in effect at the time of compiling the regular expression.
See just below and "(?dlupimsx-imsx)" in perlre.
use feature "unicode_strings"
now applies to some regex matchingAnother chunk of the "The "Unicode Bug"" in perlunicode is fixed in this release. Now, regular expressions compiled within the scope of the "unicode_strings" feature will match the same whether or not the target string is encoded in utf8, with regard to \s
, \w
, \b
, and their complements. Work is underway to add the [[:posix:]]
character classes and case sensitive matching to the control of this feature, but was not complete in time for this dot release.
\N{...}
now handles Unicode named character sequencesUnicode has a number of named character sequences, in which particular sequences of code points are given names. \N{...}
now recognizes these. See charnames.
charnames::string_vianame()
This function is a run-time version of \N{...}
, returning the string of characters whose Unicode name is its parameter. It can handle Unicode named character sequences, whereas the pre-existing charnames::vianame()
cannot, as the latter returns a single code point. See charnames.
It is now safe to use regular expressions within (?{...})
and (??{...})
code blocks inside regular expressions.
These block are still experimental, however, and still have problems with lexical (my
) variables, lexical pragmata and abnormal exiting.
XS code in an extension module can now annotate a subroutine (whether implemented in XS or in Perl) so that nominated XS code will be called at compile time (specifically as part of op checking) to change the op tree of that subroutine. The compile-time check function (supplied by the extension module) can implement argument processing that can't be expressed as a prototype, generate customised compile-time warnings, perform constant folding for a pure function, inline a subroutine consisting of sufficiently simple ops, replace the whole call with a custom op, and so on. This was previously all possible by hooking the entersub
op checker, but the new mechanism makes it easy to tie the hook to a specific subroutine. See "cv_set_call_checker" in perlapi.
To help in writing custom check hooks, several subtasks within standard entersub
op checking have been separated out and exposed in the API.
delete $+{...}
Custom regular expression engines can now determine the return value of delete
on an entry of %+
or %-
.
keys
, values
work on arraysYou can now use the keys
, values
, each
builtin functions on arrays (previously you could only use them on hashes). See perlfunc for details. This is actually a change introduced in perl 5.12.0, but it was missed from that release's perldelta.
Default regular expression modifiers are now notated by using (?^...)
. Code relying on the old stringification will fail. The purpose of this is so that when new modifiers are added, such code will not have to change (after this one time), as the stringification will automatically incorporate the new modifiers.
Code that needs to work properly with both old- and new-style regexes can avoid the whole issue by using (for Perls since 5.9.5):
use re qw(regexp_pattern); my ($pat, $mods) = regexp_pattern($re_ref);
where $re_ref
is a reference to a compiled regular expression. Upon return, $mods
will be a string containing all the non-default modifiers used when the regular expression was compiled, and $pattern
the actual pattern.
If the actual stringification is important, or older Perls need to be supported, you can use something like the following:
# Accept both old and new-style stringification my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
And then use $modifiers
instead of -xism
.
Regular expressions compiled under "use locale"
now retain this when interpolated into a new regular expression compiled outside a "use locale"
, and vice-versa.
Previously, a regular expression interpolated into another one inherited the localeness of the surrounding one, losing whatever state it originally had. This is considered a bug fix, but may trip up code that has come to rely on the incorrect behavior.
On systems that do not have a fchdir
function, newly-created threads no longer inherit directory handles from their parent threads. Such programs would probably have crashed anyway [perl #75154].
The unary negation operator -
now treats strings that look like numbers as numbers [perl #57706].
Negative zero (-0.0), when converted to a string, now becomes "0" on all platforms. It used to become "-0" on some, but "0" on others.
If you still need to determine whether a zero is negative, use sprintf("%g", $zero) =~ /^-/
or the Data::Float module on CPAN.
Tie::Hash::NamedCapture
module used to be in the perl core. It has now been moved to an XS module, to reduce the overhead for programs that do not use %+
or %-
.PL_*
accessor functions under ithreads.
When MULTIPLICITY
was first developed, and interpreter state moved into an interpreter struct, thread and interpreter local PL_*
variables were defined as macros that called accessor functions, returning the address of the value, outside of the perl core. The intent was to allow members within the interpreter struct to change size without breaking binary compatibility, so that bug fixes could be merged to a maintenance branch that necessitated such a size change.
However, some non-core code defines PERL_CORE
, sometimes intentionally to bypass this mechanism for speed reasons, sometimes for other reasons but with the inadvertent side effect of bypassing this mechanism. As some of this code is widespread in production use, the result is that the core can't change the size of members of the interpreter struct, as it will break such modules compiled against a previous release on that maintenance branch. The upshot is that this mechanism is redundant, and well-behaved code is penalised by it. Hence it can and should be removed.
Archive::Extract
has been upgraded from version 0.42 to 0.44Carp
has been upgraded from version 1.18 to 1.19.
It no longer autovivifies the *CORE::GLOBAL::caller
glob, something it started doing in 1.18, which was released with perl 5.13.4 [perl #78082]
Compress::Raw::Bzip2
has been upgraded from version 2.030 to 2.031
Updated to use bzip2 1.0.6
CPAN
has been upgraded from version 1.94_57 to 1.94_61Data::Dumper
has been upgraded from version 2.128 to 2.129.
Dumpxs
no longer crashes with globs returned by *$io_ref
[perl #72332].
Digest::MD5
has been upgraded from version 2.40 to 2.51.
It is now safe to use this module in combination with threads.
File::DosGlob
has been upgraded from version 1.02 to 1.03.
It allows patterns containing literal parentheses (they no longer need to be escaped). On Windows, it no longer adds an extra ./ to the file names returned when the pattern is a relative glob with a drive specification, like c:*.pl [perl #71712].
File::Find
has been upgraded from version 1.17 to 1.18.
It improves handling of backslashes on Windows, so that paths such as c:\dir\/file are no longer generated [perl #71710].
if
has been upgraded from version 0.05 to 0.06IPC::Cmd
has been upgraded from version 0.60 to 0.64IPC::Open3
has been upgraded from version 1.06 to 1.07.
The internal xclose
routine now knows how to handle file descriptors, as documented, so duplicating STDIN in a child process using its file descriptor now works [perl #76474].
Locale::Codes
has been upgraded from version 3.13 to 3.14.Locale::Maketext
has been upgraded from version 1.15 to 1.16.
It fixes an infinite loop in Locale::Maketext::Guts::_compile()
when working with tainted values (CPAN RT #40727).
->maketext
calls will now backup and restore $@
so that error messages are not suppressed (CPAN RT #34182).
Math::BigInt
has been upgraded from version 1.95 to 1.97.
This prevents sqrt($int)
from crashing under use bigrat;
[perl #73534].
NEXT
has been upgraded from version 0.64 to 0.65.overload
has been upgraded from version 1.10 to 1.11.
overload::Method
can now handle subroutines that are themselves blessed into overloaded classes [perl #71998].
PathTools
has been upgraded from version 3.31_01 to 3.34.podlators
has been upgraded from version 2.3.1 to 2.4.0sigtrap
has been upgraded from version 1.04 to 1.05.
It no longer tries to modify read-only arguments when generating a backtrace [perl #72340].
threads
has been upgraded from version 1.77_03 to 1.81_01.threads::shared
has been upgrade from version 1.33_03 to 1.34Unicode::Collate
has been upgraded from version 0.59 to 0.63
U::C::Locale newly supports locales: ar, be, bg, de__phonebook, hu, hy, kk, mk, nso, om, tn, vi, hr, ig, ru, sq, se, sr, to and uk
Unicode::Normalize
has been upgraded from version 1.06 to 1.07B::Deparse
has been upgraded from version 0.98 to 0.99
B::Deparse now properly handles the code that applies a conditional pattern match against implicit $_
as it was fixed in [perl #20444].
GDBM_File
has been upgraded from version 1.10 to 1.11SvTRUE
macro was simply wrong in stating that get-magic is not processed. It has been corrected.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.
Conversion of strings to floating-point numbers is now more accurate on IRIX systems [perl #32380].
Early versions of Mac OS X (Darwin) had buggy implementations of the setregid
, setreuid
, setrgid
and setruid
functions, so perl would pretend they did not exist.
These functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and higher, as they have been fixed [perl #72990].
perl now builds again with OpenVOS (formerly known as Stratus VOS) [perl #78132].
The shortening of symbols longer than 31 characters in the C sources is now done by the compiler rather than by xsubpp (which could only do so for generated symbols in XS code).
$Config{gccversion}
is now set correctly when perl is built using the mingw64 compiler from http://mingw64.org [perl #73754].
The build process proceeds more smoothly with mingw and dmake when C:\MSYS\bin is in the PATH, due to a Cwd
fix.
sv_cmp_flags
, sv_cmp_locale_flags
, sv_eq_flags
and sv_collxfrm_flags
functions have been added. These are like their non-_flags counterparts, but allow one to specify whether get-magic is processed.
The sv_cmp
, sv_cmp_locale
, sv_eq
and sv_collxfrm
functions have been replaced with wrappers around the new functions.
sv_2bool_flags
function has been added.
This is like sv_2bool
, but it lets the calling code decide whether get-magic is handled. sv_2bool
is now a macro that calls the new function.
SvTRUE_nomg
, has been added.
This is like SvTRUE
, except that it does not process magic. It uses the new sv_2bool_flags
function.
sv_catsv_flags
no longer calls mg_get
on its second argument (the source string) if the flags passed to it do not include SV_GMAGIC. So it now matches the documentation.save_freeop
, save_op
, save_pushi32ptr
and save_pushptrptr
functions have been added to the API.parse_stmtseq()
parses a sequence of statements, up to closing brace or EOF.s///g
) that is in the same scope will no longer cause match variables to have the wrong values on subsequent iterations. This can happen when an array or hash subscript is interpolated in the right-hand side, as in s|(.)|@a{ print($1), /./ }|g
[perl #19078].$text =~ ( 1 ? /phoo/ : /bear/)
to turn into
$text =~ /phoo/
at compile time. Now it correctly matches against $_
[perl #20444].
eval
or by loading modules) from within a UNITCHECK
block no longer causes the interpreter to crash [perl #70614].-d
is used on the shebang (#!
) line, the debugger now has access to the lines of the main program. In the past, this sometimes worked and sometimes did not, depending on what order things happened to be arranged in memory [perl #71806].y///
or tr///
operator now calls get-magic (e.g., the FETCH
method of a tie) on its left-hand side just once, not twice [perl #76814].eq
, ne
, lt
, gt
, le
, ge
and cmp
) and logical not (not
and !
) operators no longer call magic (e.g., tie methods) twice on their operands [perl #76814].
This bug was introduced in an earlier 5.13 release, and does not affect perl 5.12.
FETCH
method called twice [perl #76814].
This bug was introduced in an earlier 5.13 release, and does not affect perl 5.12.
-C
command line option can now be followed by other options [perl #72434].sub { $_[0] = *foo }->($hash{key}); # $_[0] would have been the string "*main::foo"
It also happened when a glob was assigned to, or returned from, an element of a tied array or hash [perl #36051].
Now directory handles are cloned properly, on systems that have a fchdir
function. On other systems, new threads simply do not inherit directory handles from their parent threads [perl #75154].
\18
and \88
.
This bug was introduced in version 5.13.5 and did not affect earlier versions [perl #78058].
&
|
^
bitwise operators no longer coerce read-only arguments [perl #20661].sort
with a custom sort routine could crash if too many nested subroutine calls occurred from within the sort routine [perl #77930].
This bug was introduced in an earlier 5.13 release, and did not affect perl 5.12.
eval_sv
and eval_pv
C functions now set $@
correctly when there is a syntax error and no G_KEEPERR
flag, and never set it if the G_KEEPERR
flag is present [perl #3719].map
and grep
blocks no longer leak memory when processing large lists [perl #48004].version
objects no longer cause crashes [perl #78286].Perl now only frees the affected slots of the GV, rather than freeing the GV itself. This makes sure that there are no dangling refs or corrupted state during destruction.
*,
, which holds the scalar variable $,
(output field separator), had the wrong reference count in child threads.splice
now calls set-magic. This means that, for instance, changes made by splice @ISA
are respected by method calls [perl #78400].use v5.8
no longer leaks memory [perl #78436].Perl 5.13.6 represents approximately one month of development since Perl 5.13.5 and contains 67920 lines of changes across 566 files from 47 authors and committers:
A. Sinan Unur, Aaron Crane, Alex Davies, Ali Polatel, Allen Smith, Andrew Rodland, Andy Dougherty, Ben Morrow, brian d foy, Casey West, Chip Salzenberg, Chris 'BinGOs' Williams, Craig A. Berry, David Golden, David Mitchell, Eric Brine, Father Chrysostomos, Florian Ragwitz, George Greer, gregor herrmann, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Joshua Pritikin, Karl Williamson, kmx, Michael G Schwern, Mike Kelly, Nicholas Clark, Paul Green, Rafael Garcia-Suarez, Renee Baecker, Ricardo Signes, Sisyphus, Slaven Rezic, Steffen Müller, Steve Hay, Sullivan Beck, Tatsuhiko Miyagawa, Todd Rinaldo, Tony Cook, Tye McQueen, Vernon Lyon, Walt Mankowski, Zefram, Zsbán Ambrus, Ævar Arnfjörð Bjarmason.
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5135delta - what is new for perl v5.13.5
This document describes differences between the 5.13.4 release and the 5.13.5 release.
If you are upgrading from an earlier release such as 5.13.3, first read "p5134-NAME", which describes differences between 5.13.3 and 5.13.4.
Previously, in code such as
use constant DEBUG => 0; sub GAK { warn if DEBUG; print "stuff\n"; }
the ops for warn if DEBUG;
would be folded to a null
op (ex-const
), but the nextstate
op would remain, resulting in a runtime op dispatch of nextstate
, nextstate
, ...
The execution of a sequence of nextstate
ops is indistinguishable from just the last nextstate
op so the peephole optimizer now eliminates the first of a pair of nextstate
ops, except where the first carries a label, since labels must not be eliminated by the optimizer and label usage isn't conclusively known at compile time.
The parse_fullstmt
function has been added to allow parsing of a single complete Perl statement. See perlapi for details.
A new C API for introspecting the hinthash %^H
at runtime has been added. See cop_hints_2hv
, cop_hints_fetchpvn
, cop_hints_fetchpvs
, cop_hints_fetchsv
, and hv_copy_hints_hv
in perlapi for details.
caller()
The caller_cx
function has been added as an XSUB-writer's equivalent of caller()
. See perlapi for details.
In previous versions of Perl, magic variables like $!
, %SIG
, etc. would 'leak' into other packages. So %foo::SIG
could be used to access signals, ${"foo::!"}
(with strict mode off) to access C's errno
, etc.
This was a bug, or an 'unintentional' feature, which caused various ill effects, such as signal handlers being wiped when modules were loaded, etc.
This has been fixed (or the feature has been removed, depending on how you see it).
Previously, the following code resulted in a successful match:
my @a = qw(a y0 z); my @b = qw(a x0 z); @a[0 .. $#b] ~~ @b;
This odd behaviour has now been fixed [perl #77468].
The first argument of the C API function Perl_fetch_cop_label
has changed from struct refcounted he *
to COP *
, to better insulate the user from implementation details.
This API function was marked as "may change", and likely isn't in use outside the core. (Neither an unpacked CPAN, nor Google's codesearch, finds any other references to it.)
Historically the parser fooled itself into thinking that qw(...)
literals were always enclosed in parentheses, and as a result you could sometimes omit parentheses around them:
for $x qw(a b c) { ... }
The parser no longer lies to itself in this way. Wrap the list literal in parentheses, like:
for $x (qw(a b c)) { ... }
SV
body they actually use, saving some space.bignum
Upgraded from version 0.23 to 0.25.
blib
Upgraded from version 1.05 to 1.06.
open
Upgraded from version 1.07 to 1.08.
threads-shared
Upgraded from version 1.33_02 to 1.33_03.
warnings
and warnings::register
Upgraded from version 1.10 to 1.11 and from version 1.01 to 1.02 respectively.
It is now possible to register warning categories other than the names of packages using warnings::register
. See perllexwarn for more information.
B::Debug
Upgraded from version 1.12 to 1.16.
CPANPLUS::Dist::Build
Upgraded from version 0.46 to 0.48.
Data::Dumper
Upgraded from version 2.126 to 2.128.
This fixes a crash when using custom sort functions that might cause the stack to change.
Encode
Upgraded from version 2.39 to 2.40.
Errno
Upgraded from version 1.12 to 1.13.
On some platforms with unusual header files, like Win32/gcc using mingw64 headers, some constants which weren't actually error numbers have been exposed by Errno
. This has been fixed [perl #77416].
ExtUtils::MakeMaker
Upgraded from version 6.5601 to 6.57_05.
Filter::Simple
Upgraded from version 0.84 to 0.85.
Hash::Util
Upgraded from version 0.08 to 0.09.
Math::BigInt
Upgraded from version 1.89_01 to 1.95.
This fixes, among other things, incorrect results when computing binomial coefficients [perl #77640].
Math::BigInt::FastCalc
Upgraded from version 0.19 to 0.22.
Math::BigRat
Upgraded from version 0.24 to 0.26.
Module::CoreList
Upgraded from version 2.37 to 2.38.
PerlIO::scalar
Upgraded from version 0.08 to 0.09.
POSIX
Upgraded from version 1.19 to 1.20.
It now includes constants for POSIX signal constants.
Safe
Upgraded from version 2.27 to 2.28.
This fixes a possible infinite loop when looking for coderefs.
Test::Simple
Upgraded from version 0.96 to 0.97_01.
Tie::Hash
Upgraded from version 1.03 to 1.04.
Calling Tie::Hash->TIEHASH()
used to loop forever. Now it croak
s.
Unicode::Collate
Upgraded from version 0.56 to 0.59.
XSLoader
Upgraded from version 0.10 to 0.11.
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.
New fatal error produced when parsing code supplied by an extension violated the parser's API in a detectable way.
See "p5135-Use of qw(...) as parentheses" for details.
warn
and die
now produce 'Wide character' warnings when fed a character outside the byte range if STDERR is a byte-sized handle.goto
construct has been removed [perl #74404].PerlIOUnix_open
honour default permissions on VMS.
When perlio
became the default and unixio
became the default bottom layer, the most common path for creating files from Perl became PerlIOUnix_open
, which has always explicitly used 0666
as the permission mask.
To avoid this, 0777
is now passed as the permissions to open()
. In the VMS CRTL, 0777
has a special meaning over and above intersecting with the current umask; specifically, it allows Unix syscalls to preserve native default permissions.
CALL_FPTR
and CPERLscope
have been deprecated.
Those are left from an old implementation of MULTIPLICITY
using C++ objects, which was removed in Perl 5.8. Nowadays these macros do exactly nothing, so they shouldn't be used anymore.
For compatibility, they are still defined for external XS
code. Only extensions defining PERL_CORE
must be updated now.
lex_stuff_pvs()
has been added as a convenience macro wrapping lex_stuff_pvn()
for literal strings.In addition to PL_peepp
, for hooking into the toplevel peephole optimizer, a PL_rpeepp
is now available to hook into the optimizer recursing into side-chains of the optree.
my $x = 3; $x = length(undef)
result in $x
set to 3
has been fixed. $x
will now be undef
.*COMMIT
to sometimes be ignored has been removed.open $fh, ">", \*glob
will no longer cause the glob to be corrupted when the filehandle is printed to. This would cause perl to crash whenever the glob's contents were accessed [perl #77492].++
and --
, used to cause leaks when being used on references. This has now been fixed.for $x (...) { *x = *y; }
Internals
functions that used reference prototypes were called with the &foo()
syntax, e.g. &Internals::SvREADONLY(undef)
[perl #77776].
These functions now call SvROK
on their arguments before dereferencing them with SvRV
, and we test for this case in t/lib/universal.t.
@a = %h = (list with some duplicate keys);
This has now been fixed [perl #31865].
my $var = *STDOUT; open my $fh, '>', \$var;
This was a mistake, and the previous behaviour from Perl 5.10 and 5.12, which is to treat \$var as a scalar reference, has now been restored.
[\8\9]
was effectively the same as [89\000]
, incorrectly matching a NULL character. It also gave incorrect warnings that the 8
and 9
were ignored. Now [\8\9]
is the same as [89]
and gives legitimate warnings that \8
and \9
are unrecognized escape sequences, passed-through.warn()
and die()
now respect utf8-encoded scalars [perl #45549].Perl 5.13.5 represents approximately one month of development since Perl 5.13.4 and contains 74558 lines of changes across 549 files from 45 authors and committers:
Abigail, Alexander Alekseev, Aristotle Pagaltzis, Ben Morrow, Bram, brian d foy, Chas. Owens, Chris 'BinGOs' Williams, Craig A. Berry, Curtis Jewell, Dagfinn Ilmari Mannsåker, David Golden, David Leadbeater, David Mitchell, Eric Brine, Father Chrysostomos, Florian Ragwitz, Gisle Aas, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Jim Cromie, Jirka Hruška, Karl Williamson, Michael G. Schwern, Nicholas Clark, Paul Johnson, Philippe Bruhat (BooK), Piotr Fusik, Rafael Garcia-Suarez, Rainer Tammer, Reini Urban, Ricardo Signes, Rob Hoelz, Robin Barker, Steffen Mueller, Steve Hay, Steve Peters, Todd Rinaldo, Tony Cook, Vincent Pit, Yves Orton, Zefram, Zsbán Ambrus, Ævar Arnfjörð Bjarmason.
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5134delta - what is new for perl v5.13.4
This document describes differences between the 5.13.4 release and the 5.13.3 release.
If you are upgrading from an earlier release such as 5.13.2, first read "p5133-NAME", which describes differences between 5.13.2 and 5.13.3.
srand()
now returns the seedThis allows programs that need to have repeatable results to not have to come up with their own seed generating mechanism. Instead, they can use srand()
and somehow stash the return for future use. Typical is a test program which has too many combinations to test comprehensively in the time available to it each run. It can test a random subset each time, and should there be a failure, log the seed used for that run so that it can later be used to reproduce the exact results.
\N{name}
and charnames
enhancements\N{}
, charnames::vianame
, charnames::viacode
now know about every character in Unicode. Previously, they didn't know about the Hangul syllables nor a number of CJK (Chinese/Japanese/Korean) characters.
Only stable releases (5.10.x, 5.12.x, 5.14.x, ...) guarantee binary compatibility with each other, while blead releases (5.13.x, 5.15.x, ...) often break this compatibility. However, prior to perl 5.13.4, all blead releases had the same PERL_API_REVISION
, PERL_API_VERSION
, and PERL_API_SUBVERSION
, effectively declaring them as binary compatible, which they weren't. From now on, blead releases will have a PERL_API_SUBVERSION
equal to their PERL_SUBVERSION
, explicitly marking them as incompatible with each other.
Maintenance releases of stable perl versions will continue to make no intentionally incompatible API changes.
When perl's API changes in incompatible ways (which usually happens between every major release), XS modules compiled for previous versions of perl will not work anymore. They will need to be recompiled against the new perl.
In order to ensure that modules are recompiled, and to prevent users from accidentally loading modules compiled for old perls into newer ones, the XS_APIVERSION_BOOTCHECK
macro has been added. That macro, which is called when loading every newly compiled extension, compares the API version of the running perl with the version a module has been compiled for and raises an exception if they don't match.
Some bit fields have been reordered; therefore, this release will not be binary compatible with any previous Perl release.
Functions declared with the following prototypes now behave correctly as unary functions:
*
\sigil
\[...]
;$
;*
;\sigil
;\[...]
Due to this bug fix, functions using the (*)
, (;$)
and (;*)
prototypes are parsed with higher precedence than before. So in the following example:
sub foo($); foo $a < $b;
the second line is now parsed correctly as foo($a) < $b
, rather than foo($a < $b)
. This happens when one of these operators is used in an unparenthesised argument:
< > <= >= lt gt le ge == != <=> eq ne cmp ~~ & | ^ && || // .. ... ?: = += -= *= etc.
$[
After assignment to $[
has been deprecated and started to give warnings in perl version 5.12.0, this version of perl also starts to emit a warning when assigning to $[
in list context. This fixes an oversight in 5.12.0.
When doing a lot of string appending, perl could end up allocating a lot more memory than needed in a very inefficient way, if perl was configured to use the system's malloc
implementation instead of its own.
sv_grow
, which is what's being used to allocate more memory if necessary when appending to a string, has now been taught how to round up the memory it requests to a certain geometric progression, making it much faster on certain platforms and configurations. On Win32, it's now about 100 times faster.
XPV
, XPVIV
, and XPVNV
now only allocate the parts of the SV
body they actually use, saving some space.This release does not introduce any new modules or pragmata.
Archive::Tar
Upgraded from version 1.64 to 1.68.
Among other things, the new version adds a new option to ptar
to allow safe creation of tarballs without world-writable files on Windows, allowing those archives to be uploaded to CPAN.
B::Lint
Upgraded from version 1.11 to 1.12.
Carp
Upgraded from version 1.16 to 1.18.
Carp now detects incomplete caller() overrides and avoids using bogus @DB::args
. To provide backtraces, Carp relies on particular behaviour of the caller built-in. Carp now detects if other code has overridden this with an incomplete implementation, and modifies its backtrace accordingly. Previously incomplete overrides would cause incorrect values in backtraces (best case), or obscure fatal errors (worst case)
This fixes certain cases of Bizarre copy of ARRAY
caused by modules overriding caller()
incorrectly.
Compress::Raw::Bzip2
Upgraded from version 2.027 to 2.030.
Compress::Raw::Zlib
Upgraded from version 2.027 to 2.030.
File::Spec
Upgraded from version 3.31 to 3.31_01.
Various issues in File::Spec::VMS have been fixed.
I18N::Langinfo
Upgraded from version 0.03 to 0.04.
langinfo()
now defaults to using $_
if there is no argument given, just like the documentation always claimed it did.
IO::Compress
Upgraded from version 2.027 to 2.030.
Module::CoreList
Upgraded from version 2.36 to 2.37.
Besides listing the updated core modules of this release, it also stops listing the Filespec
module. That module never existed in core. The scripts generating Module::CoreList
confused it with VMS::Filespec
, which actually is a core module, since the time of perl 5.8.7.
Test::Harness
Upgraded from version 3.21 to 3.22.
Test::Simple
Upgraded from version 0.94 to 0.96.
Among many other things, subtests without a plan
or no_plan
now have an implicit done_testing()
added to them.
Unicode::Collate
Upgraded from version 0.53 to 0.56.
Among other things, it is now using UCA Revision 20 (based on Unicode 5.2.0) and supports a couple of new locales.
feature
Upgraded from version 1.17 to 1.18.
This release does not remove any modules or pragmata.
C++
compilers has been improved.-Wwrite-strings
is now added to cflags by default.$_
.$!
when leaving signal handlers.FETCH
is only called once on tied variables._USE_32BIT_TIME_T
will now be set in $Config{ccflags}
. This improves portability when compiling XS extensions using new compilers, but for a perl compiled with old 32-bit compilers.PERL_POLLUTE
The option to define PERL_POLLUTE
to expose older 5.005 symbols for backwards compatibility has been removed. It's use was always discouraged, and MakeMaker contains a more specific escape hatch:
perl Makefile.PL POLLUTE=1
This can be used for modules that have not been upgraded to 5.6 naming conventions (and really should be completely obsolete by now).
PERL_STATIC_INLINE
The PERL_STATIC_INLINE
define has been added to provide the best-guess incantation to use for static inline functions, if the C compiler supports C99-style static inline. If it doesn't, it'll give a plain static
.
HAS_STATIC_INLINE
can be used to check if the compiler actually supports inline functions.
@DB::args
has been fixed.$!
is now implicitly localized.<>
overloading on tied arguments.PERL_GLOBAL_STRUCT
, which has been broken accidentally in 5.13.3, now works again.HTML::Parser
<= 3.66. A fixed HTML::Parser
is available as version 3.67 on CPAN.Switch
. A patch has been sent upstream and will hopefully appear on CPAN soon.Perl 5.13.4 represents approximately one month of development since Perl 5.13.3, and contains 91,200 lines of changes across 436 files from 34 authors and committers.
Thank you to the following for contributing to this release:
Abigail, Andy Armstrong, Andy Dougherty, Chas. Owens, Chip Salzenberg, Chris 'BinGOs' Williams, Craig A. Berry, David Cantrell, David Golden, David Mitchell, Eric Brine, Father Chrysostomos, Florian Ragwitz, George Greer, Gerard Goossen, H.Merijn Brand, James Mastros, Jan Dubois, Jerry D. Hedden, Joshua ben Jore, Karl Williamson, Lars Dɪᴇᴄᴋá´á´¡ 迪拉斯, Leon Brocard, Lubomir Rintel, Nicholas Clark, Paul Marquess, Rafael Garcia-Suarez, Reini Urban, Robin Barker, Slaven Rezic, Steve Peters, Tony Cook, Wolfram Humann, Zefram
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5133delta - what is new for perl v5.13.3
This document describes differences between the 5.13.3 release and the 5.13.2 release.
If you are upgrading from an earlier release such as 5.13.1, first read "p5132-NAME", which describes differences between 5.13.1 and 5.13.2.
There is a new escape sequence, "\o"
, in double-quote-like contexts. It must be followed by braces enclosing an octal number of at least one digit. It interpolates as the character with an ordinal value equal to the octal number. This construct allows large octal ordinals beyond the current max of 0777 to be represented. It also allows you to specify a character in octal which can safely be concatenated with other regex snippets and which won't be confused with being a backreference to a regex capture group. See "Capture groups" in perlre.
\N{name}
and charnames
enhancements\N{}
and charnames::vianame
now know about the abbreviated character names listed by Unicode, such as NBSP, SHY, LRO, ZWJ, etc., as well as all the customary abbreviations for the C0 and C1 control characters (such as ACK, BEL, CAN, etc.), as well as a few new variants in common usage of some C1 full names.
In the past, it was ineffective to override one of Perl's abbreviations with your own custom alias. Now it works.
You can also create a custom alias directly to the ordinal of a character, known by \N{...}
, charnames::vianame()
, and charnames::viacode()
. Previously, an alias had to be to an official Unicode character name. This made it impossible to create an alias for a code point that had no name, such as the ones reserved for private use. So this change allows you to make more effective use of private use characters. Only if there is no official name will charnames::viacode()
return your custom one.
See charnames for details on all these changes.
Literals may now use either upper case 0X...
or 0B...
prefixes, in addition to the already supported 0x...
and 0b...
syntax. (RT#76296) (a674e8d, 333f87f)
C, Ruby, Python and PHP already supported this syntax, and it makes Perl more internally consistent. A round-trip with eval sprintf "%#X", 0x10
now returns 16
in addition to eval sprintf "%#x", 0x10
, which worked before.
Use of \400
- \777
in regexes in certain circumstances has given different, anomalous behavior than their use in all other double-quote-like contexts. Since 5.10.1, a deprecated warning message has been raised when this happens. Now, all double-quote-like contexts have the same behavior, namely to be equivalent to \x{100}
- \x{1FF}
, with no deprecation warning. Use of these values in the command line option "-0"
retains the current meaning to slurp input files whole; previously, this was documented only for "-0777"
. It is recommended, however, because of various ambiguities, to use the new \o{...}
construct to represent characters in octal. (fa1639c..f6993e9).
Omitting a space between a regex pattern or pattern modifiers and the following word is deprecated. Deprecation for regular expression matches was added in Perl 5.13.2. In this release, the deprecation is extended to regular expression substitutions. For example, s/foo/bar/sand $bar
will still be parsed as s/foo/bar/s and $bar
but will issue a warning. (aa78b66)
This is a mandatory warning, not obeying -X or lexical warning bits. The warning is modelled on that supplied by deprecate.pm for deprecated-in-core .pm libraries. It points to the specific CPAN distribution that contains the .pl libraries. The CPAN version, of course, does not generate the warning. (0111154)
There are several small optimizations to reduce CPU cache misses in various very commonly used modules like warnings
and Carp
as well in accessing file-handles for reading.
autodie
Upgraded from version 2.06_01 to 2.10.
charnames
Upgraded from version 1.08 to 1.10.
viacode()
is now significantly faster. (f3227b7)
lib
Upgraded from version 0.62 to 0.63.
threads
Upgraded from version 1.77_02 to 1.77_03.
threads::shared
Upgraded from version 1.33_01 to 1.33_02.
warnings
Upgraded from version 1.09 to 1.10.
Calling use warnings
without arguments is now significantly more efficient. (8452af9)
Archive::Extract
Upgraded from version 0.38 to 0.42.
Updates since 0.38 include: a safe print method that guards Archive::Extract from changes to $\; a fix to the tests when run in core perl; support for TZ files; and a modification for the lzma logic to favour IO::Uncompress::Unlzma (d7f8799)
Archive::Tar
Upgraded from version 1.54 to 1.64.
Important changes since 1.54 include: compatibility with busybox implementations of tar; a fix so that write()
and create_archive()
close only handles they opened; and a bug was fixed regarding the exit code of extract_archive. (afabe0e)
Attribute::Handlers
Upgraded from version 0.87 to 0.88.
Compress::Raw::Bzip2
Upgraded from version 2.024 to 2.027.
Compress::Raw::Zlib
Upgraded from version 2.024 to 2.027_01.
Compress::Zlib
Upgraded from version 2.024 to 2.027.
CPANPLUS
Upgraded from version 0.90 to 0.9007.
Fixed the shell test to skip if test is not being run under a terminal; resolved the issue where a prereq on Config would not be recognised as a core module. (d4e225a)
Digest::MD5
Upgraded from version 2.39 to 2.40.
Digest::SHA
Upgraded from version 5.47 to 5.48.
Exporter
Upgraded from version 5.64_02 to 5.64_03.
Exporter no longer overrides $SIG{__WARN__}
(RT #74472) (9b86bb5)
ExtUtils::CBuilder
Upgraded from version 0.27 to 0.2703.
ExtUtils::Manifest
Upgraded from version 1.57 to 1.58.
ExtUtils::ParseXS
Upgraded from version 2.2205 to 2.2206.
File::Copy
Upgraded from version 2.19 to 2.20.
Skips suid tests on a nosuid partition. These tests were being skipped on OpenBSD, but nosuid partitions can exist on other systems too. Now it just checks if it can create a suid directory, if not the tests are skipped. Perl builds without errors in a nosuid /tmp with this patch. (cae9400)
I18N::LangTags
Upgraded from version 0.35 to 0.35_01.
IPC::Cmd
Upgraded from version 0.58 to 0.60.
IPC::SysV
Upgraded from version 2.01 to 2.03.
Locale::Maketext
Upgraded from version 1.14 to 1.15.
Locale::Maketext guts have been merged back into the main module (87d86da) and adds external cache support (ace47d6)
Module::Build
Upgraded from version 0.3603 to 0.3607.
Module::CoreList
Upgraded from version 2.34 to 2.36.
Module::Load
Upgraded from version 0.16 to 0.18.
Term::ANSIColor
Upgraded from version 2.02 to 3.00.
Test::Harness
Upgraded from version 3.17 to 3.21.
The core update from Test-Harness 3.17 to 3.21 fixed some things, but also introduced a known problem with argument passing to non-Perl tests.
Time::HiRes
Upgraded from version 1.9719 to 1.9721.
Time::Piece
Upgraded from version 1.15_01 to 1.20_01.
Unicode::Collate
Upgraded from version 0.52_01 to 0.53.
Includes Unicode Collation Algorithm 18 (74b94a7)
Unicode::Normalize
Upgraded from version 1.03 to 1.06.
The Perl 5.12.1 perldelta file was added from the Perl maintenance branch
\o{...}
escape as they have more consistent behavior in different contexts than other forms. (ce7b6f0) (d8b950d) (e1f120a)-0NNN
switch for -0400
or higher (7ba31cb)Support for MacOS Classic within ExtUtils::MakeMaker was removed from Perl in December 2004. Vestigial MacOS Classic specific code has now been removed from other core modules as well (8f8c2a4..c457df0)
t/io/openpid.t now uses the alarm() watchdog strategy for more robustness (5732108)
CvGV()
field of a CV is now reference counted. To ensure consistent behaviour, direct assignment to it, for example CvGV(cv) = gv
is now a compile-time error. A new macro, CvGV_set(cv,gv)
has been introduced to perform this operation safely. Note that modification of this field is not part of of the public API, regardless of this new macro. This change caused some issues in modules that used the private GvGV()
field.Perl_blockhook_register
function. See "Compile-time scope hooks" in perlguts.Perl_croak_no_modify()
to implement Perl_croak("%s", PL_no_modify)
(6ad8f25)tie()
and untie()
to allow overloading (RT#75902) (1db4d19)my_[l]stat_flags()
to replace my_[l]stat()
. my_stat()
and my_lstat()
call get magic on the stack arg, so create _flags()
variants that allow us to control this. (0d7d409)(?{...})
(RT#2353) (634d691)no VERSION
if VERSION
is greater than 5.12 (da8fb5d)eval
not detecting taint of overloaded/tied arguments (RT #75716) (895b760)eval
when evaluating a object with overloaded stringification by creating a stringified copy when necessary (3e5c018)prove ./test.sh
instead of prove test.sh
These issues are being solved upstream, but didn't make it into this release. They're expected to be fixed in time for perl v5.13.4. (RT #59457)version
now prevents object methods from being called as class methods (d808b68)Perl 5.13.3 represents approximately one month of development since Perl 5.13.2, and contains 12,184 lines of changes across 575 files from 104 authors and committers.
Thank you to the following for contributing to this release:
Abhijit Menon-Sen, Abigail, Alex Davies, Alex Vandiver, Alexandr Ciornii, Andreas J. Koenig, Andrew Rodland, Andy Dougherty, Aristotle Pagaltzis, Arkturuz, Ben Morrow, Bo Borgerson, Bo Lindbergh, Brad Gilbert, Bram, Brian Phillips, Chas. Owens, Chip Salzenberg, Chris Williams, Craig A. Berry, Curtis Jewell, Dan Dascalescu, Daniel Frederick Crisman, Dave Rolsky, David Caldwell, David E. Wheeler, David Golden, David Leadbeater, David Mitchell, Dennis Kaarsemaker, Eric Brine, Father Chrysostomos, Florian Ragwitz, Frank Wiegand, Gene Sullivan, George Greer, Gerard Goossen, Gisle Aas, Goro Fuji, Graham Barr, H.Merijn Brand, Harmen, Hugo van der Sanden, James E Keenan, James Mastros, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Jim Cromie, John Peacock, Jos Boumans, Josh ben Jore, Karl Williamson, Kevin Ryde, Leon Brocard, Lubomir Rintel, Maik Hentsche, Marcus Holland-Moritz, Matt Johnson, Matt S Trout, Max Maischein, Michael Breen, Michael G Schwern, Moritz Lenz, Nga Tang Chan, Nicholas Clark, Nick Cleaton, Nick Johnston, Niko Tyni, Offer Kaye, Paul Marquess, Philip Hazel, Philippe Bruhat, Rafael Garcia-Suarez, Rainer Tammer, Reini Urban, Ricardo Signes, Richard Soderberg, Robin Barker, Ruslan Zakirov, Salvador Fandino, Salvador Ortiz Garcia, Shlomi Fish, Sinan Unur, Sisyphus, Slaven Rezic, Steffen Mueller, Stepan Kasal, Steve Hay, Steve Peters, Sullivan Beck, Tim Bunce, Todd Rinaldo, Tom Christiansen, Tom Hukins, Tony Cook, Vincent Pit, Yuval Kogman, Yves Orton, Zefram, brian d foy, chromatic, kmx, Ævar Arnfjörð Bjarmason
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5132delta - what is new for perl v5.13.2
This document describes differences between the 5.13.2 release and the 5.13.1 release.
If you are upgrading from an earlier release such as 5.10, first read "p5120-NAME", which describes differences between 5.10 and 5.12.
The change in behaviour in 5.13.1 of localising tied scalar values has been reverted to the existing 5.12.0 and earlier behaviour (the change for arrays and hashes remains).
Several long-standing typos and naming confusions in Policy_sh.SH have been fixed, standardizing on the variable names used in config.sh.
This will change the behavior of Policy.sh if you happen to have been accidentally relying on the Policy.sh incorrect behavior. We'd appreciate feedback from anyone using Policy.sh to be sure nothing is broken by this change (c1bd23).
defined %Foo::
now always returns true, even when no symbols have yet been defined in that package.
This is a side effect of removing a special case kludge in the tokeniser, added for 5.10.0, to hide side effects of changes to the internal storage of hashes that to drastically reduce their memory usage overhead.
Calling defined on a stash has been deprecated since 5.6.0, warned on lexicals since 5.6.0, and has warned for stashes (and other package variables) since 5.12.0. defined %hash
has always exposed an implementation detail - emptying a hash by deleting all entries from it does not make defined %hash
false, hence defined %hash
is not valid code to determine whether an arbitrary hash is empty. Instead, use the behaviour that an empty %hash
always returns false in a scalar context.
The substitution operator now supports a /r
option that copies the input variable, carries out the substitution on the copy and returns the result. The original remains unmodified.
my $old = 'cat'; my $new = $old =~ s/cat/dog/r; # $old is 'cat' and $new is 'dog'
This is particularly useful with map
. See perlop for more examples (4f4d75, 000c65).
A package declaration can now contain a code block, in which case the declaration is in scope only inside that block. So package Foo { ... }
is precisely equivalent to { package Foo; ... }
. It also works with a version number in the declaration, as in package Foo 1.2 { ... }
. See perlfunc (434da3..36f77d, 702646).
Modules that create threads should now create CLONE_PARAMS
structures by calling the new function Perl_clone_params_new()
, and free them with Perl_clone_params_del()
. This will ensure compatibility with any future changes to the internals of the CLONE_PARAMS
structure layout, and that it is correctly allocated and initialised.
perl -h used to mark the -w option as recommended; since this option is far less useful than it used to be due to lexical 'use warnings' and since perl -h is primary a list and brief explanation of the command line switches, the recommendation has now been removed (60eaec).
Locale::Country, Locale::Language and Locale::Currency were updated from 3.12 to 3.13 of the Locale-Codes distribution to include locale code changes (e1137b).
Added new methods ->down_nb() and ->down_force() at the suggestion of Rick Garlick.
Refactored methods to skip argument validation when no argument is supplied.
(04febe, f06daa)
(742adb)
Hash::Util now enables "no warnings 'uninitialized'" to suppress spurious warnings from undefined hash values (RT #74280).
The 'no 5.13.2' or similar form is now correctly handled by B::Deparse.
getsockopt and setsockopt are now documented.
B::Concise marks rv2sv, rv2av and rv2hv ops with the new OPpDEREF flag as "DREFed".
An extra stanza was added explaining behaviours when the copy destination already exists and is a directory.
Fixes were made to VMS::DCLsym, mro, Search::Dist, B::t::OptreeCheck and UNIVERSAL.
perlebcdic.pod contains a helpful table to use in tr/// to convert between EBCDIC and Latin1/ASCII. Unfortunately, the table was the inverse of the one it describes, though the code that used the table worked correctly for the specific example given.
The table has been changed to its inverse, and the sample code changed to correspond, as this is easier for the person trying to follow the instructions since deriving the old table is somewhat more complicated.
The table has also been changed to hex from octal, as that is more the norm these days, and the recipes in the pod altered to print out leading zeros to make all the values the same length, as the table that they can generate has them (5f26d5).
perlunicode.pod now contains an explanation of how to override, mangle and otherwise tweak the way perl handles upper, lower and other case conversions on unicode data, and how to provide scoped changes to alter one's own code's behaviour without stomping on anybody else (71648f).
$# and $* were both disabled as of perl5 version 10; this release adds documentation to that effect, a description of the results of continuing to try and use them, and a note explaining that $# can also function as a sigil in the $#array form (7f315d2).
This was already true but it's now Officially Stated For The Record (51eec7).
This module hasn't been updated since 1996 so we can't recommend it any more (83918a).
The FAQ has been updated to commit 37550b8f812e591bcd0dd869d61677dac5bda92c from the perlfaq repository at git@github.com:briandfoy/perlfaq.git
Only allocate entries for @_ on demand - this not only saves memory per subroutine defined but should hopefully improve COW behaviour (77bac2).
The internal structures of threading now make fewer API calls and fewer allocations, resulting in noticeably smaller object code. Additionally, many thread context checks have been deferred so that they're only done when required (although this is only possible for non-debugging builds).
xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash and on some systems will cause struct xpvhv to become cache aligned. To avoid this memory saving causing a slowdown elsewhere, boolean use of HvFILL now calls HvTOTALKEYS instead (which is equivalent) - so while the fill data when actually required is now calculated on demand, the cases when this needs to be done should be few and far between (f4431c .. fcd245).
The order of structure elements in SV bodies has changed. Effectively, the NV slot has swapped location with STASH and MAGIC. As all access to SV members is via macros, this should be completely transparent. This change allows the space saving for PVHVs documented above, and may reduce the memory allocation needed for PVIVs on some architectures.
The foldEQ_utf8 API function for case-insensitive comparison of strings (which is used heavily by the regexp engine) was substantially refactored and optimised - and its documentation much improved as a free bonus gift (8b3587, e6226b).
The @EXPORT_FAIL AV is no longer created unless required, hence neither is the typeglob backing it - this saves about 200 bytes per Exporter using package that doesn't use this functionality.
Fix CCINCDIR and CCLIBDIR for mingw64 cross compiler to correctly be under $(CCHOME)\mingw\include and \lib rather than immediately below $(CCHOME).
This means the 'incpath', 'libpth', 'ldflags', 'lddlflags' and 'ldflags_nolargefiles' values in Config.pm and Config_heavy.pl are now set correctly (23ae7f).
find_rundefsvoffset
function has been deprecated. It appeared that its design was insufficient to reliably get the lexical $_
at run-time.
Use the new find_rundefsv
function or the UNDERBAR
macro instead. They directly return the right SV representing $_
, whether it's lexical or dynamic (789bd8 .. 03d5bc).
SvNV_nomg
, sv_2nv_flags
, find_rundefsv
.UNDERBAR
macro now calls find_rundefsv
. dUNDERBAR
is now a noop but should still be used to ensure past and future compatibility.The following items are now deprecated.
m/foo/sand $bar
will still be parsed as m/foo/s and $bar
but will issue a warning.OpenBSD > 3.7 has a new malloc implementation which is mmap based and as such can release memory back to the OS; however for perl using this malloc causes a substantial slowdown so we now default to using perl's malloc instead (RT #75742) (9b58b5).
Perl 5.13.2 represents thirty days of development since Perl 5.13.1 (and two days of waiting around while the release manager remembered where he left his brain) and contains 3685 lines of changes across 194 files from 30 authors and committers.
Thank you to the following for contributing to this release:
Abigail, Andreas J. Koenig, Chas. Owens, Chris 'BinGOs' Williams, Craig A. Berry, David Caldwell, David Golden, David Mitchell, Father Chrysostomos, George Greer, H.Merijn Brand, Jerry D. Hedden, Karl Williamson, Maik Hentsche, Matt S Trout, Nicholas Clark, Rafael Garcia-Suarez, Ricardo Signes, Salvador Fandino, Salvador Ortiz Garcia, Shlomi Fish, Sinan Unur, Sisyphus, Slaven Rezic, Sullivan Beck, Tony Cook, Vincent Pit, Zefram, brian d foy, Ævar Arnfjörð Bjarmason
Your humble release manager would like to specifically call out Karl Williamson for making the tests a better place to be, and Shlomi Fish for a passel of tiny incremental docfixes of the sort that don't get made often enough.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5131delta - what is new for perl v5.13.1
This document describes differences between the 5.13.0 release and the 5.13.1 release.
If you are upgrading from an earlier release such as 5.10, first read "p5120-NAME", which describes differences between 5.10 and 5.12.
\cX
"The backslash-c construct was designed as a way of specifying non-printable characters, but there were no restrictions (on ASCII platforms) on what the character following the c
could be. Now, that character must be one of the ASCII characters.
In the following:
tie @a, ...; { local @a; # here, @a is a now a new, untied array } # here, @a refers again to the old, tied array
The new local array used to be made tied too, which was fairly pointless, and has now been fixed. This fix could however potentially cause a change in behaviour of some code.
given
return valuesStarting from this release, given
blocks returns the last evaluated expression, or an empty list if the block was exited by break
. Thus you can now write:
my $type = do { given ($num) { break when undef; 'integer' when /^[+-]?[0-9]+$/; 'float' when /^[+-]?[0-9]+(?:\.[0-9]+)?$/; 'unknown'; } };
See "Return value" in perlsyn for details.
Several changes have been made to the way die
, warn
, and $@
behave, in order to make them more reliable and consistent.
When an exception is thrown inside an eval
, the exception is no longer at risk of being clobbered by code running during unwinding (e.g., destructors). Previously, the exception was written into $@
early in the throwing process, and would be overwritten if eval
was used internally in the destructor for an object that had to be freed while exiting from the outer eval
. Now the exception is written into $@
last thing before exiting the outer eval
, so the code running immediately thereafter can rely on the value in $@
correctly corresponding to that eval
.
Likewise, a local $@
inside an eval
will no longer clobber any exception thrown in its scope. Previously, the restoration of $@
upon unwinding would overwrite any exception being thrown. Now the exception gets to the eval
anyway. So local $@
is safe inside an eval
, albeit of rather limited use.
Exceptions thrown from object destructors no longer modify the $@
of the surrounding context. (If the surrounding context was exception unwinding, this used to be another way to clobber the exception being thrown. Due to the above change it no longer has that significance, but there are other situations where $@
is significant.) Previously such an exception was sometimes emitted as a warning, and then either string-appended to the surrounding $@
or completely replaced the surrounding $@
, depending on whether that exception and the surrounding $@
were strings or objects. Now, an exception in this situation is always emitted as a warning, leaving the surrounding $@
untouched. In addition to object destructors, this also affects any function call performed by XS code using the G_KEEPERR
flag.
$@
is also no longer used as an internal temporary variable when preparing to die
. Previously it was internally necessary to put any exception object (any non-string exception) into $@
first, before it could be used as an exception. (The C API still offers the old option, so an XS module might still clobber $@
in the old way.) This change together with the foregoing means that, in various places, $@
may be observed to contain its previously-assigned value, rather than having been overwritten by recent exception-related activity.
Warnings for warn
can now be objects, in the same way as exceptions for die
. If an object-based warning gets the default handling, of writing to standard error, it will of course still be stringified along the way. But a $SIG{__WARN__}
handler will now receive an object-based warning as an object, where previously it was passed the result of stringifying the object.
Errno
The implementation of Errno
has been refactored to use about 55% less memory. There should be no user-visible changes.
.pl
librariesThese historical libraries have been minimally modified to avoid using $[
. This is to prepare them for the deprecation of $[
.
B::Deparse
A bug has been fixed when deparsing a nextstate op that has both a change of package (relative to the previous nextstate), or a change of %^H
or other state, and a label. Previously the label was emitted first, leading to syntactically invalid output because a label is not permitted immediately before a package declaration, BEGIN block, or some other things. Now the label is emitted last.
The following modules have been removed from the core distribution, and if needed should be installed from CPAN instead.
Class::ISA
Pod::Plainer
Switch
The removal of Shell
has been deferred until after 5.14, as the implementation of Shell
shipped with 5.12.0 did not correctly issue the warning that it was to be removed from core.
perlgpl has been updated to contain GPL version 1, as is included in the README distributed with perl.
die
has changed how it identifies the target stack frame. This now uses a separate variable PL_restartjmpenv
, where previously it relied on the blk_eval.cur_top_env
pointer in the eval
context frame that has nominally just been discarded. This change means that code running during various stages of Perl-level unwinding no longer needs to take care to avoid destroying the ghost frame.Perl_ptr_table_store
allocated memory from the same arena system as SV
bodies and HE
s, with freed memory remaining bound to those arenas until interpreter exit. Now it allocates memory from arenas private to the specific pointer table, and that memory is returned to the system when Perl_ptr_table_free
is called. Additionally, allocation and release are both less CPU intensive.The following items are now deprecated.
Perl_ptr_table_clear
Perl_ptr_table_clear
is no longer part of Perl's public API. Calling it now generates a deprecation warning, and it will be removed in a future release.
Perl 5.13.1 represents thirty days of development since Perl 5.13.0 and contains 15390 lines of changes across 289 files from 34 authors and committers.
Thank you to the following for contributing to this release:
Ævar Arnfjörð Bjarmason, Arkturuz, Chris 'BinGOs' Williams, Craig A. Berry, Curtis Jewell, Dan Dascalescu, David Golden, David Mitchell, Father Chrysostomos, Gene Sullivan, gfx, Gisle Aas, H.Merijn Brand, James E Keenan, James Mastros, Jan Dubois, Jesse Vincent, Karl Williamson, Leon Brocard, Lubomir Rintel (GoodData), Nicholas Clark, Philippe Bruhat (BooK), Rafael Garcia-Suarez, Rainer Tammer, Ricardo Signes, Richard Soderberg, Robin Barker, Ruslan Zakirov, Steffen Mueller, Todd Rinaldo, Tony Cook, Vincent Pit, Zefram
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5130delta - what is new for perl v5.13.0
This document describes differences between the 5.12.0 release and the 5.13.0 release.
If you are upgrading from an earlier release such as 5.10.0, first read "p5120-NAME", which describes differences between 5.10.0 and 5.12.0.
Signal dispatch has been moved from the runloop into control ops. This should give a few percent speed increase, and eliminates almost all of the speed penalty caused by the introduction of "safe signals" in 5.8.0. Signals should still be dispatched within the same statement as they were previously - if this is not the case, or it is possible to create uninterruptible loops, this is a bug, and reports are encouraged of how to recreate such issues.
$0
sets the legacy process name with prctl()
on LinuxOn Linux the legacy process name will be set with prctl(2), in addition to altering the POSIX name via argv[0]
as perl has done since version 4.000. Now system utilities that read the legacy process name such as ps, top and killall will recognize the name you set when assigning to $0
. The string you supply will be cut off at 16 bytes, this is a limitation imposed by Linux.
Additional two OPs are not added anymore into op tree for shift and pop calls without argument (when it works on @_
). Makes shift;
5% faster over shift @_;
on not threaded perl and 25% faster on threaded.
Updated to version 3.49.
Updated to version 2.126.
Updated to 3.09.
Updated to version 1.77
Updated to version 1.33
Allow building on AIX 4.2.
Perl 5.13.0 represents eight days of development since Perl 5.12.0 and contains 3,766 lines of changes across 151 files from 29 authors and committers.
Thank you to the following for contributing to this release:
Ævar Arnfjörð Bjarmason, Alex Vandiver, Chris Williams, chromatic, Craig A. Berry, David Golden, David Mitchell, Eric Brine, Father Chrysostomos, Florian Ragwitz, Frank Wiegand, Gisle Aas, H.Merijn Brand, Hugo van der Sanden, Jesse Vincent, Josh ben Jore, Karl Williamson, Leon Brocard, Michael G Schwern, Michael G. Schwern, Nga Tang Chan, Nicholas Clark, Niko Tyni, Rafael Garcia-Suarez, Ricardo Signes, Robin Barker, Slaven Rezic, Steffen Mueller, Zefram.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perldelta - what is new for perl v5.12.3
This document describes differences between the 5.12.2 release and the 5.12.3 release.
If you are upgrading from an earlier release such as 5.12.1, first read "p5122-NAME", which describes differences between 5.12.1 and 5.12.2. The major changes made in 5.12.0 are described in "p5120-NAME".
There are no changes intentionally incompatible with 5.12.2. If any exist, they are bugs and reports are welcome.
keys
, values
work on arraysYou can now use the keys
, values
, each
builtin functions on arrays (previously you could only use them on hashes). See perlfunc for details. This is actually a change introduced in perl 5.12.0, but it was missed from that release's perldelta.
"no VERSION" will now correctly deparse with B::Deparse, as will certain constant expressions.
Module::Build should be more reliably pass its tests under cygwin.
Lvalue subroutines are again able to return copy-on-write scalars. This had been broken since version 5.10.0.
A separate DTrace is now build for miniperl, which means that perl can be compiled with -Dusedtrace on Solaris again.
A number of regressions on VMS have been fixed. In addition to minor cleanup of questionable expressions in vms.c, file permissions should no longer be garbled by the PerlIO layer, and spurious record boundaries should no longer be introduced by the PerlIO layer during output.
For more details and discussion on the latter, see:
http://www.nntp.perl.org/group/perl.vmsperl/2010/11/msg15419.html
A few very small changes were made to the build process on VOS to better support the platform. Longer-than-32-character filenames are now supported on OpenVOS, and build properly without IPv6 support.
Perl 5.12.3 represents approximately four months of development since Perl 5.12.2 and contains approximately 2500 lines of changes across 54 files from 16 authors.
Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.12.3:
Craig A. Berry, David Golden, David Leadbeater, Father Chrysostomos, Florian Ragwitz, Jesse Vincent, Karl Williamson, Nick Johnston, Nicolas Kaiser, Paul Green, Rafael Garcia-Suarez, Rainer Tammer, Ricardo Signes, Steffen Mueller, Zsbán Ambrus, Ævar Arnfjörð Bjarmason
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5122delta - what is new for perl v5.12.2
This document describes differences between the 5.12.1 release and the 5.12.2 release.
If you are upgrading from an earlier major version, such as 5.10.1, first read "p5120-NAME", which describes differences between 5.10.1 and 5.12.0, as well as "p5121-NAME", which describes earlier changes in the 5.12 stable release series.
There are no changes intentionally incompatible with 5.12.1. If any exist, they are bugs and reports are welcome.
Other than the bug fixes listed below, there should be no user-visible changes to the core language in this release.
This release does not introduce any new modules or pragmata.
In the previous release, no VERSION;
statements triggered a bug which could cause feature bundles to be loaded and strict mode to be enabled unintentionally.
Carp
Upgraded from version 1.16 to 1.17.
Carp now detects incomplete caller() overrides and avoids using bogus @DB::args
. To provide backtraces, Carp relies on particular behaviour of the caller built-in. Carp now detects if other code has overridden this with an incomplete implementation, and modifies its backtrace accordingly. Previously incomplete overrides would cause incorrect values in backtraces (best case), or obscure fatal errors (worst case)
This fixes certain cases of Bizarre copy of ARRAY
caused by modules overriding caller()
incorrectly.
CPANPLUS
A patch to cpanp-run-perl has been backported from CPANPLUS 0.9004
. This resolves RT #55964 and RT #57106, both of which related to failures to install distributions that use Module::Install::DSL
.
File::Glob
A regression which caused a failure to find CORE::GLOBAL::glob
after loading File::Glob
to crash has been fixed. Now, it correctly falls back to external globbing via pp_glob
.
File::Copy
File::Copy::copy(FILE, DIR)
is now documented.
File::Spec
Upgraded from version 3.31 to 3.31_01.
Several portability fixes were made in File::Spec::VMS
: a colon is now recognized as a delimiter in native filespecs; caret-escaped delimiters are recognized for better handling of extended filespecs; catpath()
returns an empty directory rather than the current directory if the input directory name is empty; abs2rel()
properly handles Unix-style input.
-d
and -v
options.getsockopt()
and setsockopt()
have been documented.$#
and $*
, two special variables that were removed in earlier versions of Perl have been documented.briandfoy/perlfaq
branch of the Perl repository at git://perl5.git.perl.org/perl.git.d_u32align
configuration probe on ARM has been fixed.incompatible operand types
" error in ternary expressions when building with clang
has been fixed.File::Copy
tests on partitions it detects to be mounted as nosuid
.T_PRTOBJ
default typemap has been fixed.@DB::args
has been fixed.unpack()
now handles scalar context correctly for %32H
and %32u
, fixing a potential crash. split()
would crash because the third item on the stack wasn't the regular expression it expected. unpack("%2H", ...)
would return both the unpacked result and the checksum on the stack, as would unpack("%2u", ...)
. [perl #73814]free()
in pp_require when there are CODEREFs in @INC
.Unknown error
" messages when "call_sv(code, G_EVAL)
" is called from an XS destructor has been fixed.open $fh, '>' \$buffer
feature now supports get/set magic and thus tied buffers correctly.pp_getc
, pp_tell
, and pp_eof
opcodes now make room on the stack for their return values in cases where no argument was passed in.Malformed UTF-8 character (fatal)
error. This should no longer occur. See [perl #75680]incpath
, libpth
, ldflags
, lddlflags
and ldflags_nolargefiles
values in Config.pm and Config_heavy.pl were not previously being set correctly because, with that compiler, the include and lib directories are not immediately below $(CCHOME)
.Perl_rename()
due to a double allocation has been fixed.vms_fid_to_name()
(used by realpath()
and realname()
) has been fixed.Perl 5.12.2 represents approximately three months of development since Perl 5.12.1 and contains approximately 2,000 lines of changes across 100 files from 36 authors.
Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.12.2:
Abigail, Ævar Arnfjörð Bjarmason, Ben Morrow, brian d foy, Brian Phillips, Chas. Owens, Chris 'BinGOs' Williams, Chris Williams, Craig A. Berry, Curtis Jewell, Dan Dascalescu, David Golden, David Mitchell, Father Chrysostomos, Florian Ragwitz, George Greer, H.Merijn Brand, Jan Dubois, Jesse Vincent, Jim Cromie, Karl Williamson, Lars Dɪᴇᴄᴋá´á´¡ 迪拉斯, Leon Brocard, Maik Hentsche, Matt S Trout, Nicholas Clark, Rafael Garcia-Suarez, Rainer Tammer, Ricardo Signes, Salvador Ortiz Garcia, Sisyphus, Slaven Rezic, Steffen Mueller, Tony Cook, Vincent Pit and Yves Orton.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5121delta - what is new for perl v5.12.1
This document describes differences between the 5.12.0 release and the 5.12.1 release.
If you are upgrading from an earlier release such as 5.10.1, first read "p5120-NAME", which describes differences between 5.10.1 and 5.12.0.
There are no changes intentionally incompatible with 5.12.0. If any incompatibilities with 5.12.0 exist, they are bugs. Please report them.
Other than the bug fixes listed below, there should be no user-visible changes to the core language in this release.
is_strict
and is_lax
from version.
These were being exported with a wrapper that treated them as method calls, which caused them to fail. They are just functions, are documented as such, and should never be subclassed, so this patch just exports them directly as functions without the wrapper.
reval()
and rdo()
.:=
to perldiag.podsleep() time on Win32 may be rounded down to multiple of the clock tick interval.
Term::ReadLine::Gnu
is installed.See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=74542
See also: http://rt.cpan.org/Public/Bug/Display.html?id=55049
fputc()
or fputs()
: on Windows could cause an error due to their arguments being swapped.
See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=72704
See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=74006
See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=74978
See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=74114
See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=74290
See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=72998
The changes required work around AIX 4.2s' lack of support for IPv6, and limited support for POSIX sigaction()
.
DCL symbol length was limited to 1K up until about seven years or so ago, but there was no particularly deep reason to prevent those older systems from configuring and building Perl.
-Uuseperlio
build on VMS.
We were checking a variable that doesn't exist in the non-default case of disabling perlio. Now we only look at it when it exists.
Formerly it only worked if you went through all the questions interactively and explicitly answered no.
List::Util::first
misbehaves in the presence of a lexical $_
(typically introduced by my $_
or implicitly by given
). The variable which gets set for each iteration is the package variable $_
, not the lexical $_
.
A similar issue may occur in other modules that provide functions which take a block as their first argument, like
foo { ... $_ ...} list
See also: http://rt.perl.org/rt3/Public/Bug/Display.html?id=67694
Module::Load::Conditional
and version
have an unfortunate interaction which can cause CPANPLUS
to crash when it encounters an unparseable version string. Upgrading to CPANPLUS
0.9004 or Module::Load::Conditional
0.38 from CPAN will resolve this issue.Perl 5.12.1 represents approximately four weeks of development since Perl 5.12.0 and contains approximately 4,000 lines of changes across 142 files from 28 authors.
Perl continues to flourish into its third decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.12.1:
Ævar Arnfjörð Bjarmason, Chris Williams, chromatic, Craig A. Berry, David Golden, Father Chrysostomos, Florian Ragwitz, Frank Wiegand, Gene Sullivan, Goro Fuji, H.Merijn Brand, James E Keenan, Jan Dubois, Jesse Vincent, Josh ben Jore, Karl Williamson, Leon Brocard, Michael Schwern, Nga Tang Chan, Nicholas Clark, Niko Tyni, Philippe Bruhat, Rafael Garcia-Suarez, Ricardo Signes, Steffen Mueller, Todd Rinaldo, Vincent Pit and Zefram.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5120delta - what is new for perl v5.12.0
This document describes differences between the 5.10.0 release and the 5.12.0 release.
Many of the bug fixes in 5.12.0 are already included in the 5.10.1 maintenance release.
You can see the list of those changes in the 5.10.1 release notes ("p5101-NAME").
package NAME VERSION
syntaxThis new syntax allows a module author to set the $VERSION of a namespace when the namespace is declared with 'package'. It eliminates the need for our $VERSION = ...
and similar constructs. E.g.
package Foo::Bar 1.23; # $Foo::Bar::VERSION == 1.23
There are several advantages to this:
$VERSION
is parsed in exactly the same way as use NAME VERSION
$VERSION
is set at compile time$VERSION
is a version object that provides proper overloading of comparison operators so comparing $VERSION
to decimal (1.23) or dotted-decimal (v1.2.3) version numbers works correctly.$VERSION = ...
and eval $VERSION
cluttereval
the way MM->parse_version does for $VERSION = ...
It does not break old code with only package NAME
, but code that uses package NAME VERSION
will need to be restricted to perl 5.12.0 or newer This is analogous to the change to open
from two-args to three-args. Users requiring the latest Perl will benefit, and perhaps after several years, it will become a standard practice.
However, package NAME VERSION
requires a new, 'strict' version number format. See "p5120-Version number formats" for details.
...
operatorA new operator, ...
, nicknamed the Yada Yada operator, has been added. It is intended to mark placeholder code that is not yet implemented. See "Yada Yada Operator" in perlop.
Using the use VERSION
syntax with a version number greater or equal to 5.11.0 will lexically enable strictures just like use strict
would do (in addition to enabling features.) The following:
use 5.12.0;
means:
use strict; use feature ':5.12';
Perl 5.12 comes with Unicode 5.2, the latest version available to us at the time of release. This version of Unicode was released in October 2009. See http://www.unicode.org/versions/Unicode5.2.0 for further details about what's changed in this version of the standard. See perlunicode for instructions on installing and using other versions of Unicode.
Additionally, Perl's developers have significantly improved Perl's Unicode implementation. For full details, see "p5120-Unicode overhaul" below.
Perl's core time-related functions are now Y2038 compliant. (It may not mean much to you, but your kids will love it!)
It is now possible to overload the qr//
operator, that is, conversion to regexp, like it was already possible to overload conversion to boolean, string or number of objects. It is invoked when an object appears on the right hand side of the =~
operator or when it is interpolated into a regexp. See overload.
Extension modules can now cleanly hook into the Perl parser to define new kinds of keyword-headed expression and compound statement. The syntax following the keyword is defined entirely by the extension. This allow a completely non-Perl sublanguage to be parsed inline, with the correct ops cleanly generated.
See "PL_keyword_plugin" in perlapi for the mechanism. The Perl core source distribution also includes a new module XS::APItest::KeywordRPN, which implements reverse Polish notation arithmetic via pluggable keywords. This module is mainly used for test purposes, and is not normally installed, but also serves as an example of how to use the new mechanism.
Perl's developers consider this feature to be experimental. We may remove it or change it in a backwards-incompatible way in Perl 5.14.
The lowest layers of the lexer and parts of the pad system now have C APIs available to XS extensions. These are necessary to support proper use of pluggable keywords, but have other uses too. The new APIs are experimental, and only cover a small proportion of what would be necessary to take full advantage of the core's facilities in these areas. It is intended that the Perl 5.13 development cycle will see the addition of a full range of clean, supported interfaces.
Perl's developers consider this feature to be experimental. We may remove it or change it in a backwards-incompatible way in Perl 5.14.
Where an extension module hooks the creation of rv2cv ops to modify the subroutine lookup process, this now works correctly for bareword subroutine calls. This means that prototypes on subroutines referenced this way will be processed correctly. (Previously bareword subroutine names were initially looked up, for parsing purposes, by an unhookable mechanism, so extensions could only properly influence subroutine names that appeared with an &
sigil.)
As of Perl 5.12.0 there is a new interface for plugging and using method resolution orders other than the default linear depth first search. The C3 method resolution order added in 5.10.0 has been re-implemented as a plugin, without changing its Perl-space interface. See perlmroapi for more information.
\N
experimental regex escapePerl now supports \N
, a new regex escape which you can think of as the inverse of \n
. It will match any character that is not a newline, independently from the presence or absence of the single line match modifier /s
. It is not usable within a character class. \N{3}
means to match 3 non-newlines; \N{5,}
means to match at least 5. \N{NAME}
still means the character or sequence named NAME
, but NAME
no longer can be things like 3
, or 5,
.
This will break a custom charnames translator which allows numbers for character names, as \N{3}
will now mean to match 3 non-newline characters, and not the character whose name is 3
. (No name defined by the Unicode standard is a number, so only custom translators might be affected.)
Perl's developers are somewhat concerned about possible user confusion with the existing \N{...}
construct which matches characters by their Unicode name. Consequently, this feature is experimental. We may remove it or change it in a backwards-incompatible way in Perl 5.14.
Perl now has some support for DTrace. See "DTrace support" in INSTALL.
configure_requires
in CPAN module metadataBoth CPAN
and CPANPLUS
now support the configure_requires
keyword in the META.yml metadata file included in most recent CPAN distributions. This allows distribution authors to specify configuration prerequisites that must be installed before running Makefile.PL or Build.PL.
See the documentation for ExtUtils::MakeMaker
or Module::Build
for more on how to specify configure_requires
when creating a distribution for CPAN.
each
, keys
, values
are now more flexibleThe each
, keys
, values
function can now operate on arrays.
when
as a statement modifierwhen
is now allowed to be used as a statement modifier.
$,
flexibilityThe variable $,
may now be tied.
// now behaves like || in when clauses
You can now set -W
from the PERL5OPT
environment variable
delete local
delete local
now allows you to locally delete a hash entry.
Abstract namespace sockets are Linux-specific socket type that live in AF_UNIX family, slightly abusing it to be able to use arbitrary character arrays as addresses: They start with nul byte and are not terminated by nul byte, but with the length passed to the socket() system call.
The 32-bit limit on substr
arguments has now been removed. The full range of the system's signed and unsigned integers is now available for the pos
and len
arguments.
Over the years, Perl's developers have deprecated a number of language features for a variety of reasons. Perl now defaults to issuing a warning if a deprecated language feature is used. Many of the deprecations Perl now warns you about have been deprecated for many years. You can find a list of what was deprecated in a given release of Perl in the perl5xxdelta.pod
file for that release.
To disable this feature in a given lexical scope, you should use no warnings 'deprecated';
For information about which language features are deprecated and explanations of various deprecation warnings, please see perldiag. See "p5120-Deprecations" below for the list of features and modules Perl's developers have deprecated as part of this release.
Acceptable version number formats have been formalized into "strict" and "lax" rules. package NAME VERSION
takes a strict version number. UNIVERSAL::VERSION
and the version object constructors take lax version numbers. Providing an invalid version will result in a fatal error. The version argument in use NAME VERSION
is first parsed as a numeric literal or v-string and then passed to UNIVERSAL::VERSION
(and must then pass the "lax" format test).
These formats are documented fully in the version module. To a first approximation, a "strict" version number is a positive decimal number (integer or decimal-fraction) without exponentiation or else a dotted-decimal v-string with a leading 'v' character and at least three components. A "lax" version number allows v-strings with fewer than three components or without a leading 'v'. Under "lax" rules, both decimal and dotted-decimal versions may have a trailing "alpha" component separated by an underscore character after a fractional or dotted-decimal component.
The version module adds version::is_strict
and version::is_lax
functions to check a scalar against these rules.
In @INC
, ARCHLIB
and PRIVLIB
now occur after after the current version's site_perl
and vendor_perl
. Modules installed into site_perl
and vendor_perl
will now be loaded in preference to those installed in ARCHLIB
and PRIVLIB
.
Internally, Perl now treats compiled regular expressions (such as those created with qr//
) as first class entities. Perl modules which serialize, deserialize or otherwise have deep interaction with Perl's internal data structures need to be updated for this change. Most affected CPAN modules have already been updated as of this writing.
The given
/when
switch statement handles complex statements better than Perl 5.10.0 did (These enhancements are also available in 5.10.1 and subsequent 5.10 releases.) There are two new cases where when
now interprets its argument as a boolean, instead of an expression to be used in a smart match:
The ..
and ...
flip-flop operators are now evaluated in boolean context, following their usual semantics; see "Range Operators" in perlop.
Note that, as in perl 5.10.0, when (1..10)
will not work to test whether a given value is an integer between 1 and 10; you should use when ([1..10])
instead (note the array reference).
However, contrary to 5.10.0, evaluating the flip-flop operators in boolean context ensures it can now be useful in a when()
, notably for implementing bistable conditions, like in:
when (/^=begin/ .. /^=end/) { # do something }
A compound expression involving the defined-or operator, as in when (expr1 // expr2)
, will be treated as boolean if the first expression is boolean. (This just extends the existing rule that applies to the regular or operator, as in when (expr1 || expr2)
.)
Since Perl 5.10.0, Perl's developers have made a number of changes to the smart match operator. These, of course, also alter the behaviour of the switch statements where smart matching is implicitly used. These changes were also made for the 5.10.1 release, and will remain in subsequent 5.10 releases.
The smart match operator ~~
is no longer commutative. The behaviour of a smart match now depends primarily on the type of its right hand argument. Moreover, its semantics have been adjusted for greater consistency or usefulness in several cases. While the general backwards compatibility is maintained, several changes must be noted:
%hash ~~ sub {}
and @array ~~ sub {}
now test that the subroutine returns a true value for each key of the hash (or element of the array), instead of passing the whole hash or array as a reference to the subroutine.~~
operator, but like any vulgar scalar.undef ~~ %hash
is always false (since undef
can't be a key in a hash). No implicit conversion to ""
is done (as was the case in perl 5.10.0).$scalar ~~ @array
now always distributes the smart match across the elements of the array. It's true if one element in @array verifies $scalar ~~ $element
. This is a generalization of the old behaviour that tested whether the array contained the scalar.The full dispatch table for the smart match operator is given in "Smart matching in detail" in perlsyn.
According to the rule of dispatch based on the rightmost argument type, when an object overloading ~~
appears on the right side of the operator, the overload routine will always be called (with a 3rd argument set to a true value, see overload.) However, when the object will appear on the left, the overload routine will be called only when the rightmost argument is a simple scalar. This way, distributivity of smart match across arrays is not broken, as well as the other behaviours with complex types (coderefs, hashes, regexes). Thus, writers of overloading routines for smart match mostly need to worry only with comparing against a scalar, and possibly with stringification overloading; the other common cases will be automatically handled consistently.
~~
will now refuse to work on objects that do not overload it (in order to avoid relying on the object's underlying structure). (However, if the object overloads the stringification or the numification operators, and if overload fallback is active, it will be used instead, as usual.)
IO::File
.
The previous behaviour was to bless Filehandles into FileHandle (an empty proxy class) if it was loaded into memory and otherwise to bless them into IO::Handle
.
use feature :5.10*
have changed slightly. See "p5120-Modules and Pragmata" for more information.perl -V
. See perlrepository for more information.Test::Harness
2.x to 3.x upgrade, the experimental Test::Harness::Straps
module has been removed. See "p5120-Modules and Pragmata" for more details.ExtUtils::MakeMaker
upgrade, the ExtUtils::MakeMaker::bytes
and ExtUtils::MakeMaker::vmsish
modules have been removed from this distribution.Module::CoreList
no longer contains the %:patchlevel
hash.length undef
now returns undef.This allows a build to complete with PERL_UNICODE set and a UTF-8 locale. Without this there's a bootstrapping problem, as miniperl can't load the UTF-8 components of the regexp engine, because they're not yet built.
-I...
, the split of $ENV{PERL5LIB}
, and ".
""#line XXX"
directive.foreach
may no longer be used as an attribute.Filter::cpp
can be used as an alternative.From time to time, Perl's developers find it necessary to deprecate features or modules we've previously shipped as part of the core distribution. We are well aware of the pain and frustration that a backwards-incompatible change to Perl can cause for developers building or maintaining software in Perl. You can be sure that when we deprecate a functionality or syntax, it isn't a choice we make lightly. Sometimes, we choose to deprecate functionality or syntax because it was found to be poorly designed or implemented. Sometimes, this is because they're holding back other features or causing performance problems. Sometimes, the reasons are more complex. Wherever possible, we try to keep deprecated functionality available to developers in its previous form for at least one major release. So long as a deprecated feature isn't actively disrupting our ability to maintain and extend Perl, we'll try to leave it in place as long as possible.
The following items are now deprecated:
suidperl
is no longer part of Perl. It used to provide a mechanism to emulate setuid permission bits on systems that don't support it properly.
:=
to mean an empty attribute listAn accident of Perl's parser meant that these constructions were all equivalent:
my $pi := 4; my $pi : = 4; my $pi : = 4;
with the :
being treated as the start of an attribute list, which ends before the =
. As whitespace is not significant here, all are parsed as an empty attribute list, hence all the above are equivalent to, and better written as
my $pi = 4;
because no attribute processing is done for an empty list.
As is, this meant that :=
cannot be used as a new token, without silently changing the meaning of existing code. Hence that particular form is now deprecated, and will become a syntax error. If it is absolutely necessary to have empty attribute lists (for example, because of a code generator) then avoid the warning by adding a space before the =
.
UNIVERSAL->import()
The method UNIVERSAL->import()
is now deprecated. Attempting to pass import arguments to a use UNIVERSAL
statement will result in a deprecation warning.
Using goto
to jump from an outer scope into an inner scope is now deprecated. This rare use case was causing problems in the implementation of scopes.
In \N{name}
, name can be just about anything. The standard Unicode names have a very limited domain, but a custom name translator could create names that are, for example, made up entirely of punctuation symbols. It is now deprecated to make names that don't begin with an alphabetic character, and aren't alphanumeric or contain other than a very few other characters, namely spaces, dashes, parentheses and colons. Because of the added meaning of \N
(See "p5120-\N
experimental regex escape"), names that look like curly brace -enclosed quantifiers won't work. For example, \N{3,4}
now means to match 3 to 4 non-newlines; before a custom name 3,4
could have been created.
The following modules will be removed from the core distribution in a future release, and should be installed from CPAN instead. Distributions on CPAN which require these should add them to their prerequisites. The core versions of these modules warnings will issue a deprecation warning.
If you ship a packaged version of Perl, either alone or as part of a larger system, then you should carefully consider the repercussions of core module deprecations. You may want to consider shipping your default build of Perl with packages for some or all deprecated modules which install into vendor
or site
perl library directories. This will inhibit the deprecation warnings.
Alternatively, you may want to consider patching lib/deprecate.pm to provide deprecation warnings specific to your packaging system or distribution of Perl, consistent with how your packaging system or distribution manages a staged transition from a release where the installation of a single package provides the given functionality, to a later release where the system administrator needs to know to install multiple packages to get that same functionality.
You can silence these deprecation warnings by installing the modules in question from CPAN. To install the latest version of all of them, just install Task::Deprecations::5_12
.
Switch is buggy and should be avoided. You may find Perl's new given
/when
feature a suitable replacement. See "Switch statements" in perlsyn for more information.
Perl_pmflag
is no longer part of Perl's public API. Calling it now generates a deprecation warning, and it will be removed in a future release. Although listed as part of the API, it was never documented, and only ever used in toke.c, and prior to 5.10, regcomp.c. In core, it has been replaced by a static function.
termcap.pl, tainted.pl, stat.pl, shellwords.pl, pwd.pl, open3.pl, open2.pl, newgetopt.pl, look.pl, find.pl, finddepth.pl, importenv.pl, hostname.pl, getopts.pl, getopt.pl, getcwd.pl, flush.pl, fastcwd.pl, exceptions.pl, ctime.pl, complete.pl, cacheout.pl, bigrat.pl, bigint.pl, bigfloat.pl, assert.pl, abbrev.pl, dotsh.pl, and timelocal.pl are all now deprecated. Earlier, Perl's developers intended to remove these libraries from Perl's core for the 5.14.0 release.
During final testing before the release of 5.12.0, several developers discovered current production code using these ancient libraries, some inside the Perl core itself. Accordingly, the pumpking granted them a stay of execution. They will begin to warn about their deprecation in the 5.14.0 release and will be removed in the 5.16.0 release.
Perl's developers have made a concerted effort to update Perl to be in sync with the latest Unicode standard. Changes for this include:
Perl can now handle every Unicode character property. New documentation, perluniprops, lists all available non-Unihan character properties. By default, perl does not expose Unihan, deprecated or Unicode-internal properties. See below for more details on these; there is also a section in the pod listing them, and explaining why they are not exposed.
Perl now fully supports the Unicode compound-style of using =
and :
in writing regular expressions: \p{property=value}
and \p{property:value}
(both of which mean the same thing).
Perl now fully supports the Unicode loose matching rules for text between the braces in \p{...}
constructs. In addition, Perl allows underscores between digits of numbers.
Perl now accepts all the Unicode-defined synonyms for properties and property values.
qr/\X/
, which matches a Unicode logical character, has been expanded to work better with various Asian languages. It now is defined as an extended grapheme cluster. (See http://www.unicode.org/reports/tr29/). Anything matched previously and that made sense will continue to be accepted. Additionally:
\X
will not break apart a CR LF
sequence.\X
will now match a sequence which includes the ZWJ
and ZWNJ
characters.\X
will now always match at least one character, including an initial mark. Marks generally come after a base character, but it is possible in Unicode to have them in isolation, and \X
will now handle that case, for example at the beginning of a line, or after a ZWSP
. And this is the part where \X
doesn't match the things that it used to that don't make sense. Formerly, for example, you could have the nonsensical case of an accented LF.\X
will now match a (Korean) Hangul syllable sequence, and the Thai and Lao exception cases.Otherwise, this change should be transparent for the non-affected languages.
\p{...}
matches using the Canonical_Combining_Class property were completely broken in previous releases of Perl. They should now work correctly.
Before Perl 5.12, the Unicode Decomposition_Type=Compat
property and a Perl extension had the same name, which led to neither matching all the correct values (with more than 100 mistakes in one, and several thousand in the other). The Perl extension has now been renamed to be Decomposition_Type=Noncanonical
(short: dt=noncanon
). It has the same meaning as was previously intended, namely the union of all the non-canonical Decomposition types, with Unicode Compat
being just one of those.
\p{Decomposition_Type=Canonical}
now includes the Hangul syllables.
\p{Uppercase}
and \p{Lowercase}
now work as the Unicode standard says they should. This means they each match a few more characters than they used to.
\p{Cntrl}
now matches the same characters as \p{Control}
. This means it no longer will match Private Use (gc=co), Surrogates (gc=cs), nor Format (gc=cf) code points. The Format code points represent the biggest possible problem. All but 36 of them are either officially deprecated or strongly discouraged from being used. Of those 36, likely the most widely used are the soft hyphen (U+00AD), and BOM, ZWSP, ZWNJ, WJ, and similar characters, plus bidirectional controls.
\p{Alpha}
now matches the same characters as \p{Alphabetic}
. Before 5.12, Perl's definition definition included a number of things that aren't really alpha (all marks) while omitting many that were. The definitions of \p{Alnum}
and \p{Word}
depend on Alpha's definition and have changed accordingly.
\p{Word}
no longer incorrectly matches non-word characters such as fractions.
\p{Print}
no longer matches the line control characters: Tab, LF, CR, FF, VT, and NEL. This brings it in line with standards and the documentation.
\p{XDigit}
now matches the same characters as \p{Hex_Digit}
. This means that in addition to the characters it currently matches, [A-Fa-f0-9]
, it will also match the 22 fullwidth equivalents, for example U+FF10: FULLWIDTH DIGIT ZERO.
The Numeric type property has been extended to include the Unihan characters.
There is a new Perl extension, the 'Present_In', or simply 'In', property. This is an extension of the Unicode Age property, but \p{In=5.0}
matches any code point whose usage has been determined as of Unicode version 5.0. The \p{Age=5.0}
only matches code points added in precisely version 5.0.
A number of properties now have the correct values for unassigned code points. The affected properties are Bidi_Class, East_Asian_Width, Joining_Type, Decomposition_Type, Hangul_Syllable_Type, Numeric_Type, and Line_Break.
The Default_Ignorable_Code_Point, ID_Continue, and ID_Start properties are now up to date with current Unicode definitions.
Earlier versions of Perl erroneously exposed certain properties that are supposed to be Unicode internal-only. Use of these in regular expressions will now generate, if enabled, a deprecation warning message. The 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.
It is now possible to change which Unicode properties Perl understands on a per-installation basis. As mentioned above, certain properties are turned off by default. These include all the Unihan properties (which should be accessible via the CPAN module Unicode::Unihan) and any deprecated or Unicode internal-only property that Perl has never exposed.
The generated files in the lib/unicore/To
directory are now more clearly marked as being stable, directly usable by applications. New hash entries in them give the format of the normal entries, which allows for easier machine parsing. Perl can generate files in this directory for any property, though most are suppressed. You can find instructions for changing which are written in perluniprops.
autodie
autodie
is a new lexically-scoped alternative for the Fatal
module. The bundled version is 2.06_01. Note that in this release, using a string eval when autodie
is in effect can cause the autodie behaviour to leak into the surrounding scope. See "BUGS" in autodie for more details.
Version 2.06_01 has been added to the Perl core.
Compress::Raw::Bzip2
Version 2.024 has been added to the Perl core.
overloading
overloading
allows you to lexically disable or enable overloading for some or all operations.
Version 0.001 has been added to the Perl core.
parent
parent
establishes an ISA relationship with base classes at compile time. It provides the key feature of base
without further unwanted behaviors.
Version 0.223 has been added to the Perl core.
Parse::CPAN::Meta
Version 1.40 has been added to the Perl core.
VMS::DCLsym
Version 1.03 has been added to the Perl core.
VMS::Stdio
Version 2.4 has been added to the Perl core.
XS::APItest::KeywordRPN
Version 0.003 has been added to the Perl core.
base
Upgraded from version 2.13 to 2.15.
bignum
Upgraded from version 0.22 to 0.23.
charnames
charnames
now contains the Unicode NameAliases.txt database file. This has the effect of adding some extra \N
character names that formerly wouldn't have been recognised; for example, "\N{LATIN CAPITAL LETTER GHA}"
.
Upgraded from version 1.06 to 1.07.
constant
Upgraded from version 1.13 to 1.20.
diagnostics
diagnostics
now supports %.0f formatting internally.
diagnostics
no longer suppresses Use of uninitialized value in range (or flip)
warnings. [perl #71204]
Upgraded from version 1.17 to 1.19.
feature
In feature
, the meaning of the :5.10
and :5.10.X
feature bundles has changed slightly. The last component, if any (i.e. X
) is simply ignored. This is predicated on the assumption that new features will not, in general, be added to maintenance releases. So :5.10
and :5.10.X
have identical effect. This is a change to the behaviour documented for 5.10.0.
feature
now includes the unicode_strings
feature:
use feature "unicode_strings";
This pragma turns on Unicode semantics for the case-changing operations (uc
, lc
, ucfirst
, lcfirst
) on strings that don't have the internal UTF-8 flag set, but that contain single-byte characters between 128 and 255.
Upgraded from version 1.11 to 1.16.
less
less
now includes the stash_name
method to allow subclasses of less
to pick where in %^H to store their stash.
Upgraded from version 0.02 to 0.03.
lib
Upgraded from version 0.5565 to 0.62.
mro
mro
is now implemented as an XS extension. The documented interface has not changed. Code relying on the implementation detail that some mro::
methods happened to be available at all times gets to "keep both pieces".
Upgraded from version 1.00 to 1.02.
overload
overload
now allow overloading of 'qr'.
Upgraded from version 1.06 to 1.10.
threads
Upgraded from version 1.67 to 1.75.
threads::shared
Upgraded from version 1.14 to 1.32.
version
version
now has support for "p5120-Version number formats" as described earlier in this document and in its own documentation.
Upgraded from version 0.74 to 0.82.
warnings
warnings
has a new warnings::fatal_enabled()
function. It also includes a new illegalproto
warning category. See also "p5120-New or Changed Diagnostics" for this change.
Upgraded from version 1.06 to 1.09.
Archive::Extract
Upgraded from version 0.24 to 0.38.
Archive::Tar
Upgraded from version 1.38 to 1.54.
Attribute::Handlers
Upgraded from version 0.79 to 0.87.
AutoLoader
Upgraded from version 5.63 to 5.70.
B::Concise
Upgraded from version 0.74 to 0.78.
B::Debug
Upgraded from version 1.05 to 1.12.
B::Deparse
Upgraded from version 0.83 to 0.96.
B::Lint
Upgraded from version 1.09 to 1.11_01.
CGI
Upgraded from version 3.29 to 3.48.
Class::ISA
Upgraded from version 0.33 to 0.36.
NOTE: Class::ISA
is deprecated and may be removed from a future version of Perl.
Compress::Raw::Zlib
Upgraded from version 2.008 to 2.024.
CPAN
Upgraded from version 1.9205 to 1.94_56.
CPANPLUS
Upgraded from version 0.84 to 0.90.
CPANPLUS::Dist::Build
Upgraded from version 0.06_02 to 0.46.
Data::Dumper
Upgraded from version 2.121_14 to 2.125.
DB_File
Upgraded from version 1.816_1 to 1.820.
Devel::PPPort
Upgraded from version 3.13 to 3.19.
Digest
Upgraded from version 1.15 to 1.16.
Digest::MD5
Upgraded from version 2.36_01 to 2.39.
Digest::SHA
Upgraded from version 5.45 to 5.47.
Encode
Upgraded from version 2.23 to 2.39.
Exporter
Upgraded from version 5.62 to 5.64_01.
ExtUtils::CBuilder
Upgraded from version 0.21 to 0.27.
ExtUtils::Command
Upgraded from version 1.13 to 1.16.
ExtUtils::Constant
Upgraded from version 0.2 to 0.22.
ExtUtils::Install
Upgraded from version 1.44 to 1.55.
ExtUtils::MakeMaker
Upgraded from version 6.42 to 6.56.
ExtUtils::Manifest
Upgraded from version 1.51_01 to 1.57.
ExtUtils::ParseXS
Upgraded from version 2.18_02 to 2.21.
File::Fetch
Upgraded from version 0.14 to 0.24.
File::Path
Upgraded from version 2.04 to 2.08_01.
File::Temp
Upgraded from version 0.18 to 0.22.
Filter::Simple
Upgraded from version 0.82 to 0.84.
Filter::Util::Call
Upgraded from version 1.07 to 1.08.
Getopt::Long
Upgraded from version 2.37 to 2.38.
IO
Upgraded from version 1.23_01 to 1.25_02.
IO::Zlib
Upgraded from version 1.07 to 1.10.
IPC::Cmd
Upgraded from version 0.40_1 to 0.54.
IPC::SysV
Upgraded from version 1.05 to 2.01.
Locale::Maketext
Upgraded from version 1.12 to 1.14.
Locale::Maketext::Simple
Upgraded from version 0.18 to 0.21.
Log::Message
Upgraded from version 0.01 to 0.02.
Log::Message::Simple
Upgraded from version 0.04 to 0.06.
Math::BigInt
Upgraded from version 1.88 to 1.89_01.
Math::BigInt::FastCalc
Upgraded from version 0.16 to 0.19.
Math::BigRat
Upgraded from version 0.21 to 0.24.
Math::Complex
Upgraded from version 1.37 to 1.56.
Memoize
Upgraded from version 1.01_02 to 1.01_03.
MIME::Base64
Upgraded from version 3.07_01 to 3.08.
Module::Build
Upgraded from version 0.2808_01 to 0.3603.
Module::CoreList
Upgraded from version 2.12 to 2.29.
Module::Load
Upgraded from version 0.12 to 0.16.
Module::Load::Conditional
Upgraded from version 0.22 to 0.34.
Module::Loaded
Upgraded from version 0.01 to 0.06.
Module::Pluggable
Upgraded from version 3.6 to 3.9.
Net::Ping
Upgraded from version 2.33 to 2.36.
NEXT
Upgraded from version 0.60_01 to 0.64.
Object::Accessor
Upgraded from version 0.32 to 0.36.
Package::Constants
Upgraded from version 0.01 to 0.02.
PerlIO
Upgraded from version 1.04 to 1.06.
Pod::Parser
Upgraded from version 1.35 to 1.37.
Pod::Perldoc
Upgraded from version 3.14_02 to 3.15_02.
Pod::Plainer
Upgraded from version 0.01 to 1.02.
NOTE: Pod::Plainer
is deprecated and may be removed from a future version of Perl.
Pod::Simple
Upgraded from version 3.05 to 3.13.
Safe
Upgraded from version 2.12 to 2.22.
SelfLoader
Upgraded from version 1.11 to 1.17.
Storable
Upgraded from version 2.18 to 2.22.
Switch
Upgraded from version 2.13 to 2.16.
NOTE: Switch
is deprecated and may be removed from a future version of Perl.
Sys::Syslog
Upgraded from version 0.22 to 0.27.
Term::ANSIColor
Upgraded from version 1.12 to 2.02.
Term::UI
Upgraded from version 0.18 to 0.20.
Test
Upgraded from version 1.25 to 1.25_02.
Test::Harness
Upgraded from version 2.64 to 3.17.
Test::Simple
Upgraded from version 0.72 to 0.94.
Text::Balanced
Upgraded from version 2.0.0 to 2.02.
Text::ParseWords
Upgraded from version 3.26 to 3.27.
Text::Soundex
Upgraded from version 3.03 to 3.03_01.
Thread::Queue
Upgraded from version 2.00 to 2.11.
Thread::Semaphore
Upgraded from version 2.01 to 2.09.
Tie::RefHash
Upgraded from version 1.37 to 1.38.
Time::HiRes
Upgraded from version 1.9711 to 1.9719.
Time::Local
Upgraded from version 1.18 to 1.1901_01.
Time::Piece
Upgraded from version 1.12 to 1.15.
Unicode::Collate
Upgraded from version 0.52 to 0.52_01.
Unicode::Normalize
Upgraded from version 1.02 to 1.03.
Win32
Upgraded from version 0.34 to 0.39.
Win32API::File
Upgraded from version 0.1001_01 to 0.1101.
XSLoader
Upgraded from version 0.08 to 0.10.
attrs
Removed from the Perl core. Prior version was 1.02.
CPAN::API::HOWTO
Removed from the Perl core. Prior version was 'undef'.
CPAN::DeferedCode
Removed from the Perl core. Prior version was 5.50.
CPANPLUS::inc
Removed from the Perl core. Prior version was 'undef'.
DCLsym
Removed from the Perl core. Prior version was 1.03.
ExtUtils::MakeMaker::bytes
Removed from the Perl core. Prior version was 6.42.
ExtUtils::MakeMaker::vmsish
Removed from the Perl core. Prior version was 6.42.
Stdio
Removed from the Perl core. Prior version was 2.3.
Test::Harness::Assert
Removed from the Perl core. Prior version was 0.02.
Test::Harness::Iterator
Removed from the Perl core. Prior version was 0.02.
Test::Harness::Point
Removed from the Perl core. Prior version was 0.01.
Test::Harness::Results
Removed from the Perl core. Prior version was 0.01.
Test::Harness::Straps
Removed from the Perl core. Prior version was 0.26_01.
Test::Harness::Util
Removed from the Perl core. Prior version was 0.01.
XSSymSet
Removed from the Perl core. Prior version was 1.1.
See "p5120-Deprecated Modules" above.
unless (EXPR) BLOCK else BLOCK
is now documented as valid, as is the syntax unless (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK
, although actually using the latter may not be the best idea for the readability of your source code.when()
treats specially most of the filetest operatorswhen
as a syntax modifier.pod/perlthrtut.pod is the same material reworked for ithreads.
With version objects, we need them to use MODULE VERSION syntax. This patch removes the deprecation notice.
Much of the remaining core documentation has been reviewed and edited for clarity, consistent use of language, and to fix the spelling of Tom Christiansen's name.
L<"section">
has been marked as deprecated.use
.$1
in perlvar.pod has been clarified.\N{U+code point}
is now documented.isa()
will often be faster.C3
Method Resolution Order has been optimised - linearisation for classes with single inheritance is 40% faster. Performance for multiple inheritance is unchanged.use locale
, the locale-relevant information is now cached on read-only values, such as the list returned by keys %hash
. This makes operations such as sort keys %hash
in the scope of use locale
much faster.DESTROY
methods are no longer called.Perl_sv_utf8_upgrade()
is now faster.keys
on empty hash is now faster.if (%foo)
has been optimized to be faster than if (keys %foo)
.$str x $num
) is now several times faster when $str
has length one or $num
is large.@a = reverse @a
) in void context now happens in-place and is several orders of magnitude faster than it used to be. It will also preserve non-existent elements whenever possible, i.e. for non magical arrays or tied arrays with EXISTS
and DELETE
methods.vendorlib
and vendorarch
are the same, then they are only added to @INC
once.$Config{usedevel}
and the C-level PERL_USE_DEVEL
are now defined if perl is built with -Dusedevel
.-fstack-protector
, to provide protection against stack-smashing attacks, if the compiler supports it.gconvert
if you are using a C++ compiler rather than a C compiler.perl -v
and perl -V
. Unpushed local commits are automatically added to the list of local patches displayed by perl -V
.dtrace
compatibility layer and an issue with linking miniperl
has been fixed in the process.less -R
instead of less
for improved behaviour in the face of groff
's new usage of ANSI escape codes.perl -V
now reports use of the compile-time options USE_PERL_ATOF
and USE_ATTRIBUTES_FOR_PERLIO
.Each release of Perl sees numerous internal changes which shouldn't affect day to day usage but may still be notable for developers working with Perl's source code.
Dual-lifed modules maintained by Perl's developers as part of the Perl core now live in dist/. Dual-lifed modules maintained primarily on CPAN now live in cpan/. When reporting a bug in a module located under cpan/, please send your bug report directly to the module's bug tracker or author, rather than Perl's bug tracker.
\N{...}
now compiles better, always forces UTF-8 internal representation
Perl's developers have fixed several problems with the recognition of \N{...}
constructs. As part of this, perl will store any scalar or regex containing \N{name}
or \N{U+code point}
in its definition in UTF-8 format. (This was true previously for all occurrences of \N{name}
that did not use a custom translator, but now it's always true.)
SVt_RV
no longer exists. RVs are now stored in IVs.Perl_vcroak()
now accepts a null first argument. In addition, a full audit was made of the "not NULL" compiler annotations, and those for several other internal functions were corrected.dSAVEDERRNO
, dSAVE_ERRNO
, SAVE_ERRNO
, RESTORE_ERRNO
have been added to formalise the temporary saving of the errno
variable.Perl_sv_insert_flags
has been added to augment Perl_sv_insert
.Perl_newSV_type(type)
has been added, equivalent to Perl_newSV()
followed by Perl_sv_upgrade(type)
.Perl_newSVpvn_flags()
has been added, equivalent to Perl_newSVpvn()
and then performing the action relevant to the flag.
Two flag bits are currently supported.
SVf_UTF8
will call SvUTF8_on()
for you. (Note that this does not convert an sequence of ISO 8859-1 characters to UTF-8). A wrapper, newSVpvn_utf8()
is available for this.SVs_TEMP
now calls Perl_sv_2mortal()
on the new SV.There is also a wrapper that takes constant strings, newSVpvs_flags()
.
Perl_croak_xs_usage
has been added as a wrapper to Perl_croak
.PerlIO_find_layer
and PerlIO_list_alloc
.PL_na
has been exterminated from the core code, replaced by local STRLEN temporaries, or *_nolen()
calls. Either approach is faster than PL_na
, which is a pointer dereference into the interpreter structure under ithreads, and a global variable otherwise.Perl_mg_free()
used to leave freed memory accessible via SvMAGIC()
on the scalar. It now updates the linked list to remove each piece of magic as it is freed.PL_reg_curpm
is now reference counted. This eliminates a lot of hackish workarounds to cope with it not being reference counted.Perl_mg_magical()
would sometimes incorrectly turn on SvRMAGICAL()
. This has been fixed.Nullav
, Nullcv
, Nullhv
, Nullop
, Nullsv
etc have been replaced by NULL
in the core code, and non-dual-life modules, as NULL
is clearer to those unfamiliar with the core code.MUTABLE_PTR(p)
has been added, which on (non-pedantic) gcc will not cast away const
, returning a void *
. Macros MUTABLE_SV(av)
, MUTABLE_SV(cv)
etc build on this, casting to AV *
etc without casting away const
. This allows proper compile-time auditing of const
correctness in the core, and helped picked up some errors (now fixed).mPUSHs()
and mXPUSHs()
have been added, for pushing SVs on the stack and mortalizing them.mro_meta
has changed slightly. Nothing outside the core should be accessing this directly anyway.The core distribution can now run its regression tests in parallel on Unix-like platforms. Instead of running make test
, set TEST_JOBS
in your environment to the number of tests to run in parallel, and run make test_harness
. On a Bourne-like shell, this can be done as
TEST_JOBS=3 make test_harness # Run 3 tests in parallel
An environment variable is used, rather than parallel make itself, because TAP::Harness needs to be able to schedule individual non-conflicting test scripts itself, and there is no standard interface to make
utilities to interact with their job schedulers.
Note that currently some test scripts may fail when run in parallel (most notably ext/IO/t/io_dir.t
). If necessary run just the failing scripts again sequentially and see if the failures go away.
It's now possible to override PERL5OPT
and friends in t/TEST
Several tests that have the potential to hang forever if they fail now incorporate a "watchdog" functionality that will kill them after a timeout, which helps ensure that make test
and make test_harness
run to completion automatically.
Perl's developers have added a number of new tests to the core. In addition to the items listed below, many modules updated from CPAN incorporate new tests.
make test_porting
now runs a number of important pre-commit checks which might be of use to anyone working on the Perl core.eval
.PVBM
and PVGV
.dbmopen
and dbmclose
.index
and threads.qr
doesn't leak.qr//
and threads.Tie::Hash::NamedCapture
.re
functions in universal.c work.setpgrp
works.substr
and threads.tie
work.@{"_<$file"}
works.qr
.\p{}
regex constructs.2**63
, which can now be handed to gmtime
and localtime
, do not cause an internal overflow or an excessively long loop.-Dm
. The tracing can alternatively output via the PERL_MEM_LOG
mechanism, if that was enabled when the perl binary was compiled.-DM
to enable it.-DB
now dumps subroutine definitions, leaving -Dx
for its original purpose of dumping syntax trees.Bad plugin affecting keyword '%s'
gmtime(%.0f) too large
Lexing code attempted to stuff non-Latin-1 character into Latin-1 input
Lexing code internal error (%s)
localtime(%.0f) too large
Overloaded dereference did not return a reference
Overloaded qr did not return a REGEXP
Perl_pmflag() is deprecated, and will be removed from the XS API
lvalue attribute ignored after the subroutine has been defined
This new warning is issued when one attempts to mark a subroutine as lvalue after it has been defined.
++
or --
are unable to change the value because it's beyond the limit of representation.
This uses a new warnings category: "imprecision".
lc
, uc
, lcfirst
, and ucfirst
warn when passed undef.Show constant in "Useless use of a constant in void context"
Prototype after '%s'
panic: sv_chop %s
This new fatal error occurs when the C routine Perl_sv_chop()
was passed a position that is not within the scalar's string buffer. This could be caused by buggy XS code, and at this point recovery is not possible.
Malformed UTF-8 returned by \N
is now produced if the charnames
handler returns malformed UTF-8.\N{NAME} must be resolved by the lexer
is now produced. This can happen, for example, when using a single-quotish context like $re = '\N{SPACE}'; /$re/;
. See perldiag for more examples of how the lexer can get bypassed.Invalid hexadecimal number in \N{U+...}
is a new fatal error triggered when the character constant represented by ...
is not a valid hexadecimal number.\N
as [^\n]
is not valid in a bracketed character class, just like .
in a character class loses its special meaning, and will cause the fatal error \N in a character class must be a named character: \N{...}
....
in \N{...}
have been tightened up so that unless the ...
begins with an alphabetic character and continues with a combination of alphanumerics, dashes, spaces, parentheses or colons then the warning Deprecated character(s) in \N{...} starting at '%s'
is now issued.Using just the first characters returned by \N{}
will be issued if the charnames
handler returns a sequence of characters which exceeds the limit of the number of characters that can be used. The message will indicate which characters were used and which were discarded.A number of existing diagnostic messages have been improved or corrected:
illegalproto
allows finer-grained control of warnings around function prototypes.
The two warnings:
have been moved from the syntax
top-level warnings category into a new first-level category, illegalproto
. These two warnings are currently the only ones emitted during parsing of an invalid/illegal prototype, so one can now use
no warnings 'illegalproto';
to suppress only those, but not other syntax-related warnings. Warnings where prototypes are changed, ignored, or not met are still in the prototype
category as before.
Deep recursion on subroutine "%s"
It is now possible to change the depth threshold for this warning from the default of 100, by recompiling the perl binary, setting the C pre-processor macro PERL_SUB_DEPTH_WARN
to the desired value.
Illegal character in prototype
warning is now more precise when reporting illegal characters after _Changes the error message to "Unrecognized character %s; marked by <-- HERE after %s<-- HERE near column %d". This should make it a little simpler to spot and correct the suspicious character.
$.
when it causes an uninitialized warning for ranges in scalar context.split
now warns when called in void context.printf
-style functions called with too few arguments will now issue the warning "Missing argument in %s"
[perl #71000]each
, keys
, or values
is used without an argument.tell()
now fails properly if called without an argument and when no previous file was read.
tell()
now returns -1
, and sets errno to EBADF
, thus restoring the 5.8.x behaviour.
overload
no longer implicitly unsets fallback on repeated 'use overload' lines.syntax
category was removed from 5 warnings that should only be in deprecated
.pack
/unpack
error messages have been normalized to panic: %s
Unicode character is illegal
has been rephrased to be more accurate
It now reads Unicode non-character is illegal in interchange
and the perldiag documentation has been expanded a bit.
charnames
handler may return are discarded when used in a regular expression pattern bracketed character class. If this happens then the warning Using just the first character returned by \N{} in character class
will be issued.Missing right brace on \N{} or unescaped left brace after \N. Assuming the latter
will be issued if Perl encounters a \N{
but doesn't find a matching }
. In this case Perl doesn't know if it was mistakenly omitted, or if "match non-newline" followed by "match a {
" was desired. It assumes the latter because that is actually a valid interpretation as written, unlike the other case. If you meant the former, you need to add the matching right brace. If you did mean the latter, you can silence this warning by writing instead \N\{
.gmtime
and localtime
called with numbers smaller than they can reliably handle will now issue the warnings gmtime(%.0f) too small
and localtime(%.0f) too small
.The following diagnostic messages have been removed:
Runaway format
Can't locate package %s for the parents of %s
In general this warning it only got produced in conjunction with other warnings, and removing it allowed an ISA lookup optimisation to be added.
v-string in use/require is non-portable
include-fixed
too, which is a recent addition to gcc's search path.//
) properly in enums.LVALUE
subroutines. Additionally, the debugger now correctly handles proxy constant subroutines, and subroutine stubs.%Module::CoreList::bug_tracker
to print out upstream bug tracker URLs. If a user identifies a particular module as the topic of their bug report and we're able to divine the URL for its upstream bug tracker, perlbug now provide a message to the user explaining that the core copies the CPAN version directly, and provide the URL for reporting the bug directly to the upstream author.
perlbug no longer reports "Message sent" when it hasn't actually sent the message
match()
operator in list context. Additionally, a2p no longer generates code that uses the $[
variable.Instead of returning a(nother) reference to the (pre-compiled) regexp in the optree, use reg_temp_copy() to create a copy of it, and return a reference to that. This resolves issues about Regexp::DESTROY not being called in a timely fashion (the original bug tracked by RT #69852), as well as bugs related to blessing regexps, and of assigning to regexps, as described in correspondence added to the ticket.
It transpires that we also need to undo the SvPVX() sharing when ithreads cloning a Regexp SV, because mother_re is set to NULL, instead of a cloned copy of the mother_re. This change might fix bugs with regexps and threads in certain other situations, but as yet neither tests nor bug reports have indicated any problems, so it might not actually be an edge case that it's possible to reach.
-Dmad
were fixed.-t
should only return TRUE for file handles connected to a TTY
The Microsoft C version of isatty()
returns TRUE for all character mode devices, including the /dev/null-style "nul" device and printers like "lpt1".
grep EXPR LIST
(note the missing comma) no longer causes abrupt and total failure.qr{}
literals properly set $'
when matching again.sort
should no longer lead to bus errors [perl #71076]@_
sometimes gave false negatives. [perl #71078]$@
may now be assigned a read-only value (without error or busting the stack).sort
called recursively from within an active comparison subroutine no longer causes a bus error if run multiple times. [perl #71076]-I
on shebang line now adds directories in front of @INC as documented, and as does -I
when specified on the command-line.kill
is now fatal when called on non-numeric process identifiers. Previously, an undef
process identifier would be interpreted as a request to kill process 0, which would terminate the current process group on POSIX systems. Since process identifiers are always integers, killing a non-numeric process is now fatal.@_
. The optimisation has been re-instated, and the performance regression fixed. (This fix is also present in 5.10.1)while (1) { map 1, 1 }
[RT #53038].m
command was broken on modules that defined constants [RT #61222].crypt
and string complement could return tainted values for untainted arguments [RT #59998].-i
.suffix command-line switch now recreates the file using restricted permissions, before changing its mode to match the original file. This eliminates a potential race condition [RT #60904].$?
would not have the top bit set ($? & 128
) even if the child core dumped.$^R
could incorrectly become undefined [RT #57042].$object->isa('Foo')
would report false if the package Foo
didn't exist, even if the object's @ISA
contained Foo
.@ISA
, have been found and fixed.$x=\$y; $x |= "foo"
[RT #54956].my $byte = chr(192); my $utf8 = chr(192); utf8::upgrade($utf8); $utf8 =~ /$byte|X}/i; # failed in 5.10.0
use utf8
is in effect), double-quoted literal strings could be corrupted where a \xNN
, \0NNN
or \N{}
is followed by a literal character with ordinal value greater than 255 [RT #59908].B::Deparse
failed to correctly deparse various constructs: readpipe STRING
[RT #62428], CORE::require(STRING)
[RT #62488], sub foo(_)
[RT #62484].setpgrp
with no arguments could corrupt the perl stack.eval
is now specifically trappable by Safe
and ops
. Previously it was erroneously treated like string eval
.[~
were sometimes parsed as the smart match operator (~~
) [RT #63854].*
quantifier in patterns was sometimes treated as {0,32767}
[RT #60034, #60464]. For example, this match would fail:
("ab" x 32768) =~ /^(ab)*$/
shmget
was limited to a 32 bit segment size on a 64 bit OS [RT #63924].next
or last
to exit a given
block no longer produces a spurious warning like the following:
Exiting given via last at foo.pl line 123
*bar=*foo{FORMAT}; # foo format now bad
Can't coerce GLOB to $type
.use filetest 'access'
, -x
was using the wrong access mode. This has been fixed [RT #49003].length
on a tied scalar that returned a Unicode value would not be correct the first time. This has been fixed.tie
inside in array tie
could SEGV. This has been fixed. [RT #51636]PerlIOStdio_close()
has been identified and fixed. This used to cause various threading issues, including SEGVs.unpack
, the use of ()
groups in scalar context was internally placing a list on the interpreter's stack, which manifested in various ways, including SEGVs. This is now fixed [RT #50256].substr
, \&$x
, tie $x, $m
and chop
. These have all been fixed.s///ge
has been reverted, as it turned out to be the cause of obscure bugs in seemingly unrelated parts of the interpreter [commit ef0d4e17921ee3de].elsif
are now correct...
operator now works correctly with ranges whose ends are at or close to the values of the smallest and largest integers.binmode STDIN, ':raw'
could lead to segmentation faults on some platforms. This has been fixed [RT #54828].index $str, ...
was effectively being executed as index "$str\0", ...
. This has been fixed [RT #53746].DBI
[RT #56908].tr//
within a closure could cause a segfault [RT #61520].Perl_sv_chop()
or otherwise upgrading an SV could result in an unaligned 64-bit access on the SPARC architecture [RT #60574].inc_version_list
would incorrectly list 5.10.*
after 5.8.*
; this affected the @INC
search order [RT #67628].pack "a*", $tainted_value
returned a non-tainted value [RT #52552].printf
and sprintf
could produce the fatal error panic: utf8_mg_pos_cache_update
when printing UTF-8 strings [RT #62666].AUTOLOAD
method might be missed (method cache issue) [RT #60220,60232].use feature
and //ee
could cause a memory leak [RT #63110].-C
on the shebang (#!
) line is once more permitted if it is also specified on the command line. -C
on the shebang line used to be a silent no-op if it was not also on the command line, so perl 5.10.0 disallowed it, which broke some scripts. Now perl checks whether it is also on the command line and only dies if it is not [RT #67880].Assertion rx->sublen >= (s - rx->subbeg) + i failed
TMPDIR
when opening an anonymous temporary file.Perl is incredibly portable. In general, if a platform has a C compiler, someone has ported Perl to it (or will soon). We're happy to announce that Perl 5.12 includes support for several new platforms. At the same time, it's time to bid farewell to some (very) old friends.
Perl's developers have merged patches from Haiku's maintainers. Perl should now build on Haiku.
Perl should now build on MirOS BSD.
flock()
was used from libbsd.cc -E -
unfortunately goes into K&R mode, but cc -E file.c
doesn't.-UDEBUGGING
is now the default on VMS.
Like it has been everywhere else for ages and ages. Also make command-line selection of -UDEBUGGING and -DDEBUGGING work in configure.com; before the only way to turn it off was by saying no in answer to the interactive question.
PerlIO::scalar
used to fail if $/
was set to a numeric reference (to indicate record-style reads). This is now fixed.getgrgid
.PERL_VMS_POSIX_EXIT
logical name now encodes a POSIX exit status in a VMS condition value for better interaction with GNV's bash shell and other utilities that depend on POSIX exit values. See "$?" in perlvms for details.File::Copy
now detects Unix compatibility mode on VMS.trustInfo
settings for Windows Vista and later. Without this setting Windows would treat perl.exe as a legacy application and apply various heuristics like redirecting access to protected file system areas (like the "Program Files" folder) to the users "VirtualStore" instead of generating a proper "permission denied" error.
The manifest resource also requests the Microsoft Common-Controls version 6.0 (themed controls introduced in Windows XP). Check out the Win32::VisualStyles module on CPAN to switch back to old style unthemed controls for legacy applications.
-t
filetest operator now only returns true if the filehandle is connected to a console window. In previous versions of Perl it would return true for all character mode devices, including NUL and LPT1.-p
filetest operator now works correctly, and the Fcntl::S_IFIFO constant is defined when Perl is compiled with Microsoft Visual C. In previous Perl versions -p
always returned a false value, and the Fcntl::S_IFIFO constant was not defined.
This bug is specific to Microsoft Visual C and never affected Perl binaries built with MinGW.
C:\>perl -MPOSIX -E "$!=POSIX::EWOULDBLOCK; say $!" A non-blocking socket operation could not be completed immediately.
fd_set
s more correctly.'.\foo'
and '..\foo'
were treated differently than './foo'
and '../foo'
by do
and require
[RT #63492].alarm
and kill
messages will no longer be dropped under race conditions.This is a list of some significant unfixed bugs, which are regressions from either 5.10.x or 5.8.x.
List::Util::first
misbehaves in the presence of a lexical $_
(typically introduced by my $_
or implicitly by given
). The variable which gets set for each iteration is the package variable $_
, not the lexical $_
[RT #67694].
A similar issue may occur in other modules that provide functions which take a block as their first argument, like
foo { ... $_ ...} list
"\N{LATIN SMALL LIGATURE FF}" =~ /\N{LATIN SMALL LETTER F}+/
will appear to hang as they get into a very long running loop [RT #72998].A bugfix related to the handling of the /m
modifier and qr
resulted in a change of behaviour between 5.8.x and 5.10.0:
# matches in 5.8.x, doesn't match in 5.10.0 $re = qr/^bar/; "foo\nbar" =~ /$re/m;
Perl 5.12.0 represents approximately two years of development since Perl 5.10.0 and contains over 750,000 lines of changes across over 3,000 files from over 200 authors and committers.
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.12.0:
Aaron Crane, Abe Timmerman, Abhijit Menon-Sen, Abigail, Adam Russell, Adriano Ferreira, Ævar Arnfjörð Bjarmason, Alan Grover, Alexandr Ciornii, Alex Davies, Alex Vandiver, Andreas Koenig, Andrew Rodland, andrew@sundale.net, Andy Armstrong, Andy Dougherty, Jose AUGUSTE-ETIENNE, Benjamin Smith, Ben Morrow, bharanee rathna, Bo Borgerson, Bo Lindbergh, Brad Gilbert, Bram, Brendan O'Dea, brian d foy, Charles Bailey, Chip Salzenberg, Chris 'BinGOs' Williams, Christoph Lamprecht, Chris Williams, chromatic, Claes Jakobsson, Craig A. Berry, Dan Dascalescu, Daniel Frederick Crisman, Daniel M. Quinlan, Dan Jacobson, Dan Kogai, Dave Mitchell, Dave Rolsky, David Cantrell, David Dick, David Golden, David Mitchell, David M. Syzdek, David Nicol, David Wheeler, Dennis Kaarsemaker, Dintelmann, Peter, Dominic Dunlop, Dr.Ruud, Duke Leto, Enrico Sorcinelli, Eric Brine, Father Chrysostomos, Florian Ragwitz, Frank Wiegand, Gabor Szabo, Gene Sullivan, Geoffrey T. Dairiki, George Greer, Gerard Goossen, Gisle Aas, Goro Fuji, Graham Barr, Green, Paul, Hans Dieter Pearcey, Harmen, H. Merijn Brand, Hugo van der Sanden, Ian Goodacre, Igor Sutton, Ingo Weinhold, James Bence, James Mastros, Jan Dubois, Jari Aalto, Jarkko Hietaniemi, Jay Hannah, Jerry Hedden, Jesse Vincent, Jim Cromie, Jody Belka, John E. Malmberg, John Malmberg, John Peacock, John Peacock via RT, John P. Linderman, John Wright, Josh ben Jore, Jos I. Boumans, Karl Williamson, Kenichi Ishigaki, Ken Williams, Kevin Brintnall, Kevin Ryde, Kurt Starsinic, Leon Brocard, Lubomir Rintel, Luke Ross, Marcel Grünauer, Marcus Holland-Moritz, Mark Jason Dominus, Marko Asplund, Martin Hasch, Mashrab Kuvatov, Matt Kraai, Matt S Trout, Max Maischein, Michael Breen, Michael Cartmell, Michael G Schwern, Michael Witten, Mike Giroux, Milosz Tanski, Moritz Lenz, Nicholas Clark, Nick Cleaton, Niko Tyni, Offer Kaye, Osvaldo Villalon, Paul Fenwick, Paul Gaborit, Paul Green, Paul Johnson, Paul Marquess, Philip Hazel, Philippe Bruhat, Rafael Garcia-Suarez, Rainer Tammer, Rajesh Mandalemula, Reini Urban, Renée Bäcker, Ricardo Signes, Ricardo SIGNES, Richard Foley, Rich Rauenzahn, Rick Delaney, Risto Kankkunen, Robert May, Roberto C. Sanchez, Robin Barker, SADAHIRO Tomoyuki, Salvador Ortiz Garcia, Sam Vilain, Scott Lanning, Sébastien Aperghis-Tramoni, Sérgio Durigan Júnior, Shlomi Fish, Simon 'corecode' Schubert, Sisyphus, Slaven Rezic, Smylers, Steffen Müller, Steffen Ullrich, Stepan Kasal, Steve Hay, Steven Schubiger, Steve Peters, Tels, The Doctor, Tim Bunce, Tim Jenness, Todd Rinaldo, Tom Christiansen, Tom Hukins, Tom Wyant, Tony Cook, Torsten Schoenfeld, Tye McQueen, Vadim Konovalov, Vincent Pit, Hio YAMASHINA, Yasuhiro Matsumoto, Yitzchak Scott-Thoennes, Yuval Kogman, Yves Orton, Zefram, Zsban Ambrus
This is woefully incomplete as it's automatically generated from version control history. In particular, it doesn't include the names of the (very much appreciated) contributors who reported issues in previous versions of Perl that helped make Perl 5.12.0 better. For a more complete list of all of Perl's historical contributors, please see the AUTHORS
file in the Perl 5.12.0 distribution.
Our "retired" pumpkings Nicholas Clark and Rafael Garcia-Suarez deserve special thanks for their brilliant and substantive ongoing contributions. Nicholas personally authored over 30% of the patches since 5.10.0. Rafael comes in second in patch authorship with 11%, but is first by a long shot in committing patches authored by others, pushing 44% of the commits since 5.10.0 in this category, often after providing considerable coaching to the patch authors. These statistics in no way comprise all of their contributions, but express in shorthand that we couldn't have done it without them.
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/. There may also be information at http://www.perl.org/, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analyzed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
http://dev.perl.org/perl5/errata.html for a list of issues found after this release, as well as a list of CPAN modules known to be incompatible with this release.
perl5115delta - what is new for perl v5.11.5
This document describes differences between the 5.11.4 release and the 5.11.5 release.
If you are upgrading from an earlier release such as 5.11.3, first read "p5114-NAME", which describes differences between 5.11.3 and 5.11.4.
The 32-bit limit on substr
arguments has now been removed. The full range of the system's signed and unsigned integers is now available for the pos
and len
arguments.
version
Upgraded from version 0.81 to 0.82.
The is_lax
and is_strict
functions can now be optionally exported to the caller's namespace and are also now documented.
Undefined version objects are now uninitialized with zero rather than undef
.
B::Debug
Upgraded from version 1.11 to 1.12.
CPAN
Upgraded from version 1.94_53 to 1.94_56.
This resolves RT #72362, in which CPAN was ignoring configure_requires
, and RT #72348, in which the command o conf init
in the CPAN shell could cause an exception to be thrown.
This module is also now built in a less specialized way, which resolves a problem that caused make
after make clean
to fail, fixing RT #72218.
CPANPLUS::Dist::Build
Upgraded from version 0.44 to 0.46.
This makes the prereq resolving fall back to _build/ querying if the prereq_data
action fails.
Pod::Perldoc
Upgraded from version 3.15_01 to 3.15_02.
Pod::Plainer
Upgraded from version 1.01 to 1.02.
Safe
Upgraded from version 2.21 to 2.22.
This resolves RT #72700, in which an exception thrown from a closure was getting lost.
Socket
Upgraded from version 1.85 to 1.86.
This makes the new Socket implementation of inet_pton
consistent with the existing Socket6 implementation of inet_pton
, fixing RT #72884.
podlators
Upgraded from version 2.2.2 to 2.3.1.
The syntax unless (EXPR) BLOCK else BLOCK
is now documented as valid, as is the syntax unless (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK
, although actually using the latter may not be the best idea for the readability of your source code.
Support for SystemTap's dtrace
compatibility layer has been added and an issue with linking miniperl
has been fixed in the process.
less -R
is now used instead of less
for groff
's new usage of ANSI escape codes by setting $Config{less}
(and thereby $Config{pager}
, which fixes RT #72156.
USE_PERL_ATOF is now reported in the compile-time options listed by the -V
switch.
NAME
and VERSION
in package NAME VERSION;
statements. (Fixes RT #72432)charnames
when the parser is already in error (e.g. by a missing my
under use strict;
) is now averted. This was a regression since Perl 5.10.0. (Fixes RT #72590)$!
no longer causes a SEGV for out of range errno
values. (Fixes RT #72850)/\N{...}/
has been fixed. This was a regression since Perl 5.10.SVt_REGEXP
type from a simple(r) scalar has been fixed.gmtime64
that caused it to break around 2**48
has been fixed.charnames
pragma will no longer cause a run-time error. (Fixes RT #56444)*Foo::ISA
now have the necessary magic added to them to catch any further updates to the new @ISA
. (Fixes RT #72866)IO::File
, which, together with some suitable manipulation of @IO::File::ISA
, fixes a breakage introduced in Perl 5.11.3 by a change that always blessed filehandles into IO::Handle
rather than checking for FileHandle
first.warnings::enabled
and warnings::warnif
in Perl 5.10.0 that wasn't documented at the time is now documented in "p5100-NAME". (Fixes RT #62522)Malformed UTF-8 returned by \N
is now produced if the charnames
handler returns malformed UTF-8.\\N{NAME} must be resolved by the lexer
is now produced. This can happen, for example, when using a single-quotish context like $re = '\N{SPACE}'; $re;
. See perldiag for more examples of how the lexer can get bypassed.Invalid hexadecimal number in \\N{U+...}
will be produced if the character constant represented by ...
is not a valid hexadecimal number.\N
as [^\n]
is not valid in a bracketed character class, just like .
in a character class loses its special meaning, and will cause the fatal error \\N in a character class must be a named character: \\N{...}
....
in \N{...}
have been tightened up so that unless the ...
begins with an alphabetic character and continues with a combination of alphanumerics, dashes, spaces, parentheses or colons then the warning Deprecated character(s) in \\N{...} starting at '%s'
is now issued.Using just the first characters returned by \N{}
will be issued if the charnames
handler returns a sequence of characters which exceeds the limit of the number of characters that can be used. The message will indicate which characters were used and which were discarded.charnames
handler may return are discarded when used in a regular expression pattern bracketed character class. If this happens then the warning Using just the first character returned by \N{} in character class
will be issued.Missing right brace on \\N{} or unescaped left brace after \\N. Assuming the latter
will be issued if Perl encounters a \N{
but doesn't find a matching }
. In this case Perl doesn't know if it was mistakenly omitted, or if "match non-newline" followed by "match a {
" was desired. It assumes the latter because that is actually a valid interpretation as written, unlike the other case. If you meant the former, you need to add the matching right brace. If you did mean the latter, you can silence this warning by writing instead \N\{
.gmtime
and localtime
called with numbers smaller than they can reliably handle will now issue the warnings gmtime(%.0f) too small
and localtime(%.0f) too small
.Tests some suitably portable filetest operators to check that they work as expected, particularly in the light of some internal changes made in how filehandles are blessed.
Tests that times greater than 2**63
, which can now be handed to gmtime
and localtime
, do not cause an internal overflow or an excessively long loop.
Perl 5.11.5 is a development release leading up to Perl 5.12.0. Some notable known problems found in 5.11.5 are listed as dependencies of RT #69710, the Perl 5 version 12 meta-ticket.
Perl 5.11.5 represents approximately one month of development since Perl 5.11.4 and contains 9618 lines of changes across 151 files from 33 authors and committers:
Ævar Arnfjörð Bjarmason, Abigail, brian d foy, Chris Williams, David Golden, David Mitchell, Eric Brine, Frank Wiegand, Gisle Aas, H.Merijn Brand, Jan Dubois, Jesse Vincent, Jim Cromie, John Peacock, Josh ben Jore, Karl Williamson, Marcus Holland-Moritz, Michael G Schwern, Nicholas Clark, Offer Kaye, Philippe Bruhat (BooK), Rafael Garcia-Suarez, Reini Urban, Ricardo Signes, Robin Barker, Slaven Rezic, Steffen Mueller, Steve Hay, Steve Peters, Tim Bunce, Todd Rinaldo, Tony Cook and Vincent Pit.
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analyzed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5114delta - what is new for perl v5.11.4
This document describes differences between the 5.11.3 release and the 5.11.4 release.
If you are upgrading from an earlier release such as 5.11.2, first read "p5113-NAME", which describes differences between 5.11.2 and 5.11.3.
Acceptable version number formats have been formalized into "strict" and "lax" rules. package NAME VERSION
takes a strict version number. use NAME VERSION
takes a lax version number. UNIVERSAL::VERSION
and the version object constructors take lax version numbers. Providing an invalid version will result in a fatal error.
These formats will be documented fully in the version module in a subsequent release of Perl 5.11. To a first approximation, a "strict" version number is a positive decimal number (integer or decimal-fraction) without exponentiation or else a dotted-decimal v-string with a leading 'v' character and at least three components. A "lax" version number allows v-strings with fewer than three components or without a leading 'v'. Under "lax" rules, both decimal and dotted-decimal versions may have a trailing "alpha" component separated by an underscore character after a fractional or dotted-decimal component.
The version module adds version::is_strict
and version::is_lax
functions to check a scalar against these rules.
\p{XDigit}
now matches the same characters as \p{Hex_Digit}
. This means that in addition to the characters it currently matches, [A-Fa-f0-9]
, it will also match their fullwidth equivalent forms, for example U+FF10: FULLWIDTH DIGIT ZERO.
less
Upgraded from version 0.02 to 0.03.
This version introduces the stash_name
method to allow subclasses of less to pick where in %^H to store their stash.
version
Upgraded from version 0.77 to 0.81.
This version adds support for "p5114-Version number formats" as described earlier in this document and in its own documentation.
warnings
Upgraded from version 1.08 to 1.09.
This version adds the illegalproto
warning category. See also "p5114-New or Changed Diagnostics" for this change.
Archive::Extract
Upgraded from version 0.36 to 0.38.
B::Deparse
Upgraded from version 0.93 to 0.94.
Compress::Raw::Bzip2
Upgraded from version 2.021 to 2.024.
Compress::Raw::Zlib
Upgraded from version 2.021 to 2.024.
CPAN
Upgraded from version 1.94_5301 to 1.94_54.
File::Fetch
Upgraded from version 0.22 to 0.24.
Module::Build
Upgraded from version 0.36 to 0.3603.
Safe
Upgraded from version 2.20 to 2.21.
Anonymous coderefs created in Safe containers no longer get bogus arguments passed to them, fixing RT #72068.
Devel::DProf::V
Removed from the Perl core. Prior version was 'undef'.
A significant fraction of the core documentation has been updated to clarify the behavior of Perl's Unicode handling.
Much of the remaining core documentation has been reviewed and edited for clarity, consistent use of language, and to fix the spelling of Tom Christiansen's name.
USE_ATTRIBUTES_FOR_PERLIO is now reported in the compile-time options listed by the -V
switch.
The default pipe buffer size on VMS has been updated to 8192 on 64-bit systems.
illegalproto
The two warnings :
Illegal character in prototype for %s : %s Prototype after '%c' for %s : %s
have been moved from the syntax
top-level warnings category into a new first-level category, illegalproto
. These two warnings are currently the only ones emitted during parsing of an invalid/illegal prototype, so one can now do
no warnings 'illegalproto';
to suppress only those, but not other syntax-related warnings. Warnings where prototypes are changed, ignored, or not met are still in the prototype
category as before. (Matt S. Trout)
This new warning is issued when one attempts to mark a subroutine as lvalue after it has been defined.
Perl 5.11.4 is a development release leading up to Perl 5.12.0. Some notable known problems found in 5.11.4 are listed as dependencies of RT #69710, the Perl 5 version 12 meta-ticket.
The following items are now deprecated.
UNIVERSAL->import()
The method UNIVERSAL->import()
is now deprecated. Attempting to pass import arguments to a use UNIVERSAL
statement will result in a deprecation warning. (This is a less noisy version of the full deprecation warning added in 5.11.0.)
Perl 5.11.4 represents approximately one month of development since Perl 5.11.3 and contains 17682 lines of changes across 318 files from 40 authors and committers:
Abigail, Andy Dougherty, brian d foy, Chris Williams, Craig A. Berry, David Golden, David Mitchell, Father Chrysostomos, Gerard Goossen, H.Merijn Brand, Jesse Vincent, Jim Cromie, Josh ben Jore, Karl Williamson, kmx, Matt S Trout, Nicholas Clark, Niko Tyni, Paul Marquess, Philip Hazel, Rafael Garcia-Suarez, Rainer Tammer, Reini Urban, Ricardo Signes, Shlomi Fish, Tim Bunce, Todd Rinaldo, Tom Christiansen, Tony Cook, Vincent Pit, and Zefram
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/. There may also be information at http://www.perl.org/, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analyzed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5113delta - what is new for perl v5.11.3
This document describes differences between the 5.11.2 release and the 5.11.3 release.
If you are upgrading from an earlier release such as 5.11.1, first read the "p5112-NAME", which describes differences between 5.11.1 and 5.11.2
IO::Handle
, as FileHandle
is merely a wrapper around IO::Handle
.The previous behaviour was to bless Filehandles into FileHandle (an empty proxy class) if it was loaded into memory and otherwise to bless them into IO::Handle
.
Perl is shipped with the latest Unicode version, 5.2, dated October 2009. See http://www.unicode.org/versions/Unicode5.2.0 for details about this release of Unicode. See perlunicode for instructions on installing and using older versions of Unicode.
Perl can now handle every Unicode character property. A new pod, perluniprops, lists all available non-Unihan character properties. By default the Unihan properties and certain others (deprecated and Unicode internal-only ones) are not exposed. See below for more details on these; there is also a section in the pod listing them, and why they are not exposed.
Perl now fully supports the Unicode compound-style of using =
and :
in writing regular expressions: \p{property=value}
and \p{property:value}
(both of which mean the same thing).
Perl now fully supports the Unicode loose matching rules for text between the braces in \p{...}
constructs. In addition, Perl also allows underscores between digits of numbers.
All the Unicode-defined synonyms for properties and property values are now accepted.
qr/\X/
, which matches a Unicode logical character, has been expanded to work better with various Asian languages. It now is defined as an extended grapheme cluster
. (See http://www.unicode.org/reports/tr29/). Anything matched previously that made sense will continue to be matched. But in addition:
\X
will now not break apart a CR LF
sequence.\X
will now match a sequence including the ZWJ
and ZWNJ
characters.\X
will now always match at least one character, including an initial mark. Marks generally come after a base character, but it is possible in Unicode to have them in isolation, and \X
will now handle that case, for example at the beginning of a line or after a ZWSP
. And this is the part where \X
doesn't match the things that it used to that don't make sense. Formerly, for example, you could have the nonsensical case of an accented LF.\X
will now match a (Korean) Hangul syllable sequence, and the Thai and Lao exception cases.Otherwise, this change should be transparent for the non-affected languages.
\p{...}
matches using the Canonical_Combining_Class property were completely broken in previous Perls. This is now fixed.
In previous Perls, the Unicode Decomposition_Type=Compat
property and a Perl extension had the same name, which led to neither matching all the correct values (with more than 100 mistakes in one, and several thousand in the other). The Perl extension has now been renamed to be Decomposition_Type=Noncanonical
(short: dt=noncanon
). It has the same meaning as was previously intended, namely the union of all the non-canonical Decomposition types, with Unicode Compat
being just one of those.
\p{Uppercase}
and \p{Lowercase}
have been brought into line with the Unicode definitions. This means they each match a few more characters than previously.
\p{Cntrl}
now matches the same characters as \p{Control}
. This means it no longer will match Private Use (gc=co), Surrogates (gc=cs), nor Format (gc=cf) code points. The Format code points represent the biggest possible problem. All but 36 of them are either officially deprecated or strongly discouraged from being used. Of those 36, likely the most widely used are the soft hyphen (U+00AD), and BOM, ZWSP, ZWNJ, WJ, and similar, plus Bi-directional controls.
\p{Alpha}
now matches the same characters as \p{Alphabetic}
. The Perl definition included a number of things that aren't really alpha (all marks), while omitting many that were. As a direct consequence, the definitions of \p{Alnum}
and \p{Word}
which depend on Alpha also change.
\p{Word}
also now doesn't match certain characters it wasn't supposed to, such as fractions.
\p{Print}
no longer matches the line control characters: Tab, LF, CR, FF, VT, and NEL. This brings it in line with the documentation.
\p{Decomposition_Type=Canonical}
now includes the Hangul syllables.
The Numeric type property has been extended to include the Unihan characters.
There is a new Perl extension, the 'Present_In', or simply 'In', property. This is an extension of the Unicode Age property, but \p{In=5.0}
matches any code point whose usage has been determined as of Unicode version 5.0. The \p{Age=5.0}
only matches code points added in precisely version 5.0.
A number of properties did not have the correct values for unassigned code points. This is now fixed. The affected properties are Bidi_Class, East_Asian_Width, Joining_Type, Decomposition_Type, Hangul_Syllable_Type, Numeric_Type, and Line_Break.
The Default_Ignorable_Code_Point, ID_Continue, and ID_Start properties have been updated to their current Unicode definitions.
Certain properties that are supposed to be Unicode internal-only were erroneously exposed by previous Perls. Use of these in regular expressions will now generate, if enabled, a deprecated warning message. The 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.
An installation can now fairly easily change which Unicode properties Perl understands. As mentioned above, certain properties are by default turned off. These include all the Unihan properties (which should be accessible via the CPAN module Unicode::Unihan) and any deprecated or Unicode internal-only property that Perl has never exposed.
The generated files in the lib/unicore/To
directory are now more clearly marked as being stable, directly usable by applications. New hash entries in them give the format of the normal entries, which allows for easier machine parsing. Perl can generate files in this directory for any property, though most are suppressed. An installation can choose to change which get written. Instructions are in perluniprops.
U+0FFFF is now a legal character in regular expressions.
constant
Upgraded from version 1.19 to 1.20.
diagnostics
This pragma no longer suppresses Use of uninitialized value in range (or flip)
warnings. [perl #71204]
feature
Upgraded from 1.13 to 1.14. Added the unicode_strings
feature:
use feature "unicode_strings";
This pragma turns on Unicode semantics for the case-changing operations (uc/lc/ucfirst/lcfirst) on strings that don't have the internal UTF-8 flag set, but that contain single-byte characters between 128 and 255.
legacy
The experimental legacy
pragma, introduced in 5.11.2, has been removed, and its functionality replaced by the new feature pragma, use feature "unicode_strings"
.
threads
Upgraded from version 1.74 to 1.75.
warnings
Upgraded from 1.07 to 1.08. Added new warnings::fatal_enabled()
function.
Archive::Extract
Upgraded from version 0.34 to 0.36.
CPAN
Upgraded from version 1.94_51 to 1.94_5301, which is 1.94_53 on CPAN plus some local fixes for bleadperl.
Includes better bzip2 support, improved FirstTime experience with auto-selection of CPAN mirrors, proper handling of modules removed from the Perl core, and an updated 'cpan' utility script
CPANPLUS
Upgraded from version 0.89_09 to 0.90.
Encode
Upgraded from version 2.38 to 2.39.
ExtUtils::MakeMaker
Upgraded from version 6.55_02 to 6.56. Adds new BUILD_REQUIRES key to indicate build-only prerequisites. Also adds support for mingw64 and the new "package NAME VERSION" syntax.
File::Path
Upgraded from version 2.08 to 2.08_01.
Module::Build
Upgraded from version 0.35_09 to 0.36. Compared to 0.35, this version has a new 'installdeps' action, supports the PERL_MB_OPT environment variable, adds a 'share_dir' property for File::ShareDir support, support the "package NAME VERSION" syntax and has many other enhancements and bug fixes. The 'passthrough' style of Module::Build::Compat has been deprecated.
Module::CoreList
Upgraded from version 2.23 to 2.24.
POSIX
Upgraded from version 1.18 to 1.19. Error codes for getaddrinfo()
and getnameinfo()
are now available.
Pod::Simple
Upgraded from version 3.10 to 3.13.
Safe
Upgraded from version 2.19 to 2.20.
No longer reports "Message sent" when it hasn't actually sent the message
The Pod specification (perlpodspec) has been updated to bring the specification in line with modern usage already supported by most Pod systems. A parameter string may now follow the format name in a "begin/end" region. Links to URIs with a text description are now allowed. The usage of L<"section">
has been marked as deprecated.
if.pm has been documented in "use" in perlfunc as a means to get conditional loading of modules despite the implicit BEGIN block around use
.
PERL5OPT
and friends in t/TESTperl.exe
to specify the trustInfo
settings for Windows Vista and later. Without this setting Windows will treat perl.exe
as a legacy application and apply various heuristics like redirecting access to protected file system areas (like the "Program Files" folder) to the users "VirtualStore" instead of generating a proper "permission denied" error.
For VC8 and VC9 this manifest setting is automatically generated by the compiler/linker (together with the binding information for their respective runtime libraries); for all other compilers we need to embed the manifest resource explicitly in the external resource file.
This change also requests the Microsoft Common-Controls version 6.0 (themed controls introduced in Windows XP) via the dependency list in the assembly manifest. For VC8 and VC9 this is specified using the /manifestdependency
linker commandline option instead.
Like it has been everywhere else for ages and ages. Also make command-line selection of -UDEBUGGING and -DDEBUGGING work in configure.com; before the only way to turn it off was by saying no in answer to the interactive question.
Instead of returning a(nother) reference to the (pre-compiled) regexp in the optree, use reg_temp_copy() to create a copy of it, and return a reference to that. This resolves issues about Regexp::DESTROY not being called in a timely fashion (the original bug tracked by RT #69852), as well as bugs related to blessing regexps, and of assigning to regexps, as described in correspondence added to the ticket.
It transpires that we also need to undo the SvPVX() sharing when ithreads cloning a Regexp SV, because mother_re is set to NULL, instead of a cloned copy of the mother_re. This change might fix bugs with regexps and threads in certain other situations, but as yet neither tests nor bug reports have indicated any problems, so it might not actually be an edge case that it's possible to reach.
-Dmad
were fixed.The Microsoft C version of isatty() returns TRUE for all character mode devices, including the /dev/null style "nul" device and printers like "lpt1".
grep EXPR LIST
(note the missing comma) no longer causes abrupt and total failure.qr{}
literals properly set $'
when matching again.sort
should no longer lead to bus errors [perl #71076]@_
sometimes gave false negatives. [perl #71078]$@
may now be assigned a read-only value (without error or busting the stack).sort
called recursively from within an active comparison subroutine no longer causes a bus error if run multiple times. [perl #71076]split
now warns when called in void contextprintf
-style functions called with too few arguments will now issue the warning "Missing argument in %s"
[perl #71000]Many modules updated from CPAN incorporate new tests.
See if line numbers are correct at EOF
See if format scoping works
See if @{"_<$file"} works
See if -t file test works
See if qr works
Tests malfunctions of utf8 cache
Test unicode \p{} regex constructs
The following items are now deprecated.
Using goto
to jump from an outer scope into an inner scope is now deprecated. This rare use case was causing problems in the implementation of scopes.
Perl 5.11.3 represents approximately one month of development since Perl 5.11.2 and contains 61407 lines of changes across 396 files from 40 authors and committers:
Abigail, Alex Davies, Alexandr Ciornii, Andrew Rodland, Andy Dougherty, Bram, brian d foy, Chip Salzenberg, Chris Williams, Craig A. Berry, Daniel Frederick Crisman, David Golden, Dennis Kaarsemaker, Eric Brine, Father Chrysostomos, Gene Sullivan, Gerard Goossen, H. Merijn Brand, Hugo van der Sanden, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Jim Cromie, Karl Williamson, Leon Brocard, Max Maischein, Michael Breen, Moritz Lenz, Nicholas Clark, Rafael Garcia-Suarez, Reini Urban, Ricardo Signes, Stepan Kasal, Steve Hay, Steve Peters, Tim Bunce, Tony Cook, Vincent Pit and Zefram.
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5112delta - what is new for perl v5.11.2
This document describes differences between the 5.11.1 release and the 5.11.2 release.
It is now possible to overload the qr//
operator, that is, conversion to regexp, like it was already possible to overload conversion to boolean, string or number of objects. It is invoked when an object appears on the right hand side of the =~
operator, or when it is interpolated into a regexp. See overload.
Extension modules can now cleanly hook into the Perl parser to define new kinds of keyword-headed expression and compound statement. The syntax following the keyword is defined entirely by the extension. This allow a completely non-Perl sublanguage to be parsed inline, with the right ops cleanly generated. This feature is currently considered experimental.
See "PL_keyword_plugin" in perlapi for the mechanism. The Perl core source distribution also includes a new module XS::APItest::KeywordRPN, which implements reverse Polish notation arithmetic via pluggable keywords. This module is mainly used for test purposes, and is not normally installed, but also serves as an example of how to use the new mechanism.
The lowest layers of the lexer and parts of the pad system now have C APIs available to XS extensions. These are necessary to support proper use of pluggable keywords, but have other uses too. The new APIs are experimental, and only cover a small proportion of what would be necessary to take full advantage of the core's facilities in these areas. It is intended that the Perl 5.13 development cycle will see the addition of a full range of clean, supported interfaces.
Where an extension module hooks the creation of rv2cv ops to modify the subroutine lookup process, this now works correctly for bareword subroutine calls. This means that prototypes on subroutines referenced this way will be processed correctly. (Previously bareword subroutine names were initially looked up, for parsing purposes, by an unhookable mechanism, so extensions could only properly influence subroutine names that appeared with an &
sigil.)
legacy
Preserves legacy behaviors or enable new non-default behaviors. Currently the only behaviour concerns semantics for the 128 characters on ASCII systems that have the 8th bit set.
diagnostics
Supports %.0f formatting internally.
overload
Allow overloading of 'qr'.
B::Concise
Optimize reversing an array in-place, avoid using defined %hash in core code and tests.
B::Deparse
Teach B::Deparse about in-place reverse.
Carp
Refine Carp caller() fix and add tests.
Compress::Zlib
Updated to 2.022.
CPANPLUS
Updated to 0.89_09.
Encode
Updated to 2.38.
ExtUtils::CBuilder
Updated to 0.27.
Env
Add EXISTS and DELETE methods to Env.pm.
File::Fetch
Updated to 0.22.
I8N::Langinfo
Correctly document export of I18N::Langinfo.
I8N::LangTags
In I18N::LangTags::Detect, avoid using defined @array and defined %hash.
IO::Compress
Updated to 2.022.
IPC::Cmd
Updated to 0.54.
List::Util
Updated to 1.22.
Locale::Maketext
In Locale::Maketext, avoid using defined @array and defined %hash. Convert the odd Locale::Maketext test out from Test to Test::More.
Module::Build
Updated to 0.35_08.
Module::CoreList
Implemented is_deprecated().
Pod::Simple
Updated to 3.10.
Scalar::Util
Updated to 1.22.
Switch
Updated to 2.16.
Fixed bugs with the match() operator in list context, remove mention of $[.
@a = reverse @a
) in void context now happens in-place and is several orders of magnitude faster than it used to be. It will also preserve non-existent elements whenever possible, i.e. for non magical arrays or tied arrays with EXISTS
and DELETE
methods.Several new diagnostics, see perldiag for details.
Bad plugin affecting keyword '%s'
gmtime(%.0f) too large
Lexing code attempted to stuff non-Latin-1 character into Latin-1 input
Lexing code internal error (%s)
localtime(%.0f) too large
Overloaded dereference did not return a reference
Overloaded qr did not return a REGEXP
Perl_pmflag() is deprecated, and will be removed from the XS API
One diagnostic has been removed:
Runaway format
Perl_pmflag
has been removed from the public API. Calling it now generates a deprecation warning, and it will be removed in a future release. Although listed as part of the API, it was never documented, and only ever used in toke.c, and prior to 5.10, regcomp.c. In core, it has been replaced by a static function.Test that a bare readdir in while loop sets $_.
Perl 5.11.2 fails a small set of core and CPAN tests as of this release. With luck, that'll be sorted out for 5.11.3.
The following items are now deprecated.
:=
to mean an empty attribute list is now deprecated.An accident of Perl's parser meant that these constructions were all equivalent:
my $pi := 4; my $pi : = 4; my $pi : = 4;
with the :
being treated as the start of an attribute list, which ends before the =
. As whitespace is not significant here, all are parsed as an empty attribute list, hence all the above are equivalent to, and better written as
my $pi = 4;
because no attribute processing is done for an empty list.
As is, this meant that :=
cannot be used as a new token, without silently changing the meaning of existing code. Hence that particular form is now deprecated, and will become a syntax error. If it is absolutely necessary to have empty attribute lists (for example, because of a code generator) then avoid the warning by adding a space before the =
.
Perl 5.11.2 represents approximately 3 weeks development since Perl 5.11.1 and contains 29,992 lines of changes across 458 files from 38 authors and committers:
Abhijit Menon-Sen, Abigail, Ben Morrow, Bo Borgerson, Brad Gilbert, Bram, Chris Williams, Craig A. Berry, Daniel Frederick Crisman, Dave Rolsky, David E. Wheeler, David Golden, Eric Brine, Father Chrysostomos, Frank Wiegand, Gerard Goossen, Gisle Aas, Graham Barr, Harmen, H.Merijn Brand, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Karl Williamson, Kevin Ryde, Leon Brocard, Nicholas Clark, Paul Marquess, Philippe Bruhat, Rafael Garcia-Suarez, Sisyphus, Steffen Mueller, Steve Hay, Steve Peters, Vincent Pit, Yuval Kogman, Yves Orton, and Zefram.
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5111delta - what is new for perl v5.11.1
This document describes differences between the 5.11.0 release and the 5.11.1 release.
\s
\w
and \d
once again have the semantics they had in Perl 5.8.x.package NAME VERSION
syntaxThis new syntax allows a module author to set the $VERSION of a namespace when the namespace is declared with 'package'. It eliminates the need for our $VERSION = ...
and similar constructs. E.g.
package Foo::Bar 1.23; # $Foo::Bar::VERSION == 1.23
There are several advantages to this:
$VERSION
is parsed in exactly the same way as use NAME VERSION
$VERSION
is set at compile time$VERSION = ...
and eval $VERSION
cluttereval
the way MM->parse_version does for $VERSION = ...
It does not break old code with only package NAME
, but code that uses package NAME VERSION
will need to be restricted to perl 5.11.X or newer This is analogous to the change to open
from two-args to three-args. Users requiring the latest Perl will benefit, and perhaps N years from now it will become standard practice when Perl 5.12 is targeted the way that 5.6 is today.
$1
in perlvar.pod clarifiedif (%foo)
has been optimized to be faster than if (keys %foo)
each
, keys
or values
is used without an argumenttell()
now fails properly if called without an argument and when no previous file was read
tell()
now returns -1
, and sets errno to EBADF
, thus restoring the 5.8.x behaviour
fd_set
s more correctly.It now reads Unicode non-character is illegal in interchange
and the perldiag documentation has been expanded a bit.
To disable this feature in a given lexical scope, you should use no warnings 'deprecated';
For information about which language features are deprecated and explanations of various deprecation warnings, please see perldiag
make test_porting
now runs a number of important pre-commit checks which might be of use to anyone working on the Perl core.Several porters have reported mysterious crashes when Perl's entire test suite is run after a build on certain Windows 2000 systems. When run by hand, the individual tests reportedly work fine.
Perl 5.11.1 fails a small set of core and CPAN tests as of this release. With luck, that'll be sorted out for 5.11.2
Perl 5.11.1 represents approximately 3 weeks development since Perl 5.11.0 contains 22,000 lines of changes across 396 files from 26 authors and committers:
Abigail, Alex Vandiver, brian d foy, Chris Williams, Craig A. Berry, David Fifield, David Golden, demerphq, Eric Brine, Geoffrey T. Dairiki, George Greer, H.Merijn Brand, Jan Dubois, Jerry D. Hedden, Jesse Vincent, Josh ben Jore, Max Maischein, Nicholas Clark, Rafael Garcia-Suarez, Simon Schubert, Sisyphus, Smylers, Steve Hay, Steve Peters, Vincent Pit and Yves Orton.
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.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5110delta - what is new for perl v5.11.0
This document describes differences between the 5.10.0 release and the 5.11.0 development release.
Previous versions of Perl tried to map POSIX style character class definitions onto Unicode property names so that patterns would "dwim" when matches were made against latin-1 or unicode strings. This proved to be a mistake, breaking character class negation, causing forward compatibility problems (as Unicode keeps updating their property definitions and adding new characters), and other problems.
Therefore we have now defined a new set of artificial "unicode" property names which will be used to do unicode matching of patterns using POSIX style character classes and perl short-form escape character classes like \w and \d.
The key change here is that \d will no longer match every digit in the unicode standard (there are thousands) nor will \w match every word character in the standard, instead they will match precisely their POSIX or Perl definition.
Those needing to match based on Unicode properties can continue to do so by using the \p{} syntax to match whichever property they like, including the new artificial definitions.
NOTE: This is a backwards incompatible no-warning change in behaviour. If you are upgrading and you process large volumes of text look for POSIX and Perl style character classes and change them to the relevant property name (by removing the word 'Posix' from the current name).
The following table maps the POSIX character class names, the escapes and the old and new Unicode property mappings:
POSIX Esc Class New-Property ! Old-Property ----------------------------------------------+------------- alnum [0-9A-Za-z] IsPosixAlnum ! IsAlnum alpha [A-Za-z] IsPosixAlpha ! IsAlpha ascii [\000-\177] IsASCII = IsASCII blank [\011 ] IsPosixBlank ! cntrl [\0-\37\177] IsPosixCntrl ! IsCntrl digit \d [0-9] IsPosixDigit ! IsDigit graph [!-~] IsPosixGraph ! IsGraph lower [a-z] IsPosixLower ! IsLower print [ -~] IsPosixPrint ! IsPrint punct [!-/:-@[-`{-~] IsPosixPunct ! IsPunct space [\11-\15 ] IsPosixSpace ! IsSpace \s [\11\12\14\15 ] IsPerlSpace ! IsSpacePerl upper [A-Z] IsPosixUpper ! IsUpper word \w [0-9A-Z_a-z] IsPerlWord ! IsWord xdigit [0-9A-Fa-f] IsXDigit = IsXDigit
If you wish to build perl with the old mapping you may do so by setting
#define PERL_LEGACY_UNICODE_CHARCLASS_MAPPINGS 1
in regcomp.h, and then setting
PERL_TEST_LEGACY_POSIX_CC
to true your environment when testing.
In @INC, ARCHLIB and PRIVLIB now occur after after the current version's site_perl and vendor_perl.
The handling of complex expressions by the given
/when
switch statement has been enhanced. These enhancements are also available in 5.10.1 and subsequent 5.10 releases. There are two new cases where when
now interprets its argument as a boolean, instead of an expression to be used in a smart match:
The ..
and ...
flip-flop operators are now evaluated in boolean context, following their usual semantics; see "Range Operators" in perlop.
Note that, as in perl 5.10.0, when (1..10)
will not work to test whether a given value is an integer between 1 and 10; you should use when ([1..10])
instead (note the array reference).
However, contrary to 5.10.0, evaluating the flip-flop operators in boolean context ensures it can now be useful in a when()
, notably for implementing bistable conditions, like in:
when (/^=begin/ .. /^=end/) { # do something }
A compound expression involving the defined-or operator, as in when (expr1 // expr2)
, will be treated as boolean if the first expression is boolean. (This just extends the existing rule that applies to the regular or operator, as in when (expr1 || expr2)
.)
The next section details more changes brought to the semantics to the smart match operator, that naturally also modify the behaviour of the switch statements where smart matching is implicitly used. These changers were also made for the 5.10.1 release, and will remain in subsequent 5.10 releases.
The smart match operator ~~
is no longer commutative. The behaviour of a smart match now depends primarily on the type of its right hand argument. Moreover, its semantics have been adjusted for greater consistency or usefulness in several cases. While the general backwards compatibility is maintained, several changes must be noted:
%hash ~~ sub {}
and @array ~~ sub {}
now test that the subroutine returns a true value for each key of the hash (or element of the array), instead of passing the whole hash or array as a reference to the subroutine.~~
operator, but like any vulgar scalar.undef ~~ %hash
is always false (since undef
can't be a key in a hash). No implicit conversion to ""
is done (as was the case in perl 5.10.0).$scalar ~~ @array
now always distributes the smart match across the elements of the array. It's true if one element in @array verifies $scalar ~~ $element
. This is a generalization of the old behaviour that tested whether the array contained the scalar.The full dispatch table for the smart match operator is given in "Smart matching in detail" in perlsyn.
According to the rule of dispatch based on the rightmost argument type, when an object overloading ~~
appears on the right side of the operator, the overload routine will always be called (with a 3rd argument set to a true value, see overload.) However, when the object will appear on the left, the overload routine will be called only when the rightmost argument is a simple scalar. This way distributivity of smart match across arrays is not broken, as well as the other behaviours with complex types (coderefs, hashes, regexes). Thus, writers of overloading routines for smart match mostly need to worry only with comparing against a scalar, and possibly with stringification overloading; the other common cases will be automatically handled consistently.
~~
will now refuse to work on objects that do not overload it (in order to avoid relying on the object's underlying structure). (However, if the object overloads the stringification or the numification operators, and if overload fallback is active, it will be used instead, as usual.)
Labels used as targets for the goto
, last
, next
or redo
statements cannot be keywords anymore. This restriction will prevent potential confusion between the goto LABEL
and goto EXPR
syntaxes: for example, a statement like goto print
would jump to a label whose name would be the return value of print()
, (usually 1), instead of a label named print
. Moreover, the other control flow statements would just ignore any keyword passed to them as a label name. Since such labels cannot be defined anymore, this kind of error will be avoided.
use feature :5.10*
have changed slightly. See "p5110-Modules and Pragmata" for more information.~~
with an object that has no overload defined for it. (This way ~~
will not break encapsulation by matching against the object's internal representation as a reference.)perl -V
. See perlrepository for more information.ext/
directory in the perl source has been reorganised. In general, a module Foo::Bar
whose source was stored under ext/Foo/Bar/ is now located under ext/Foo-Bar/. Also, nearly all dual-life modules have been moved from lib/ to ext/. This is purely a source tarball change, and should make no difference to the compilation or installation of perl, unless you have a very customised build process that explicitly relies on this structure, or which hard-codes the nonxs_ext
Configure parameter. Specifically, this change does not by default alter the location of any files in the final installation.Test::Harness
2.x to 3.x upgrade, the experimental Test::Harness::Straps
module has been removed. See "p5110-Updated Modules" for more details.ExtUtils::MakeMaker
upgrade, the ExtUtils::MakeMaker::bytes
and ExtUtils::MakeMaker::vmsish
modules have been removed from this distribution.Module::CoreList
no longer contains the %:patchlevel
hash.A bugfix related to the handling of the /m
modifier and qr
resulted in a change of behaviour between 5.8.x and 5.10.0:
# matches in 5.8.x, doesn't match in 5.10.0 $re = qr/^bar/; "foo\nbar" =~ /$re/m;
length undef
now returns undef.This allows a build to complete with PERL_UNICODE set and a UTF-8 locale. Without this there's a bootstrapping problem, as miniperl can't load the UTF-8 components of the regexp engine, because they're not yet built.
"#line XXX"
directive.foreach
may no longer be used as an attribute.The copy of the Unicode Character Database included in Perl 5.11.0 has been updated to 5.1.0 from 5.0.0. See http://www.unicode.org/versions/Unicode5.1.0/#Notable_Changes for the notable changes.
As of Perl 5.11.0 there is a new interface for plugging and using method resolution orders other than the default (linear depth first search). The C3 method resolution order added in 5.10.0 has been re-implemented as a plugin, without changing its Perl-space interface. See perlmroapi for more information.
overloading
pragmaThis pragma allows you to lexically disable or enable overloading for some or all operations. (Yuval Kogman)
\N
regex escapeA new regex escape has been added, \N
. It will match any character that is not a newline, independently from the presence or absence of the single line match modifier /s
. (If \N
is followed by an opening brace and by a letter, perl will still assume that a Unicode character name is coming, so compatibility is preserved.) (Rafael Garcia-Suarez)
Using the use VERSION
syntax with a version number greater or equal to 5.11.0 will also lexically enable strictures just like use strict
would do (in addition to enabling features.) So, the following:
use 5.11.0;
will now imply:
use strict; use feature ':5.11';
The core distribution can now run its regression tests in parallel on Unix-like platforms. Instead of running make test
, set TEST_JOBS
in your environment to the number of tests to run in parallel, and run make test_harness
. On a Bourne-like shell, this can be done as
TEST_JOBS=3 make test_harness # Run 3 tests in parallel
An environment variable is used, rather than parallel make itself, because TAP::Harness needs to be able to schedule individual non-conflicting test scripts itself, and there is no standard interface to make
utilities to interact with their job schedulers.
Note that currently some test scripts may fail when run in parallel (most notably ext/IO/t/io_dir.t
). If necessary run just the failing scripts again sequentially and see if the failures go away.
...
operatorA new operator, ...
, nicknamed the Yada Yada operator, has been added. It is intended to mark placeholder code, that is not yet implemented. See "Yada Yada Operator" in perlop. (chromatic)
Some support for DTrace has been added. See "DTrace support" in INSTALL.
configure_requires
in CPAN module metadataBoth CPAN
and CPANPLUS
now support the configure_requires
keyword in the META.yml metadata file included in most recent CPAN distributions. This allows distribution authors to specify configuration prerequisites that must be installed before running Makefile.PL or Build.PL.
See the documentation for ExtUtils::MakeMaker
or Module::Build
for more on how to specify configure_requires
when creating a distribution for CPAN.
each
is now more flexibleThe each
function can now operate on arrays.
Perl's core time-related functions are now Y2038 compliant. (With 29 years to spare!)
$,
flexibilityThe variable $,
may now be tied.
// now behaves like || in when clauses
You can now set -W
from the PERL5OPT
environment variable
delete local
delete local
now allows you to locally delete a hash entry.
Abstract namespace sockets are Linux-specific socket type that live in AF_UNIX family, slightly abusing it to be able to use arbitrary character arrays as addresses: They start with nul byte and are not terminated by nul byte, but with the length passed to the socket() system call.
Dual-lifed modules maintained primarily in the Perl core now live in dist/. Dual-lifed modules maintained primarily on CPAN now live in cpan/
In previous releases of Perl, it was customary to enumerate all module changes in this section of the perldelta
file. From 5.11.0 forward only notable updates (such as new or deprecated modules ) will be listed in this section. For a complete reference to the versions of modules shipped in a given release of perl, please see Module::CoreList.
autodie
This is a new lexically-scoped alternative for the Fatal
module. The bundled version is 2.06_01. Note that in this release, using a string eval when autodie
is in effect can cause the autodie behaviour to leak into the surrounding scope. See "BUGS" in autodie for more details.
Compress::Raw::Bzip2
This has been added to the core (version 2.020).
parent
This pragma establishes an ISA relationship with base classes at compile time. It provides the key feature of base
without the feature creep.
Parse::CPAN::Meta
This has been added to the core (version 1.39).
overloading
See "p5110-The overloading
pragma" above.
attrs
The attrs
pragma has been removed. It had been marked as deprecated since 5.6.0.
charnames
The Unicode NameAliases.txt database file has been added. This has the effect of adding some extra \N
character names that formerly wouldn't have been recognised; for example, "\N{LATIN CAPITAL LETTER GHA}"
.
feature
The meaning of the :5.10
and :5.10.X
feature bundles has changed slightly. The last component, if any (i.e. X
) is simply ignored. This is predicated on the assumption that new features will not, in general, be added to maintenance releases. So :5.10
and :5.10.X
have identical effect. This is a change to the behaviour documented for 5.10.0.
mro
Upgraded from version 1.00 to 1.01. Performance for single inheritance is 40% faster - see "p5110-Performance Enhancements" below.
mro
is now implemented as an XS extension. The documented interface has not changed. Code relying on the implementation detail that some mro::
methods happened to be available at all times gets to "keep both pieces".
ExtUtils::MakeMaker
Upgraded from version 6.42 to 6.55_02.
Note that ExtUtils::MakeMaker::bytes
and ExtUtils::MakeMaker::vmsish
have been removed from this distribution.
Test::Harness
Upgraded from version 2.64 to 3.17.
Note that one side-effect of the 2.x to 3.x upgrade is that the experimental Test::Harness::Straps
module (and its supporting Assert
, Iterator
, Point
and Results
modules) have been removed. If you still need this, then they are available in the (unmaintained) Test-Harness-Straps
distribution on CPAN.
UNIVERSAL
Upgraded from version 1.04 to 1.05.
UNIVERSAL->import()
is now deprecated.
Now looks in include-fixed
too, which is a recent addition to gcc's search path.
No longer incorrectly treats enum values like macros (Daniel Burr).
Now handles C++ style constants (//
) properly in enums. (A patch from Rainer Weikusat was used; Daniel Burr also proposed a similar fix).
LVALUE
subroutines now work under the debugger.
The debugger now correctly handles proxy constant subroutines, and subroutine stubs.
perlbug now uses %Module::CoreList::bug_tracker
to print out upstream bug tracker URLs.
Where the user names a module that their bug report is about, and we know the URL for its upstream bug tracker, provide a message to the user explaining that the core copies the CPAN version directly, and provide the URL for reporting the bug directly to upstream.
Perl 5.11.0 added a new utility perlthanks, which is a variant of perlbug, but for sending non-bug-reports to the authors and maintainers of Perl. Getting nothing but bug reports can become a bit demoralising: we'll see if this changes things.
This contains instructions on how to build perl for the Haiku platform.
This describes the new interface for pluggable Method Resolution Orders.
This document, by Richard Foley, provides an introduction to the use of performance and optimization techniques which can be used with particular reference to perl programs.
This describes how to access the perl source using the git version control system.
The various large Changes* files (which listed every change made to perl over the last 18 years) have been removed, and replaced by a small file, also called Changes, which just explains how that same information may be extracted from the git version control system.
The file Porting/patching.pod has been deleted, as it mainly described interacting with the old Perforce-based repository, which is now obsolete. Information still relevant has been moved to perlrepository.
perlapi, perlintern, perlmodlib and perltoc are now all generated at build time, rather than being shipped as part of the release.
when()
treats specially most of the filetest operatorspod/perlthrtut.pod is the same material reworked for ithreads.
With version objects, we need them to use MODULE VERSION syntax. This patch removes the deprecation note.
isa()
will often be faster.C3
Method Resolution Order has been optimised - linearisation for classes with single inheritance is 40% faster. Performance for multiple inheritance is unchanged.use locale
, the locale-relevant information is now cached on read-only values, such as the list returned by keys %hash
. This makes operations such as sort keys %hash
in the scope of use locale
much faster.DESTROY
methods are no longer called.Perl_sv_utf8_upgrade()
keys
on empty hashThe layout of directories in ext has been revised. Specifically, all extensions are now flat, and at the top level, with /
in pathnames replaced by -
, so that ext/Data/Dumper/ is now ext/Data-Dumper/, etc. The names of the extensions as specified to Configure, and as reported by %Config::Config
under the keys dynamic_ext
, known_extensions
, nonxs_ext
and static_ext
have not changed, and still use /
. Hence this change will not have any affect once perl is installed. Safe
has been split out from being part of Opcode
, and mro
is now an extension in its own right.
Nearly all dual-life modules have been moved from lib to ext, and will now appear as known nonxs_ext
. This will made no difference to the structure of an installed perl, nor will the modules installed differ, unless you run Configure with options to specify an exact list of extensions to build. In this case, you will rapidly become aware that you need to add to your list, because various modules needed to complete the build, such as ExtUtils::ParseXS
, have now become extensions, and without them the build will fail well before it attempts to run the regression tests.
If vendorlib
and vendorarch
are the same, then they are only added to @INC
once.
$Config{usedevel}
and the C-level PERL_USE_DEVEL
are now defined if perl is built with -Dusedevel
.
Configure will enable use of -fstack-protector
, to provide protection against stack-smashing attacks, if the compiler supports it.
Configure will now determine the correct prototypes for re-entrant functions, and for gconvert
, if you are using a C++ compiler rather than a C compiler.
On Unix, if you build from a tree containing a git repository, the configuration process will note the commit hash you have checked out, for display in the output of perl -v
and perl -V
. Unpushed local commits are automatically added to the list of local patches displayed by perl -V
.
As part of the flattening of ext, all extensions on all platforms are built by make_ext.pl. This replaces the Unix-specific ext/util/make_ext, VMS-specific make_ext.com and Win32-specific win32/buildext.pl.
Removed libbsd for AIX 5L and 6.1. Only flock()
was used from libbsd.
Removed libgdbm for AIX 5L and 6.1. The libgdbm is delivered as an optional package with the AIX Toolbox. Unfortunately the 64 bit version is broken.
Hints changes mean that AIX 4.2 should work again.
On Cygwin we now strip the last number from the DLL. This has been the behaviour in the cygwin.com build for years. The hints files have been updated.
Support for Apollo DomainOS was removed in Perl 5.11.0
The hints files now identify the correct threading libraries on FreeBSD 7 and later.
We now work around a bizarre preprocessor bug in the Irix 6.5 compiler: cc -E -
unfortunately goes into K&R mode, but cc -E file.c
doesn't.
Patches from the Haiku maintainers have been merged in. Perl should now build on Haiku.
Support for Tenon Intersystems MachTen Unix layer for MacOS Classic was removed in Perl 5.11.0
Support for Atari MiNT was removed in Perl 5.11.0.
Perl should now build on MirOS BSD.
Hints now supports versions 5.*.
Various changes from Stratus have been merged in.
There is now support for Symbian S60 3.2 SDK and S60 5.0 SDK.
Improved message window handling means that alarm
and kill
messages will no longer be dropped under race conditions.
Reads from the in-memory temporary files of PerlIO::scalar
used to fail if $/
was set to a numeric reference (to indicate record-style reads). This is now fixed.
VMS now supports getgrgid
.
Many improvements and cleanups have been made to the VMS file name handling and conversion code.
Enabling the PERL_VMS_POSIX_EXIT
logical name now encodes a POSIX exit status in a VMS condition value for better interaction with GNV's bash shell and other utilities that depend on POSIX exit values. See "$?" in perlvms for details.
File::Copy
now detects Unix compatibility mode on VMS.
-I
on shebang line now adds directories in front of @INC as documented, and as does -I
when specified on the command-line.kill
is now fatal when called on non-numeric process identifiers. Previously, an 'undef' process identifier would be interpreted as a request to kill process "0", which would terminate the current process group on POSIX systems. Since process identifiers are always integers, killing a non-numeric process is now fatal.@_
. The optimisation has been re-instated, and the performance regression fixed.while (1) { map 1, 1 }
[RT #53038].m
command was broken on modules that defined constants [RT #61222].crypt
and string complement could return tainted values for untainted arguments [RT #59998].-i
.suffix command-line switch now recreates the file using restricted permissions, before changing its mode to match the original file. This eliminates a potential race condition [RT #60904].$?
would not have the top bit set ($? & 128
) even if the child core dumped.$^R
could incorrectly become undefined [RT #57042].$object->isa('Foo')
would report false if the package Foo
didn't exist, even if the object's @ISA
contained Foo
.@ISA
, have been found and fixed.$x=\$y; $x |= "foo"
[RT #54956].my $byte = chr(192); my $utf8 = chr(192); utf8::upgrade($utf8); $utf8 =~ /$byte|X}/i; # failed in 5.10.0
use utf8
is in effect), double-quoted literal strings could be corrupted where a \xNN
, \0NNN
or \N{}
is followed by a literal character with ordinal value greater than 255 [RT #59908].B::Deparse
failed to correctly deparse various constructs: readpipe STRING
[RT #62428], CORE::require(STRING)
[RT #62488], sub foo(_)
[RT #62484].setpgrp
with no arguments could corrupt the perl stack.eval
is now specifically trappable by Safe
and ops
. Previously it was erroneously treated like string eval
.[~
were sometimes parsed as the smart match operator (~~
) [RT #63854].*
quantifier in patterns was sometimes treated as {0,32767}
[RT #60034, #60464]. For example, this match would fail:
("ab" x 32768) =~ /^(ab)*$/
shmget
was limited to a 32 bit segment size on a 64 bit OS [RT #63924].next
or last
to exit a given
block no longer produces a spurious warning like the following:
Exiting given via last at foo.pl line 123
'.\foo'
and '..\foo'
were treated differently than './foo'
and '../foo'
by do
and require
[RT #63492].*bar=*foo{FORMAT}; # foo format now bad
Can't coerce GLOB to $type
.use filetest 'access'
, -x
was using the wrong access mode. This has been fixed [RT #49003].length
on a tied scalar that returned a Unicode value would not be correct the first time. This has been fixed.tie
inside in array tie
could SEGV. This has been fixed. [RT #51636]PerlIOStdio_close()
has been identified and fixed. This used to cause various threading issues, including SEGVs.unpack
, the use of ()
groups in scalar context was internally placing a list on the interpreter's stack, which manifested in various ways, including SEGVs. This is now fixed [RT #50256].substr
, \&$x
, tie $x, $m
and chop
. These have all been fixed.s///ge
has been reverted, as it turned out to be the cause of obscure bugs in seemingly unrelated parts of the interpreter [commit ef0d4e17921ee3de].elsif
are now correct...
operator now works correctly with ranges whose ends are at or close to the values of the smallest and largest integers.binmode STDIN, ':raw'
could lead to segmentation faults on some platforms. This has been fixed [RT #54828].index $str, ...
was effectively being executed as index "$str\0", ...
. This has been fixed [RT #53746].DBI
[RT #56908].tr//
within a closure could cause a segfault [RT #61520].Perl_sv_chop()
or otherwise upgrading an SV could result in an unaligned 64-bit access on the SPARC architecture [RT #60574].inc_version_list
would incorrectly list 5.10.*
after 5.8.*
; this affected the @INC
search order [RT #67628].pack "a*", $tainted_value
returned a non-tainted value [RT #52552].printf
and sprintf
could produce the fatal error panic: utf8_mg_pos_cache_update
when printing UTF-8 strings [RT #62666].AUTOLOAD
method might be missed (method cache issue) [RT #60220,60232].use feature
and //ee
could cause a memory leak [RT #63110].-C
on the shebang (#!
) line is once more permitted if it is also specified on the command line. -C
on the shebang line used to be a silent no-op if it was not also on the command line, so perl 5.10.0 disallowed it, which broke some scripts. Now perl checks whether it is also on the command line and only dies if it is not [RT #67880].Assertion rx->sublen >= (s - rx->subbeg) + i failed
TMPDIR
is now honored when opening an anonymous temporary filepanic: sv_chop %s
This new fatal error occurs when the C routine Perl_sv_chop()
was passed a position that is not within the scalar's string buffer. This could be caused by buggy XS code, and at this point recovery is not possible.
Can't locate package %s for the parents of %s
This warning has been removed. In general, it only got produced in conjunction with other warnings, and removing it allowed an ISA lookup optimisation to be added.
v-string in use/require is non-portable
This warning has been removed.
Deep recursion on subroutine "%s"
It is now possible to change the depth threshold for this warning from the default of 100, by recompiling the perl binary, setting the C pre-processor macro PERL_SUB_DEPTH_WARN
to the desired value.
SVt_RV
is gone. RVs are now stored in IVsPerl_vcroak()
now accepts a null first argument. In addition, a full audit was made of the "not NULL" compiler annotations, and those for several other internal functions were corrected.dSAVEDERRNO
, dSAVE_ERRNO
, SAVE_ERRNO
, RESTORE_ERRNO
have been added to formalise the temporary saving of the errno
variable.Perl_sv_insert_flags
has been added to augment Perl_sv_insert
.Perl_newSV_type(type)
has been added, equivalent to Perl_newSV()
followed by Perl_sv_upgrade(type)
.Perl_newSVpvn_flags()
has been added, equivalent to Perl_newSVpvn()
and then performing the action relevant to the flag.
Two flag bits are currently supported.
SVf_UTF8
This will call SvUTF8_on()
for you. (Note that this does not convert an sequence of ISO 8859-1 characters to UTF-8). A wrapper, newSVpvn_utf8()
is available for this.
SVs_TEMP
Call Perl_sv_2mortal()
on the new SV.
There is also a wrapper that takes constant strings, newSVpvs_flags()
.
Perl_croak_xs_usage
has been added as a wrapper to Perl_croak
.PerlIO_find_layer
and PerlIO_list_alloc
are now exported.PL_na
has been exterminated from the core code, replaced by local STRLEN temporaries, or *_nolen()
calls. Either approach is faster than PL_na
, which is a pointer deference into the interpreter structure under ithreads, and a global variable otherwise.Perl_mg_free()
used to leave freed memory accessible via SvMAGIC()
on the scalar. It now updates the linked list to remove each piece of magic as it is freed.PL_reg_curpm
is now reference counted. This eliminates a lot of hackish workarounds to cope with it not being reference counted.Perl_mg_magical()
would sometimes incorrectly turn on SvRMAGICAL()
. This has been fixed.-Dm
. The tracing can alternatively output via the PERL_MEM_LOG
mechanism, if that was enabled when the perl binary was compiled.-DM
to enable it.-DB
now dumps subroutine definitions, leaving -Dx
for its original purpose of dumping syntax trees.Nullav
, Nullcv
, Nullhv
, Nullop
, Nullsv
etc have been replaced by NULL
in the core code, and non-dual-life modules, as NULL
is clearer to those unfamiliar with the core code.MUTABLE_PTR(p)
has been added, which on (non-pedantic) gcc will not cast away const
, returning a void *
. Macros MUTABLE_SV(av)
, MUTABLE_SV(cv)
etc build on this, casting to AV *
etc without casting away const
. This allows proper compile-time auditing of const
correctness in the core, and helped picked up some errors (now fixed).mPUSHs()
and mXPUSHs()
have been added, for pushing SVs on the stack and mortalizing them.mro_meta
has changed slightly. Nothing outside the core should be accessing this directly anyway.Many modules updated from CPAN incorporate new tests.
Several tests that have the potential to hang forever if they fail now incorporate a "watchdog" functionality that will kill them after a timeout, which helps ensure that make test
and make test_harness
run to completion automatically. (Jerry Hedden).
Some core-specific tests have been added:
Check that the debugger can retain source lines from eval
.
Check that bad layers fail.
Check that PerlIO layers are not leaking.
Check that certain special forms of open work.
General PerlIO tests.
Check that there is no unexpected interaction between the internal types PVBM
and PVGV
.
Check that mro works properly in the presence of aliased packages.
Tests for dbmopen
and dbmclose
.
Tests for the interaction of index
and threads.
Tests for the interaction of esoteric patterns and threads.
Test that qr
doesn't leak.
Tests for the interaction of regex recursion and threads.
Tests for the interaction of patterns with embedded qr//
and threads.
Tests for Unicode properties in regular expressions.
Tests for the interaction of Unicode properties and threads.
Test the tied methods of Tie::Hash::NamedCapture
.
Check that POSIX character classes behave consistently.
Check that exportable re
functions in universal.c work.
Check that setpgrp
works.
Tests for the interaction of substr
and threads.
Check that upgrading and assigning scalars works.
Check that Unicode in the lexer works.
Check that Unicode and tie
work.
This is a list of some significant unfixed bugs, which are regressions from either 5.10.0 or 5.8.x.
List::Util::first
misbehaves in the presence of a lexical $_
(typically introduced by my $_
or implicitly by given
). The variable which gets set for each iteration is the package variable $_
, not the lexical $_
[RT #67694].
A similar issue may occur in other modules that provide functions which take a block as their first argument, like
foo { ... $_ ...} list
charnames
pragma may generate a run-time error when a regex is interpolated [RT #56444]:
use charnames ':full'; my $r1 = qr/\N{THAI CHARACTER SARA I}/; "foo" =~ $r1; # okay "foo" =~ /$r1+/; # runtime error
A workaround is to generate the character outside of the regex:
my $a = "\N{THAI CHARACTER SARA I}"; my $r1 = qr/$a/;
The following items are now deprecated.
Switch
is buggy and should be avoided. From perl 5.11.0 onwards, it is intended that any use of the core version of this module will emit a warning, and that the module will eventually be removed from the core (probably in perl 5.14.0). See "Switch statements" in perlsyn for its replacement.Class::ISA
Pod::Plainer
Shell
Currently support to install from CPAN without a force is TODO
in CPAN and CPANPLUS. This will be addressed before 5.12.0 ships.
suidperl
has been removed. It used to provide a mechanism to emulate setuid permission bits on systems that don't support it properly.This uses a new warnings category: "imprecision".
They are now very similar to those produced by Algorithm::C3.
Changes the error message to "Unrecognized character %s; marked by <-- HERE after %s<-- HERE near column %d". This should make it a little simpler to spot and correct the suspicious character.
termcap.pl, tainted.pl, stat.pl, shellwords.pl, pwd.pl, open3.pl, open2.pl, newgetopt.pl, look.pl, find.pl, finddepth.pl, importenv.pl, hostname.pl, getopts.pl, getopt.pl, getcwd.pl, flush.pl, fastcwd.pl, exceptions.pl, ctime.pl, complete.pl, cacheout.pl, bigrat.pl, bigint.pl, bigfloat.pl, assert.pl, abbrev.pl, dotsh.pl, and timelocal.pl are all now deprecated. Using them will incur a warning.
Some of the work in this release was funded by a TPF grant funded by Dijkmat BV, The Netherlands.
Steffen Mueller and David Golden in particular helped getting CPAN modules polished and synchronised with their in-core equivalents.
Craig Berry was tireless in getting maint to run under VMS, no matter how many times we broke it for him.
The other core committers contributed most of the changes, and applied most of the patches sent in by the hundreds of contributors listed in AUTHORS.
Much of the work of categorizing changes in this perldelta file was contributed by the following porters using changelogger.bestpractical.com:
Nicholas Clark, leon, shawn, alexm, rjbs, rafl, Pedro Melo, brunorc, anonymous, ☄, Tom Hukins, anonymous, Jesse, dagolden, Moritz Onken, Mark Fowler, chorny, anonymous, tmtm
Finally, thanks to Larry Wall, without whom none of this would be necessary.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5101delta - what is new for perl v5.10.1
This document describes differences between the 5.10.0 release and the 5.10.1 release.
If you are upgrading from an earlier release such as 5.8.8, first read the "p5100-NAME", which describes differences between 5.8.8 and 5.10.0
The handling of complex expressions by the given
/when
switch statement has been enhanced. There are two new cases where when
now interprets its argument as a boolean, instead of an expression to be used in a smart match:
The ..
and ...
flip-flop operators are now evaluated in boolean context, following their usual semantics; see "Range Operators" in perlop.
Note that, as in perl 5.10.0, when (1..10)
will not work to test whether a given value is an integer between 1 and 10; you should use when ([1..10])
instead (note the array reference).
However, contrary to 5.10.0, evaluating the flip-flop operators in boolean context ensures it can now be useful in a when()
, notably for implementing bistable conditions, like in:
when (/^=begin/ .. /^=end/) { # do something }
A compound expression involving the defined-or operator, as in when (expr1 // expr2)
, will be treated as boolean if the first expression is boolean. (This just extends the existing rule that applies to the regular or operator, as in when (expr1 || expr2)
.)
The next section details more changes brought to the semantics to the smart match operator, that naturally also modify the behaviour of the switch statements where smart matching is implicitly used.
The smart match operator ~~
is no longer commutative. The behaviour of a smart match now depends primarily on the type of its right hand argument. Moreover, its semantics have been adjusted for greater consistency or usefulness in several cases. While the general backwards compatibility is maintained, several changes must be noted:
%hash ~~ sub {}
and @array ~~ sub {}
now test that the subroutine returns a true value for each key of the hash (or element of the array), instead of passing the whole hash or array as a reference to the subroutine.~~
operator, but like any vulgar scalar.undef ~~ %hash
is always false (since undef
can't be a key in a hash). No implicit conversion to ""
is done (as was the case in perl 5.10.0).$scalar ~~ @array
now always distributes the smart match across the elements of the array. It's true if one element in @array verifies $scalar ~~ $element
. This is a generalization of the old behaviour that tested whether the array contained the scalar.The full dispatch table for the smart match operator is given in "Smart matching in detail" in perlsyn.
According to the rule of dispatch based on the rightmost argument type, when an object overloading ~~
appears on the right side of the operator, the overload routine will always be called (with a 3rd argument set to a true value, see overload.) However, when the object will appear on the left, the overload routine will be called only when the rightmost argument is a simple scalar. This way distributivity of smart match across arrays is not broken, as well as the other behaviours with complex types (coderefs, hashes, regexes). Thus, writers of overloading routines for smart match mostly need to worry only with comparing against a scalar, and possibly with stringification overloading; the other common cases will be automatically handled consistently.
~~
will now refuse to work on objects that do not overload it (in order to avoid relying on the object's underlying structure). (However, if the object overloads the stringification or the numification operators, and if overload fallback is active, it will be used instead, as usual.)
use feature :5.10*
have changed slightly. See "p5101-Modules and Pragmata" for more information.~~
with an object that has no overload defined for it. (This way ~~
will not break encapsulation by matching against the object's internal representation as a reference.)perl -V
. See perlrepository for more information.ext/
directory in the perl source has been reorganised. In general, a module Foo::Bar
whose source was stored under ext/Foo/Bar/ is now located under ext/Foo-Bar/. Also, some modules have been moved from lib/ to ext/. This is purely a source tarball change, and should make no difference to the compilation or installation of perl, unless you have a very customised build process that explicitly relies on this structure, or which hard-codes the nonxs_ext
Configure parameter. Specifically, this change does not by default alter the location of any files in the final installation.Test::Harness
2.x to 3.x upgrade, the experimental Test::Harness::Straps
module has been removed. See "p5101-Updated Modules" for more details.ExtUtils::MakeMaker
upgrade, the ExtUtils::MakeMaker::bytes
and ExtUtils::MakeMaker::vmsish
modules have been removed from this distribution.Module::CoreList
no longer contains the %:patchlevel
hash.A bugfix related to the handling of the /m
modifier and qr
resulted in a change of behaviour between 5.8.x and 5.10.0:
# matches in 5.8.x, doesn't match in 5.10.0 $re = qr/^bar/; "foo\nbar" =~ /$re/m;
The copy of the Unicode Character Database included in Perl 5.10.1 has been updated to 5.1.0 from 5.0.0. See http://www.unicode.org/versions/Unicode5.1.0/#Notable_Changes for the notable changes.
As of Perl 5.10.1 there is a new interface for plugging and using method resolution orders other than the default (linear depth first search). The C3 method resolution order added in 5.10.0 has been re-implemented as a plugin, without changing its Perl-space interface. See perlmroapi for more information.
overloading
pragmaThis pragma allows you to lexically disable or enable overloading for some or all operations. (Yuval Kogman)
The core distribution can now run its regression tests in parallel on Unix-like platforms. Instead of running make test
, set TEST_JOBS
in your environment to the number of tests to run in parallel, and run make test_harness
. On a Bourne-like shell, this can be done as
TEST_JOBS=3 make test_harness # Run 3 tests in parallel
An environment variable is used, rather than parallel make itself, because TAP::Harness needs to be able to schedule individual non-conflicting test scripts itself, and there is no standard interface to make
utilities to interact with their job schedulers.
Note that currently some test scripts may fail when run in parallel (most notably ext/IO/t/io_dir.t
). If necessary run just the failing scripts again sequentially and see if the failures go away.
Some support for DTrace has been added. See "DTrace support" in INSTALL.
configure_requires
in CPAN module metadataBoth CPAN
and CPANPLUS
now support the configure_requires
keyword in the META.yml
metadata file included in most recent CPAN distributions. This allows distribution authors to specify configuration prerequisites that must be installed before running Makefile.PL or Build.PL.
See the documentation for ExtUtils::MakeMaker
or Module::Build
for more on how to specify configure_requires
when creating a distribution for CPAN.
autodie
This is a new lexically-scoped alternative for the Fatal
module. The bundled version is 2.06_01. Note that in this release, using a string eval when autodie
is in effect can cause the autodie behaviour to leak into the surrounding scope. See "BUGS" in autodie for more details.
Compress::Raw::Bzip2
This has been added to the core (version 2.020).
parent
This pragma establishes an ISA relationship with base classes at compile time. It provides the key feature of base
without the feature creep.
Parse::CPAN::Meta
This has been added to the core (version 1.39).
attributes
Upgraded from version 0.08 to 0.09.
attrs
Upgraded from version 1.02 to 1.03.
base
Upgraded from version 2.13 to 2.14. See parent for a replacement.
bigint
Upgraded from version 0.22 to 0.23.
bignum
Upgraded from version 0.22 to 0.23.
bigrat
Upgraded from version 0.22 to 0.23.
charnames
Upgraded from version 1.06 to 1.07.
The Unicode NameAliases.txt database file has been added. This has the effect of adding some extra \N
character names that formerly wouldn't have been recognised; for example, "\N{LATIN CAPITAL LETTER GHA}"
.
constant
Upgraded from version 1.13 to 1.17.
feature
The meaning of the :5.10
and :5.10.X
feature bundles has changed slightly. The last component, if any (i.e. X
) is simply ignored. This is predicated on the assumption that new features will not, in general, be added to maintenance releases. So :5.10
and :5.10.X
have identical effect. This is a change to the behaviour documented for 5.10.0.
fields
Upgraded from version 2.13 to 2.14 (this was just a version bump; there were no functional changes).
lib
Upgraded from version 0.5565 to 0.62.
open
Upgraded from version 1.06 to 1.07.
overload
Upgraded from version 1.06 to 1.07.
overloading
See "p5101-The overloading
pragma" above.
version
Upgraded from version 0.74 to 0.77.
Archive::Extract
Upgraded from version 0.24 to 0.34.
Archive::Tar
Upgraded from version 1.38 to 1.52.
Attribute::Handlers
Upgraded from version 0.79 to 0.85.
AutoLoader
Upgraded from version 5.63 to 5.68.
AutoSplit
Upgraded from version 1.05 to 1.06.
B
Upgraded from version 1.17 to 1.22.
B::Debug
Upgraded from version 1.05 to 1.11.
B::Deparse
Upgraded from version 0.83 to 0.89.
B::Lint
Upgraded from version 1.09 to 1.11.
B::Xref
Upgraded from version 1.01 to 1.02.
Benchmark
Upgraded from version 1.10 to 1.11.
Carp
Upgraded from version 1.08 to 1.11.
CGI
Upgraded from version 3.29 to 3.43. (also includes the "default_value for popup_menu()" fix from 3.45).
Compress::Zlib
Upgraded from version 2.008 to 2.020.
CPAN
Upgraded from version 1.9205 to 1.9402. CPAN::FTP
has a local fix to stop it being too verbose on download failure.
CPANPLUS
Upgraded from version 0.84 to 0.88.
CPANPLUS::Dist::Build
Upgraded from version 0.06_02 to 0.36.
Cwd
Upgraded from version 3.25_01 to 3.30.
Data::Dumper
Upgraded from version 2.121_14 to 2.124.
DB
Upgraded from version 1.01 to 1.02.
DB_File
Upgraded from version 1.816_1 to 1.820.
Devel::PPPort
Upgraded from version 3.13 to 3.19.
Digest::MD5
Upgraded from version 2.36_01 to 2.39.
Digest::SHA
Upgraded from version 5.45 to 5.47.
DirHandle
Upgraded from version 1.01 to 1.03.
Dumpvalue
Upgraded from version 1.12 to 1.13.
DynaLoader
Upgraded from version 1.08 to 1.10.
Encode
Upgraded from version 2.23 to 2.35.
Errno
Upgraded from version 1.10 to 1.11.
Exporter
Upgraded from version 5.62 to 5.63.
ExtUtils::CBuilder
Upgraded from version 0.21 to 0.2602.
ExtUtils::Command
Upgraded from version 1.13 to 1.16.
ExtUtils::Constant
Upgraded from 0.20 to 0.22. (Note that neither of these versions are available on CPAN.)
ExtUtils::Embed
Upgraded from version 1.27 to 1.28.
ExtUtils::Install
Upgraded from version 1.44 to 1.54.
ExtUtils::MakeMaker
Upgraded from version 6.42 to 6.55_02.
Note that ExtUtils::MakeMaker::bytes
and ExtUtils::MakeMaker::vmsish
have been removed from this distribution.
ExtUtils::Manifest
Upgraded from version 1.51_01 to 1.56.
ExtUtils::ParseXS
Upgraded from version 2.18_02 to 2.2002.
Fatal
Upgraded from version 1.05 to 2.06_01. See also the new pragma autodie
.
File::Basename
Upgraded from version 2.76 to 2.77.
File::Compare
Upgraded from version 1.1005 to 1.1006.
File::Copy
Upgraded from version 2.11 to 2.14.
File::Fetch
Upgraded from version 0.14 to 0.20.
File::Find
Upgraded from version 1.12 to 1.14.
File::Path
Upgraded from version 2.04 to 2.07_03.
File::Spec
Upgraded from version 3.2501 to 3.30.
File::stat
Upgraded from version 1.00 to 1.01.
File::Temp
Upgraded from version 0.18 to 0.22.
FileCache
Upgraded from version 1.07 to 1.08.
FileHandle
Upgraded from version 2.01 to 2.02.
Filter::Simple
Upgraded from version 0.82 to 0.84.
Filter::Util::Call
Upgraded from version 1.07 to 1.08.
FindBin
Upgraded from version 1.49 to 1.50.
GDBM_File
Upgraded from version 1.08 to 1.09.
Getopt::Long
Upgraded from version 2.37 to 2.38.
Hash::Util::FieldHash
Upgraded from version 1.03 to 1.04. This fixes a memory leak.
I18N::Collate
Upgraded from version 1.00 to 1.01.
IO
Upgraded from version 1.23_01 to 1.25.
This makes non-blocking mode work on Windows in IO::Socket::INET
[CPAN #43573].
IO::Compress::*
Upgraded from version 2.008 to 2.020.
IO::Dir
Upgraded from version 1.06 to 1.07.
IO::Handle
Upgraded from version 1.27 to 1.28.
IO::Socket
Upgraded from version 1.30_01 to 1.31.
IO::Zlib
Upgraded from version 1.07 to 1.09.
IPC::Cmd
Upgraded from version 0.40_1 to 0.46.
IPC::Open3
Upgraded from version 1.02 to 1.04.
IPC::SysV
Upgraded from version 1.05 to 2.01.
lib
Upgraded from version 0.5565 to 0.62.
List::Util
Upgraded from version 1.19 to 1.21.
Locale::MakeText
Upgraded from version 1.12 to 1.13.
Log::Message
Upgraded from version 0.01 to 0.02.
Math::BigFloat
Upgraded from version 1.59 to 1.60.
Math::BigInt
Upgraded from version 1.88 to 1.89.
Math::BigInt::FastCalc
Upgraded from version 0.16 to 0.19.
Math::BigRat
Upgraded from version 0.21 to 0.22.
Math::Complex
Upgraded from version 1.37 to 1.56.
Math::Trig
Upgraded from version 1.04 to 1.20.
Memoize
Upgraded from version 1.01_02 to 1.01_03 (just a minor documentation change).
Module::Build
Upgraded from version 0.2808_01 to 0.34_02.
Module::CoreList
Upgraded from version 2.13 to 2.18. This release no longer contains the %Module::CoreList::patchlevel
hash.
Module::Load
Upgraded from version 0.12 to 0.16.
Module::Load::Conditional
Upgraded from version 0.22 to 0.30.
Module::Loaded
Upgraded from version 0.01 to 0.02.
Module::Pluggable
Upgraded from version 3.6 to 3.9.
NDBM_File
Upgraded from version 1.07 to 1.08.
Net::Ping
Upgraded from version 2.33 to 2.36.
NEXT
Upgraded from version 0.60_01 to 0.64.
Object::Accessor
Upgraded from version 0.32 to 0.34.
OS2::REXX
Upgraded from version 1.03 to 1.04.
Package::Constants
Upgraded from version 0.01 to 0.02.
PerlIO
Upgraded from version 1.04 to 1.06.
PerlIO::via
Upgraded from version 0.04 to 0.07.
Pod::Man
Upgraded from version 2.16 to 2.22.
Pod::Parser
Upgraded from version 1.35 to 1.37.
Pod::Simple
Upgraded from version 3.05 to 3.07.
Pod::Text
Upgraded from version 3.08 to 3.13.
POSIX
Upgraded from version 1.13 to 1.17.
Safe
Upgraded from 2.12 to 2.18.
Scalar::Util
Upgraded from version 1.19 to 1.21.
SelectSaver
Upgraded from 1.01 to 1.02.
SelfLoader
Upgraded from 1.11 to 1.17.
Socket
Upgraded from 1.80 to 1.82.
Storable
Upgraded from 2.18 to 2.20.
Switch
Upgraded from version 2.13 to 2.14. Please see "p5101-Deprecations".
Symbol
Upgraded from version 1.06 to 1.07.
Sys::Syslog
Upgraded from version 0.22 to 0.27.
Term::ANSIColor
Upgraded from version 1.12 to 2.00.
Term::ReadLine
Upgraded from version 1.03 to 1.04.
Term::UI
Upgraded from version 0.18 to 0.20.
Test::Harness
Upgraded from version 2.64 to 3.17.
Note that one side-effect of the 2.x to 3.x upgrade is that the experimental Test::Harness::Straps
module (and its supporting Assert
, Iterator
, Point
and Results
modules) have been removed. If you still need this, then they are available in the (unmaintained) Test-Harness-Straps
distribution on CPAN.
Test::Simple
Upgraded from version 0.72 to 0.92.
Text::ParseWords
Upgraded from version 3.26 to 3.27.
Text::Tabs
Upgraded from version 2007.1117 to 2009.0305.
Text::Wrap
Upgraded from version 2006.1117 to 2009.0305.
Thread::Queue
Upgraded from version 2.00 to 2.11.
Thread::Semaphore
Upgraded from version 2.01 to 2.09.
threads
Upgraded from version 1.67 to 1.72.
threads::shared
Upgraded from version 1.14 to 1.29.
Tie::RefHash
Upgraded from version 1.37 to 1.38.
Tie::StdHandle
This has documentation changes, and has been assigned a version for the first time: version 4.2.
Time::HiRes
Upgraded from version 1.9711 to 1.9719.
Time::Local
Upgraded from version 1.18 to 1.1901.
Time::Piece
Upgraded from version 1.12 to 1.15.
Unicode::Normalize
Upgraded from version 1.02 to 1.03.
Unicode::UCD
Upgraded from version 0.25 to 0.27.
charinfo()
now works on Unified CJK code points added to later versions of Unicode.
casefold()
has new fields returned to provide both a simpler interface and previously missing information. The old fields are retained for backwards compatibility. Information about Turkic-specific code points is now returned.
The documentation has been corrected and expanded.
UNIVERSAL
Upgraded from version 1.04 to 1.05.
Win32
Upgraded from version 0.34 to 0.39.
Win32API::File
Upgraded from version 0.1001_01 to 0.1101.
XSLoader
Upgraded from version 0.08 to 0.10.
Now looks in include-fixed
too, which is a recent addition to gcc's search path.
No longer incorrectly treats enum values like macros (Daniel Burr).
Now handles C++ style constants (//
) properly in enums. (A patch from Rainer Weikusat was used; Daniel Burr also proposed a similar fix).
LVALUE
subroutines now work under the debugger.
The debugger now correctly handles proxy constant subroutines, and subroutine stubs.
Perl 5.10.1 adds a new utility perlthanks, which is a variant of perlbug, but for sending non-bug-reports to the authors and maintainers of Perl. Getting nothing but bug reports can become a bit demoralising: we'll see if this changes things.
This contains instructions on how to build perl for the Haiku platform.
This describes the new interface for pluggable Method Resolution Orders.
This document, by Richard Foley, provides an introduction to the use of performance and optimization techniques which can be used with particular reference to perl programs.
This describes how to access the perl source using the git version control system.
This describes the new perlthanks utility.
The various large Changes*
files (which listed every change made to perl over the last 18 years) have been removed, and replaced by a small file, also called Changes
, which just explains how that same information may be extracted from the git version control system.
The file Porting/patching.pod has been deleted, as it mainly described interacting with the old Perforce-based repository, which is now obsolete. Information still relevant has been moved to perlrepository.
perlapi, perlintern, perlmodlib and perltoc are now all generated at build time, rather than being shipped as part of the release.
isa()
will often be faster.use locale
, the locale-relevant information is now cached on read-only values, such as the list returned by keys %hash
. This makes operations such as sort keys %hash
in the scope of use locale
much faster.DESTROY
methods are no longer called.The layout of directories in ext has been revised. Specifically, all extensions are now flat, and at the top level, with /
in pathnames replaced by -
, so that ext/Data/Dumper/ is now ext/Data-Dumper/, etc. The names of the extensions as specified to Configure, and as reported by %Config::Config
under the keys dynamic_ext
, known_extensions
, nonxs_ext
and static_ext
have not changed, and still use /
. Hence this change will not have any affect once perl is installed. However, Attribute::Handlers
, Safe
and mro
have now become extensions in their own right, so if you run Configure with options to specify an exact list of extensions to build, you will need to change it to account for this.
For 5.10.2, it is planned that many dual-life modules will have been moved from lib to ext; again this will have no effect on an installed perl, but will matter if you invoke Configure with a pre-canned list of extensions to build.
If vendorlib
and vendorarch
are the same, then they are only added to @INC
once.
$Config{usedevel}
and the C-level PERL_USE_DEVEL
are now defined if perl is built with -Dusedevel
.
Configure will enable use of -fstack-protector
, to provide protection against stack-smashing attacks, if the compiler supports it.
Configure will now determine the correct prototypes for re-entrant functions, and for gconvert
, if you are using a C++ compiler rather than a C compiler.
On Unix, if you build from a tree containing a git repository, the configuration process will note the commit hash you have checked out, for display in the output of perl -v
and perl -V
. Unpushed local commits are automatically added to the list of local patches displayed by perl -V
.
As part of the flattening of ext, all extensions on all platforms are built by make_ext.pl. This replaces the Unix-specific ext/util/make_ext, VMS-specific make_ext.com and Win32-specific win32/buildext.pl.
Removed libbsd for AIX 5L and 6.1. Only flock() was used from libbsd.
Removed libgdbm for AIX 5L and 6.1. The libgdbm is delivered as an optional package with the AIX Toolbox. Unfortunately the 64 bit version is broken.
Hints changes mean that AIX 4.2 should work again.
On Cygwin we now strip the last number from the DLL. This has been the behaviour in the cygwin.com build for years. The hints files have been updated.
The hints files now identify the correct threading libraries on FreeBSD 7 and later.
We now work around a bizarre preprocessor bug in the Irix 6.5 compiler: cc -E -
unfortunately goes into K&R mode, but cc -E file.c
doesn't.
Patches from the Haiku maintainers have been merged in. Perl should now build on Haiku.
Perl should now build on MirOS BSD.
Hints now supports versions 5.*.
Various changes from Stratus have been merged in.
There is now support for Symbian S60 3.2 SDK and S60 5.0 SDK.
Improved message window handling means that alarm
and kill
messages will no longer be dropped under race conditions.
Reads from the in-memory temporary files of PerlIO::scalar
used to fail if $/
was set to a numeric reference (to indicate record-style reads). This is now fixed.
VMS now supports getgrgid
.
Many improvements and cleanups have been made to the VMS file name handling and conversion code.
Enabling the PERL_VMS_POSIX_EXIT
logical name now encodes a POSIX exit status in a VMS condition value for better interaction with GNV's bash shell and other utilities that depend on POSIX exit values. See "$?" in perlvms for details.
@_
. The optimisation has been re-instated, and the performance regression fixed.while (1) { map 1, 1 }
[RT #53038].m
command was broken on modules that defined constants [RT #61222].crypt()
and string complement could return tainted values for untainted arguments [RT #59998].-i.suffix
command-line switch now recreates the file using restricted permissions, before changing its mode to match the original file. This eliminates a potential race condition [RT #60904].$?
would not have the top bit set ($? & 128
) even if the child core dumped.$object->isa('Foo')
would report false if the package Foo
didn't exist, even if the object's @ISA
contained Foo
.@ISA
, have been found and fixed.$x=\$y; $x |= "foo"
[RT #54956].my $byte = chr(192); my $utf8 = chr(192); utf8::upgrade($utf8); $utf8 =~ /$byte|X}/i; # failed in 5.10.0
use utf8
is in effect), double-quoted literal strings could be corrupted where a \xNN
, \0NNN
or \N{}
is followed by a literal character with ordinal value greater than 255 [RT #59908].B::Deparse
failed to correctly deparse various constructs: readpipe STRING
[RT #62428], CORE::require(STRING)
[RT #62488], sub foo(_)
[RT #62484].setpgrp()
with no arguments could corrupt the perl stack.eval
is now specifically trappable by Safe
and ops
. Previously it was erroneously treated like string eval
.[~
were sometimes parsed as the smart match operator (~~
) [RT #63854].*
quantifier in patterns was sometimes treated as {0,32767}
[RT #60034, #60464]. For example, this match would fail:
("ab" x 32768) =~ /^(ab)*$/
shmget
was limited to a 32 bit segment size on a 64 bit OS [RT #63924].next
or last
to exit a given
block no longer produces a spurious warning like the following:
Exiting given via last at foo.pl line 123
'.\foo'
and '..\foo'
were treated differently than './foo'
and '../foo'
by do
and require
[RT #63492].*bar=*foo{FORMAT}; # foo format now bad
Can't coerce GLOB to $type
.use filetest 'access'
, -x
was using the wrong access mode. This has been fixed [RT #49003].length
on a tied scalar that returned a Unicode value would not be correct the first time. This has been fixed.tie
inside in array tie
could SEGV. This has been fixed. [RT #51636]PerlIOStdio_close()
has been identified and fixed. This used to cause various threading issues, including SEGVs.unpack
, the use of ()
groups in scalar context was internally placing a list on the interpreter's stack, which manifested in various ways, including SEGVs. This is now fixed [RT #50256].substr
, \&$x
, tie $x, $m
and chop
. These have all been fixed.s///ge
has been reverted, as it turned out to be the cause of obscure bugs in seemingly unrelated parts of the interpreter [commit ef0d4e17921ee3de].elsif
are now correct...
operator now works correctly with ranges whose ends are at or close to the values of the smallest and largest integers.binmode STDIN, ':raw'
could lead to segmentation faults on some platforms. This has been fixed [RT #54828].index $str, ...
was effectively being executed as index "$str\0", ...
. This has been fixed [RT #53746].DBI
[RT #56908].tr//
within a closure could cause a segfault [RT #61520].sv_chop()
or otherwise upgrading an SV could result in an unaligned 64-bit access on the SPARC architecture [RT #60574].inc_version_list
would incorrectly list 5.10.*
after 5.8.*
; this affected the @INC
search order [RT #67628].pack "a*", $tainted_value
returned a non-tainted value [RT #52552].printf
and sprintf
could produce the fatal error panic: utf8_mg_pos_cache_update
when printing UTF-8 strings [RT #62666].AUTOLOAD
method might be missed (method cache issue) [RT #60220,60232].use feature
and //ee
could cause a memory leak [RT #63110].-C
on the shebang (#!
) line is once more permitted if it is also specified on the command line. -C
on the shebang line used to be a silent no-op if it was not also on the command line, so perl 5.10.0 disallowed it, which broke some scripts. Now perl checks whether it is also on the command line and only dies if it is not [RT #67880].Assertion rx->sublen >= (s - rx->subbeg) + i failed
panic: sv_chop %s
This new fatal error occurs when the C routine Perl_sv_chop()
was passed a position that is not within the scalar's string buffer. This could be caused by buggy XS code, and at this point recovery is not possible.
Can't locate package %s for the parents of %s
This warning has been removed. In general, it only got produced in conjunction with other warnings, and removing it allowed an ISA lookup optimisation to be added.
v-string in use/require is non-portable
This warning has been removed.
Deep recursion on subroutine "%s"
It is now possible to change the depth threshold for this warning from the default of 100, by recompiling the perl binary, setting the C pre-processor macro PERL_SUB_DEPTH_WARN
to the desired value.
vcroak()
now accepts a null first argument. In addition, a full audit was made of the "not NULL" compiler annotations, and those for several other internal functions were corrected.dSAVEDERRNO
, dSAVE_ERRNO
, SAVE_ERRNO
, RESTORE_ERRNO
have been added to formalise the temporary saving of the errno
variable.Perl_sv_insert_flags
has been added to augment Perl_sv_insert
.Perl_newSV_type(type)
has been added, equivalent to Perl_newSV()
followed by Perl_sv_upgrade(type)
.Perl_newSVpvn_flags()
has been added, equivalent to Perl_newSVpvn()
and then performing the action relevant to the flag.
Two flag bits are currently supported.
SVf_UTF8
This will call SvUTF8_on()
for you. (Note that this does not convert an sequence of ISO 8859-1 characters to UTF-8). A wrapper, newSVpvn_utf8()
is available for this.
SVs_TEMP
Call sv_2mortal()
on the new SV.
There is also a wrapper that takes constant strings, newSVpvs_flags()
.
Perl_croak_xs_usage
has been added as a wrapper to Perl_croak
.PerlIO_find_layer
and PerlIO_list_alloc
are now exported.PL_na
has been exterminated from the core code, replaced by local STRLEN temporaries, or *_nolen()
calls. Either approach is faster than PL_na
, which is a pointer deference into the interpreter structure under ithreads, and a global variable otherwise.Perl_mg_free()
used to leave freed memory accessible via SvMAGIC() on the scalar. It now updates the linked list to remove each piece of magic as it is freed.PL_reg_curpm
is now reference counted. This eliminates a lot of hackish workarounds to cope with it not being reference counted.Perl_mg_magical()
would sometimes incorrectly turn on SvRMAGICAL()
. This has been fixed.-Dm
. The tracing can alternatively output via the PERL_MEM_LOG
mechanism, if that was enabled when the perl binary was compiled.Nullav
, Nullcv
, Nullhv
, Nullop
, Nullsv
etc have been replaced by NULL
in the core code, and non-dual-life modules, as NULL
is clearer to those unfamiliar with the core code.MUTABLE_PTR(p)
has been added, which on (non-pedantic) gcc will not cast away const
, returning a void *
. Macros MUTABLE_SV(av)
, MUTABLE_SV(cv)
etc build on this, casting to AV *
etc without casting away const
. This allows proper compile-time auditing of const
correctness in the core, and helped picked up some errors (now fixed).mPUSHs()
and mXPUSHs()
have been added, for pushing SVs on the stack and mortalizing them.mro_meta
has changed slightly. Nothing outside the core should be accessing this directly anyway.Porting/expand-macro.pl
has been added, that allows you to view how a C preprocessor macro would be expanded when compiled. This is handy when trying to decode the macro hell that is the perl guts.Many modules updated from CPAN incorporate new tests.
Several tests that have the potential to hang forever if they fail now incorporate a "watchdog" functionality that will kill them after a timeout, which helps ensure that make test
and make test_harness
run to completion automatically. (Jerry Hedden).
Some core-specific tests have been added:
Check that the debugger can retain source lines from eval
.
Check that bad layers fail.
Check that PerlIO layers are not leaking.
Check that certain special forms of open work.
General PerlIO tests.
Check that there is no unexpected interaction between the internal types PVBM
and PVGV
.
Check that mro works properly in the presence of aliased packages.
Tests for dbmopen
and dbmclose
.
Tests for the interaction of index
and threads.
Tests for the interaction of esoteric patterns and threads.
Test that qr
doesn't leak.
Tests for the interaction of regex recursion and threads.
Tests for the interaction of patterns with embedded qr//
and threads.
Tests for Unicode properties in regular expressions.
Tests for the interaction of Unicode properties and threads.
Test the tied methods of Tie::Hash::NamedCapture
.
Check that POSIX character classes behave consistently.
Check that exportable re
functions in universal.c work.
Check that setpgrp
works.
Tests for the interaction of substr
and threads.
Check that upgrading and assigning scalars works.
Check that Unicode in the lexer works.
Check that Unicode and tie
work.
This is a list of some significant unfixed bugs, which are regressions from either 5.10.0 or 5.8.x.
List::Util::first
misbehaves in the presence of a lexical $_
(typically introduced by my $_
or implicitly by given
). The variable which gets set for each iteration is the package variable $_
, not the lexical $_
[RT #67694].
A similar issue may occur in other modules that provide functions which take a block as their first argument, like
foo { ... $_ ...} list
charnames
pragma may generate a run-time error when a regex is interpolated [RT #56444]:
use charnames ':full'; my $r1 = qr/\N{THAI CHARACTER SARA I}/; "foo" =~ $r1; # okay "foo" =~ /$r1+/; # runtime error
A workaround is to generate the character outside of the regex:
my $a = "\N{THAI CHARACTER SARA I}"; my $r1 = qr/$a/;
The following items are now deprecated.
Switch
is buggy and should be avoided. From perl 5.11.0 onwards, it is intended that any use of the core version of this module will emit a warning, and that the module will eventually be removed from the core (probably in perl 5.14.0). See "Switch statements" in perlsyn for its replacement.suidperl
will be removed in 5.12.0. This provides a mechanism to emulate setuid permission bits on systems that don't support it properly.Some of the work in this release was funded by a TPF grant.
Nicholas Clark officially retired from maintenance pumpking duty at the end of 2008; however in reality he has put much effort in since then to help get 5.10.1 into a fit state to be released, including writing a considerable chunk of this perldelta.
Steffen Mueller and David Golden in particular helped getting CPAN modules polished and synchronised with their in-core equivalents.
Craig Berry was tireless in getting maint to run under VMS, no matter how many times we broke it for him.
The other core committers contributed most of the changes, and applied most of the patches sent in by the hundreds of contributors listed in AUTHORS.
(Sorry to all the people I haven't mentioned by name).
Finally, thanks to Larry Wall, without whom none of this would be necessary.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl5100delta - what is new for perl 5.10.0
This document describes the differences between the 5.8.8 release and the 5.10.0 release.
Many of the bug fixes in 5.10.0 were already seen in the 5.8.X maintenance releases; they are not duplicated here and are documented in the set of man pages named perl58[1-8]?delta.
feature
pragmaThe feature
pragma is used to enable new syntax that would break Perl's backwards-compatibility with older releases of the language. It's a lexical pragma, like strict
or warnings
.
Currently the following new features are available: switch
(adds a switch statement), say
(adds a say
built-in function), and state
(adds a state
keyword for declaring "static" variables). Those features are described in their own sections of this document.
The feature
pragma is also implicitly loaded when you require a minimal perl version (with the use VERSION
construct) greater than, or equal to, 5.9.5. See feature for details.
-E is equivalent to -e, but it implicitly enables all optional features (like use feature ":5.10"
).
A new operator //
(defined-or) has been implemented. The following expression:
$a // $b
is merely equivalent to
defined $a ? $a : $b
and the statement
$c //= $d;
can now be used instead of
$c = $d unless defined $c;
The //
operator has the same precedence and associativity as ||
. Special care has been taken to ensure that this operator Do What You Mean while not breaking old code, but some edge cases involving the empty regular expression may now parse differently. See perlop for details.
Perl 5 now has a switch statement. It's available when use feature 'switch'
is in effect. This feature introduces three new keywords, given
, when
, and default
:
given ($foo) { when (/^abc/) { $abc = 1; } when (/^def/) { $def = 1; } when (/^xyz/) { $xyz = 1; } default { $nothing = 1; } }
A more complete description of how Perl matches the switch variable against the when
conditions is given in "Switch statements" in perlsyn.
This kind of match is called smart match, and it's also possible to use it outside of switch statements, via the new ~~
operator. See "Smart matching in detail" in perlsyn.
This feature was contributed by Robin Houston.
It is now possible to write recursive patterns without using the (??{})
construct. This new way is more efficient, and in many cases easier to read.
Each capturing parenthesis can now be treated as an independent pattern that can be entered by using the (?PARNO)
syntax (PARNO
standing for "parenthesis number"). For example, the following pattern will match nested balanced angle brackets:
/ ^ # start of line ( # start capture buffer 1 < # match an opening angle bracket (?: # match one of: (?> # don't backtrack over the inside of this group [^<>]+ # one or more non angle brackets ) # end non backtracking group | # ... or ... (?1) # recurse to bracket 1 and try it again )* # 0 or more times. > # match a closing angle bracket ) # end capture buffer one $ # end of line /x
PCRE users should note that Perl's recursive regex feature allows backtracking into a recursed pattern, whereas in PCRE the recursion is atomic or "possessive" in nature. As in the example above, you can add (?>) to control this selectively. (Yves Orton)
It is now possible to name capturing parenthesis in a pattern and refer to the captured contents by name. The naming syntax is (?
. It's possible to backreference to a named buffer with the \k
syntax. In code, the new magical hashes %+
and %-
can be used to access the contents of the capture buffers.
Thus, to replace all doubled chars with a single copy, one could write
s/(?.)\k /$+{letter}/g
Only buffers with defined contents will be "visible" in the %+
hash, so it's possible to do something like
foreach my $name (keys %+) { print "content of buffer '$name' is $+{$name}\n"; }
The %-
hash is a bit more complete, since it will contain array refs holding values from all capture buffers similarly named, if there should be many of them.
%+
and %-
are implemented as tied hashes through the new module Tie::Hash::NamedCapture
.
Users exposed to the .NET regex engine will find that the perl implementation differs in that the numerical ordering of the buffers is sequential, and not "unnamed first, then named". Thus in the pattern
/(A)(?B)(C)(?D)/
$1 will be 'A', $2 will be 'B', $3 will be 'C' and $4 will be 'D' and not $1 is 'A', $2 is 'C' and $3 is 'B' and $4 is 'D' that a .NET programmer would expect. This is considered a feature. :-) (Yves Orton)
Perl now supports the "possessive quantifier" syntax of the "atomic match" pattern. Basically a possessive quantifier matches as much as it can and never gives any back. Thus it can be used to control backtracking. The syntax is similar to non-greedy matching, except instead of using a '?' as the modifier the '+' is used. Thus ?+
, *+
, ++
, {min,max}+
are now legal quantifiers. (Yves Orton)
The regex engine now supports a number of special-purpose backtrack control verbs: (*THEN), (*PRUNE), (*MARK), (*SKIP), (*COMMIT), (*FAIL) and (*ACCEPT). See perlre for their descriptions. (Yves Orton)
A new syntax \g{N}
or \gN
where "N" is a decimal integer allows a safer form of back-reference notation as well as allowing relative backreferences. This should make it easier to generate and embed patterns that contain backreferences. See "Capture buffers" in perlre. (Yves Orton)
\K
escapeThe functionality of Jeff Pinyan's module Regexp::Keep has been added to the core. In regular expressions you can now use the special escape \K
as a way to do something like floating length positive lookbehind. It is also useful in substitutions like:
s/(foo)bar/$1/g
that can now be converted to
s/foo\Kbar//g
which is much more efficient. (Yves Orton)
Regular expressions now recognize the \v
and \h
escapes that match vertical and horizontal whitespace, respectively. \V
and \H
logically match their complements.
\R
matches a generic linebreak, that is, vertical whitespace, plus the multi-character sequence "\x0D\x0A"
.
say()
say() is a new built-in, only available when use feature 'say'
is in effect, that is similar to print(), but that implicitly appends a newline to the printed string. See "say" in perlfunc. (Robin Houston)
$_
The default variable $_
can now be lexicalized, by declaring it like any other lexical variable, with a simple
my $_;
The operations that default on $_
will use the lexically-scoped version of $_
when it exists, instead of the global $_
.
In a map
or a grep
block, if $_
was previously my'ed, then the $_
inside the block is lexical as well (and scoped to the block).
In a scope where $_
has been lexicalized, you can still have access to the global version of $_
by using $::_
, or, more simply, by overriding the lexical declaration with our $_
. (Rafael Garcia-Suarez)
_
prototypeA new prototype character has been added. _
is equivalent to $
but defaults to $_
if the corresponding argument isn't supplied (both $
and _
denote a scalar). Due to the optional nature of the argument, you can only use it at the end of a prototype, or before a semicolon.
This has a small incompatible consequence: the prototype() function has been adjusted to return _
for some built-ins in appropriate cases (for example, prototype('CORE::rmdir')
). (Rafael Garcia-Suarez)
UNITCHECK
, a new special code block has been introduced, in addition to BEGIN
, CHECK
, INIT
and END
.
CHECK
and INIT
blocks, while useful for some specialized purposes, are always executed at the transition between the compilation and the execution of the main program, and thus are useless whenever code is loaded at runtime. On the other hand, UNITCHECK
blocks are executed just after the unit which defined them has been compiled. See perlmod for more information. (Alex Gough)
mro
A new pragma, mro
(for Method Resolution Order) has been added. It permits to switch, on a per-class basis, the algorithm that perl uses to find inherited methods in case of a multiple inheritance hierarchy. The default MRO hasn't changed (DFS, for Depth First Search). Another MRO is available: the C3 algorithm. See mro for more information. (Brandon Black)
Note that, due to changes in the implementation of class hierarchy search, code that used to undef the *ISA
glob will most probably break. Anyway, undef'ing *ISA
had the side-effect of removing the magic on the @ISA array and should not have been done in the first place. Also, the cache *::ISA::CACHE::
no longer exists; to force reset the @ISA cache, you now need to use the mro
API, or more simply to assign to @ISA (e.g. with @ISA = @ISA
).
The readdir() function may return a "short filename" when the long filename contains characters outside the ANSI codepage. Similarly Cwd::cwd() may return a short directory name, and glob() may return short names as well. On the NTFS file system these short names can always be represented in the ANSI codepage. This will not be true for all other file system drivers; e.g. the FAT filesystem stores short filenames in the OEM codepage, so some files on FAT volumes remain unaccessible through the ANSI APIs.
Similarly, $^X, @INC, and $ENV{PATH} are preprocessed at startup to make sure all paths are valid in the ANSI codepage (if possible).
The Win32::GetLongPathName() function now returns the UTF-8 encoded correct long file name instead of using replacement characters to force the name into the ANSI codepage. The new Win32::GetANSIPathName() function can be used to turn a long pathname into a short one only if the long one cannot be represented in the ANSI codepage.
Many other functions in the Win32
module have been improved to accept UTF-8 encoded arguments. Please see Win32 for details.
The built-in function readpipe() is now overridable. Overriding it permits also to override its operator counterpart, qx//
(a.k.a. ``
). Moreover, it now defaults to $_
if no argument is provided. (Rafael Garcia-Suarez)
readline() now defaults to *ARGV
if no argument is provided. (Rafael Garcia-Suarez)
A new class of variables has been introduced. State variables are similar to my
variables, but are declared with the state
keyword in place of my
. They're visible only in their lexical scope, but their value is persistent: unlike my
variables, they're not undefined at scope entry, but retain their previous value. (Rafael Garcia-Suarez, Nicholas Clark)
To use state variables, one needs to enable them by using
use feature 'state';
or by using the -E
command-line switch in one-liners. See "Persistent Private Variables" in perlsub.
As a new form of syntactic sugar, it's now possible to stack up filetest operators. You can now write -f -w -x $file
in a row to mean -x $file && -w _ && -f _
. See "-X" in perlfunc.
The UNIVERSAL
class has a new method, DOES()
. It has been added to solve semantic problems with the isa()
method. isa()
checks for inheritance, while DOES()
has been designed to be overridden when module authors use other types of relations between classes (in addition to inheritance). (chromatic)
See "$obj->DOES( ROLE )" in UNIVERSAL.
Formats were improved in several ways. A new field, ^*
, can be used for variable-width, one-line-at-a-time text. Null characters are now handled correctly in picture lines. Using @#
and ~~
together will now produce a compile-time error, as those format fields are incompatible. perlform has been improved, and miscellaneous bugs fixed.
There are two new byte-order modifiers, >
(big-endian) and <
(little-endian), that can be appended to most pack() and unpack() template characters and groups to force a certain byte-order for that type or group. See "pack" in perlfunc and perlpacktut for details.
no VERSION
You can now use no
followed by a version number to specify that you want to use a version of perl older than the specified one.
chdir
, chmod
and chown
on filehandleschdir
, chmod
and chown
can now work on filehandles as well as filenames, if the system supports respectively fchdir
, fchmod
and fchown
, thanks to a patch provided by Gisle Aas.
$(
and $)
now return groups in the order where the OS returns them, thanks to Gisle Aas. This wasn't previously the case.
You can now use recursive subroutines with sort(), thanks to Robin Houston.
The constant folding routine is now wrapped in an exception handler, and if folding throws an exception (such as attempting to evaluate 0/0), perl now retains the current optree, rather than aborting the whole program. Without this change, programs would not compile if they had expressions that happened to generate exceptions, even though those expressions were in code that could never be reached at runtime. (Nicholas Clark, Dave Mitchell)
It's possible to enhance the mechanism of subroutine hooks in @INC by adding a source filter on top of the filehandle opened and returned by the hook. This feature was planned a long time ago, but wasn't quite working until now. See "require" in perlfunc for details. (Nicholas Clark)
${^RE_DEBUG_FLAGS}
This variable controls what debug flags are in effect for the regular expression engine when running under use re "debug"
. See re for details.
${^CHILD_ERROR_NATIVE}
This variable gives the native status returned by the last pipe close, backtick command, successful call to wait() or waitpid(), or from the system() operator. See perlvar for details. (Contributed by Gisle Aas.)
${^RE_TRIE_MAXBUF}
See "p5100-Trie optimisation of literal string alternations".
${^WIN32_SLOPPY_STAT}
unpack()
now defaults to unpacking the $_
variable.
mkdir()
without arguments now defaults to $_
.
The internal dump output has been improved, so that non-printable characters such as newline and backspace are output in \x
notation, rather than octal.
The -C option can no longer be used on the #!
line. It wasn't working there anyway, since the standard streams are already set up at this point in the execution of the perl interpreter. You can use binmode() instead to get the desired behaviour.
The copy of the Unicode Character Database included in Perl 5 has been updated to version 5.0.0.
MAD, which stands for Miscellaneous Attribute Decoration, is a still-in-development work leading to a Perl 5 to Perl 6 converter. To enable it, it's necessary to pass the argument -Dmad
to Configure. The obtained perl isn't binary compatible with a regular perl 5.10, and has space and speed penalties; moreover not all regression tests still pass with it. (Larry Wall, Nicholas Clark)
On Windows platforms, kill(-9, $pid)
now kills a process tree. (On Unix, this delivers the signal to all processes in the same process group.)
The semantics of pack() and unpack() regarding UTF-8-encoded data has been changed. Processing is now by default character per character instead of byte per byte on the underlying encoding. Notably, code that used things like pack("a*", $string)
to see through the encoding of string will now simply get back the original $string. Packed strings can also get upgraded during processing when you store upgraded characters. You can get the old behaviour by using use bytes
.
To be consistent with pack(), the C0
in unpack() templates indicates that the data is to be processed in character mode, i.e. character by character; on the contrary, U0
in unpack() indicates UTF-8 mode, where the packed string is processed in its UTF-8-encoded Unicode form on a byte by byte basis. This is reversed with regard to perl 5.8.X, but now consistent between pack() and unpack().
Moreover, C0
and U0
can also be used in pack() templates to specify respectively character and byte modes.
C0
and U0
in the middle of a pack or unpack format now switch to the specified encoding mode, honoring parens grouping. Previously, parens were ignored.
Also, there is a new pack() character format, W
, which is intended to replace the old C
. C
is kept for unsigned chars coded as bytes in the strings internal representation. W
represents unsigned (logical) character values, which can be greater than 255. It is therefore more robust when dealing with potentially UTF-8-encoded data (as C
will wrap values outside the range 0..255, and not respect the string encoding).
In practice, that means that pack formats are now encoding-neutral, except C
.
For consistency, A
in unpack() format now trims all Unicode whitespace from the end of the string. Before perl 5.9.2, it used to strip only the classical ASCII space characters.
A new unpack() template character, "."
, returns the number of bytes or characters (depending on the selected encoding mode, see above) read so far.
$*
and $#
variables have been removed$*
, which was deprecated in favor of the /s
and /m
regexp modifiers, has been removed.
The deprecated $#
variable (output format for numbers) has been removed.
Two new severe warnings, $#/$* is no longer supported
, have been added.
The lvalues returned by the three argument form of substr() used to be a "fixed length window" on the original string. In some cases this could cause surprising action at distance or other undefined behaviour. Now the length of the window adjusts itself to the length of the string assigned to it.
-f _
The identifier _
is now forced to be a bareword after a filetest operator. This solves a number of misparsing issues when a global _
subroutine is defined.
:unique
The :unique
attribute has been made a no-op, since its current implementation was fundamentally flawed and not threadsafe.
The compile-time value of the %^H
hint variable can now propagate into eval("")uated code. This makes it more useful to implement lexical pragmas.
As a side-effect of this, the overloaded-ness of constants now propagates into eval("").
A bareword argument to chdir() is now recognized as a file handle. Earlier releases interpreted the bareword as a directory name. (Gisle Aas)
An old feature of perl was that before require
or use
look for a file with a .pm extension, they will first look for a similar filename with a .pmc extension. If this file is found, it will be loaded in place of any potentially existing file ending in a .pm extension.
Previously, .pmc files were loaded only if more recent than the matching .pm file. Starting with 5.9.4, they'll be always loaded if they exist.
version
object instead of a v-string$^V can still be used with the %vd
format in printf, but any character-level operations will now access the string representation of the version
object and not the ordinals of a v-string. Expressions like substr($^V, 0, 2)
or split //, $^V
no longer work and must be rewritten.
The special arrays @-
and @+
are no longer interpolated in regular expressions. (Sadahiro Tomoyuki)
If you call a subroutine by a tainted name, and if it defers to an AUTOLOAD function, then $AUTOLOAD will be (correctly) tainted. (Rick Delaney)
When perl is run under taint mode, printf()
and sprintf()
will now reject any tainted format argument. (Rafael Garcia-Suarez)
Undefining or deleting a signal handler via undef $SIG{FOO}
is now equivalent to setting it to 'DEFAULT'
. (Rafael Garcia-Suarez)
use strict 'refs'
was ignoring taking a hard reference in an argument to defined(), as in :
use strict 'refs'; my $x = 'foo'; if (defined $$x) {...}
This now correctly produces the run-time error Can't use string as a SCALAR ref while "strict refs" in use
.
defined @$foo
and defined %$bar
are now also subject to strict 'refs'
(that is, $foo
and $bar
shall be proper references there.) (defined(@foo)
and defined(%bar)
are discouraged constructs anyway.) (Nicholas Clark)
(?p{})
has been removedThe regular expression construct (?p{})
, which was deprecated in perl 5.8, has been removed. Use (??{})
instead. (Rafael Garcia-Suarez)
Support for pseudo-hashes has been removed from Perl 5.9. (The fields
pragma remains here, but uses an alternate implementation.)
perlcc
, the byteloader and the supporting modules (B::C, B::CC, B::Bytecode, etc.) are no longer distributed with the perl sources. Those experimental tools have never worked reliably, and, due to the lack of volunteers to keep them in line with the perl interpreter developments, it was decided to remove them instead of shipping a broken version of those. The last version of those modules can be found with perl 5.9.4.
However the B compiler framework stays supported in the perl core, as with the more useful modules it has permitted (among others, B::Deparse and B::Concise).
The JPL (Java-Perl Lingo) has been removed from the perl sources tarball.
Perl will now immediately throw an exception if you modify any package's @ISA
in such a way that it would cause recursive inheritance.
Previously, the exception would not occur until Perl attempted to make use of the recursive inheritance while resolving a method or doing a $foo->isa($bar)
lookup.
The behaviour in 5.10.x favors the person using the module; The behaviour in 5.8.x favors the module writer;
Assume the following code:
main calls Foo::Bar::baz() Foo::Bar inherits from Foo::Base Foo::Bar::baz() calls Foo::Base::_bazbaz() Foo::Base::_bazbaz() calls: warnings::warnif('substr', 'some warning message');
On 5.8.x, the code warns when Foo::Bar contains use warnings;
It does not matter if Foo::Base or main have warnings enabled to disable the warning one has to modify Foo::Bar.
On 5.10.0 and newer, the code warns when main contains use warnings;
It does not matter if Foo::Base or Foo::Bar have warnings enabled to disable the warning one has to modify main.
Even more core modules are now also available separately through the CPAN. If you wish to update one of these modules, you don't need to wait for a new perl release. From within the cpan shell, running the 'r' command will report on modules with upgrades available. See perldoc CPAN
for more information.
feature
The new pragma feature
is used to enable new features that might break old code. See "p5100-The feature
pragma" above.
mro
This new pragma enables to change the algorithm used to resolve inherited methods. See "p5100-New Pragma, mro
" above.
sort
pragmaThe sort
pragma is now lexically scoped. Its effect used to be global.
bignum
, bigint
, bigrat
The three numeric pragmas bignum
, bigint
and bigrat
are now lexically scoped. (Tels)
base
The base
pragma now warns if a class tries to inherit from itself. (Curtis "Ovid" Poe)
strict
and warnings
strict
and warnings
will now complain loudly if they are loaded via incorrect casing (as in use Strict;
). (Johan Vromans)
version
The version
module provides support for version objects.
warnings
The warnings
pragma doesn't load Carp
anymore. That means that code that used Carp
routines without having loaded it at compile time might need to be adjusted; typically, the following (faulty) code won't work anymore, and will require parentheses to be added after the function name:
use warnings; require Carp; Carp::confess 'argh';
less
less
now does something useful (or at least it tries to). In fact, it has been turned into a lexical pragma. So, in your modules, you can now test whether your users have requested to use less CPU, or less memory, less magic, or maybe even less fat. See less for more. (Joshua ben Jore)
encoding::warnings
, by Audrey Tang, is a module to emit warnings whenever an ASCII character string containing high-bit bytes is implicitly converted into UTF-8. It's a lexical pragma since Perl 5.9.4; on older perls, its effect is global.Module::CoreList
, by Richard Clamp, is a small handy module that tells you what versions of core modules ship with any versions of Perl 5. It comes with a command-line frontend, corelist
.Math::BigInt::FastCalc
is an XS-enabled, and thus faster, version of Math::BigInt::Calc
.Compress::Zlib
is an interface to the zlib compression library. It comes with a bundled version of zlib, so having a working zlib is not a prerequisite to install it. It's used by Archive::Tar
(see below).IO::Zlib
is an IO::
-style interface to Compress::Zlib
.Archive::Tar
is a module to manipulate tar
archives.Digest::SHA
is a module used to calculate many types of SHA digests, has been included for SHA support in the CPAN module.ExtUtils::CBuilder
and ExtUtils::ParseXS
have been added.Hash::Util::FieldHash
, by Anno Siegel, has been added. This module provides support for field hashes: hashes that maintain an association of a reference with a value, in a thread-safe garbage-collected way. Such hashes are useful to implement inside-out objects.Module::Build
, by Ken Williams, has been added. It's an alternative to ExtUtils::MakeMaker
to build and install perl modules.Module::Load
, by Jos Boumans, has been added. It provides a single interface to load Perl modules and .pl files.Module::Loaded
, by Jos Boumans, has been added. It's used to mark modules as loaded or unloaded.Package::Constants
, by Jos Boumans, has been added. It's a simple helper to list all constants declared in a given package.Win32API::File
, by Tye McQueen, has been added (for Windows builds). This module provides low-level access to Win32 system API calls for files/dirs.Locale::Maketext::Simple
, needed by CPANPLUS, is a simple wrapper around Locale::Maketext::Lexicon
. Note that Locale::Maketext::Lexicon
isn't included in the perl core; the behaviour of Locale::Maketext::Simple
gracefully degrades when the later isn't present.Params::Check
implements a generic input parsing/checking mechanism. It is used by CPANPLUS.Term::UI
simplifies the task to ask questions at a terminal prompt.Object::Accessor
provides an interface to create per-object accessors.Module::Pluggable
is a simple framework to create modules that accept pluggable sub-modules.Module::Load::Conditional
provides simple ways to query and possibly load installed modules.Time::Piece
provides an object oriented interface to time functions, overriding the built-ins localtime() and gmtime().IPC::Cmd
helps to find and run external commands, possibly interactively.File::Fetch
provide a simple generic file fetching mechanism.Log::Message
and Log::Message::Simple
are used by the log facility of CPANPLUS
.Archive::Extract
is a generic archive extraction mechanism for .tar (plain, gziped or bzipped) or .zip files.CPANPLUS
provides an API and a command-line tool to access the CPAN mirrors.Pod::Escapes
provides utilities that are useful in decoding Pod E<...> sequences.Pod::Simple
is now the backend for several of the Pod-related modules included with Perl.Attribute::Handlers
Attribute::Handlers
can now report the caller's file and line number. (David Feldman)
All interpreted attributes are now passed as array references. (Damian Conway)
B::Lint
B::Lint
is now based on Module::Pluggable
, and so can be extended with plugins. (Joshua ben Jore)
B
It's now possible to access the lexical pragma hints (%^H
) by using the method B::COP::hints_hash(). It returns a B::RHE
object, which in turn can be used to get a hash reference via the method B::RHE::HASH(). (Joshua ben Jore)
Thread
As the old 5005thread threading model has been removed, in favor of the ithreads scheme, the Thread
module is now a compatibility wrapper, to be used in old code only. It has been removed from the default list of dynamic extensions.
The Perl debugger can now save all debugger commands for sourcing later; notably, it can now emulate stepping backwards, by restarting and rerunning all bar the last command from a saved command history.
It can also display the parent inheritance tree of a given class, with the i
command.
ptar
is a pure perl implementation of tar
that comes with Archive::Tar
.
ptardiff
is a small utility used to generate a diff between the contents of a tar archive and a directory tree. Like ptar
, it comes with Archive::Tar
.
shasum
is a command-line utility, used to print or to check SHA digests. It comes with the new Digest::SHA
module.
The corelist
utility is now installed with perl (see "p5100-New modules" above).
h2ph
and h2xs
have been made more robust with regard to "modern" C code.
h2xs
implements a new option --use-xsloader
to force use of XSLoader
even in backwards compatible modules.
The handling of authors' names that had apostrophes has been fixed.
Any enums with negative values are now skipped.
perlivp
no longer checks for *.ph files by default. Use the new -a
option to run all tests.
find2perl
now assumes -print
as a default action. Previously, it needed to be specified explicitly.
Several bugs have been fixed in find2perl
, regarding -exec
and -eval
. Also the options -path
, -ipath
and -iname
have been added.
config_data
is a new utility that comes with Module::Build
. It provides a command-line interface to the configuration of Perl modules that use Module::Build's framework of configurability (that is, *::ConfigData
modules that contain local configuration information for their parent modules.)
cpanp
, the CPANPLUS shell, has been added. (cpanp-run-perl
, a helper for CPANPLUS operation, has been added too, but isn't intended for direct use).
cpan2dist
is a new utility that comes with CPANPLUS. It's a tool to create distributions (or packages) from CPAN modules.
The output of pod2html
has been enhanced to be more customizable via CSS. Some formatting problems were also corrected. (Jari Aalto)
The perlpragma manpage documents how to write one's own lexical pragmas in pure Perl (something that is possible starting with 5.9.4).
The new perlglossary manpage is a glossary of terms used in the Perl documentation, technical and otherwise, kindly provided by O'Reilly Media, Inc.
The perlreguts manpage, courtesy of Yves Orton, describes internals of the Perl regular expression engine.
The perlreapi manpage describes the interface to the perl interpreter used to write pluggable regular expression engines (by Ævar Arnfjörð Bjarmason).
The perlunitut manpage is an tutorial for programming with Unicode and string encodings in Perl, courtesy of Juerd Waalboer.
A new manual page, perlunifaq (the Perl Unicode FAQ), has been added (Juerd Waalboer).
The perlcommunity manpage gives a description of the Perl community on the Internet and in real life. (Edgar "Trizor" Bering)
The CORE manual page documents the CORE::
namespace. (Tels)
The long-existing feature of /(?{...})/
regexps setting $_
and pos() is now documented.
Sorting arrays in place (@a = sort @a
) is now optimized to avoid making a temporary copy of the array.
Likewise, reverse sort ...
is now optimized to sort in reverse, avoiding the generation of a temporary intermediate list.
Access to elements of lexical arrays via a numeric constant between 0 and 255 is now faster. (This used to be only the case for global arrays.)
Some pure-perl code that perl was using to retrieve Unicode properties and transliteration mappings has been reimplemented in XS.
The interpreter internals now support a far more memory efficient form of inlineable constants. Storing a reference to a constant value in a symbol table is equivalent to a full typeglob referencing a constant subroutine, but using about 400 bytes less memory. This proxy constant subroutine is automatically upgraded to a real typeglob with subroutine if necessary. The approach taken is analogous to the existing space optimisation for subroutine stub declarations, which are stored as plain scalars in place of the full typeglob.
Several of the core modules have been converted to use this feature for their system dependent constants - as a result use POSIX;
now takes about 200K less memory.
PERL_DONT_CREATE_GVSV
The new compilation flag PERL_DONT_CREATE_GVSV
, introduced as an option in perl 5.8.8, is turned on by default in perl 5.9.3. It prevents perl from creating an empty scalar with every new typeglob. See "p589-NAME" for details.
Weak reference creation is now O(1) rather than O(n), courtesy of Nicholas Clark. Weak reference deletion remains O(n), but if deletion only happens at program exit, it may be skipped completely.
Salvador Fandiño provided improvements to reduce the memory usage of sort
and to speed up some cases.
Several internal data structures (typeglobs, GVs, CVs, formats) have been restructured to use less memory. (Nicholas Clark)
The UTF-8 caching code is now more efficient, and used more often. (Nicholas Clark)
On Windows, perl's stat() function normally opens the file to determine the link count and update attributes that may have been changed through hard links. Setting ${^WIN32_SLOPPY_STAT} to a true value speeds up stat() by not performing this operation. (Jan Dubois)
The regular expression engine is no longer recursive, meaning that patterns that used to overflow the stack will either die with useful explanations, or run to completion, which, since they were able to blow the stack before, will likely take a very long time to happen. If you were experiencing the occasional stack overflow (or segfault) and upgrade to discover that now perl apparently hangs instead, look for a degenerate regex. (Dave Mitchell)
Classes of a single character are now treated the same as if the character had been used as a literal, meaning that code that uses char-classes as an escaping mechanism will see a speedup. (Yves Orton)
Alternations, where possible, are optimised into more efficient matching structures. String literal alternations are merged into a trie and are matched simultaneously. This means that instead of O(N) time for matching N alternations at a given point, the new code performs in O(1) time. A new special variable, ${^RE_TRIE_MAXBUF}, has been added to fine-tune this optimization. (Yves Orton)
Note: Much code exists that works around perl's historic poor performance on alternations. Often the tricks used to do so will disable the new optimisations. Hopefully the utility modules used for this purpose will be educated about these new optimisations.
When a pattern starts with a trie-able alternation and there aren't better optimisations available, the regex engine will use Aho-Corasick matching to find the start point. (Yves Orton)
-Dusesitecustomize
Run-time customization of @INC can be enabled by passing the -Dusesitecustomize
flag to Configure. When enabled, this will make perl run $sitelibexp/sitecustomize.pl before anything else. This script can then be set up to add additional entries to @INC.
There is now Configure support for creating a relocatable perl tree. If you Configure with -Duserelocatableinc
, then the paths in @INC (and everything else in %Config) can be optionally located via the path of the perl executable.
That means that, if the string ".../"
is found at the start of any path, it's substituted with the directory of $^X. So, the relocation can be configured on a per-directory basis, although the default with -Duserelocatableinc
is that everything is relocated. The initial install is done to the original configured prefix.
The configuration process now detects whether strlcat() and strlcpy() are available. When they are not available, perl's own version is used (from Russ Allbery's public domain implementation). Various places in the perl interpreter now use them. (Steve Peters)
d_pseudofork
and d_printf_format_null
A new configuration variable, available as $Config{d_pseudofork}
in the Config module, has been added, to distinguish real fork() support from fake pseudofork used on Windows platforms.
A new configuration variable, d_printf_format_null
, has been added, to see if printf-like formats are allowed to be NULL.
Configure -h
has been extended with the most commonly used options.
Parallel makes should work properly now, although there may still be problems if make test
is instructed to run in parallel.
Building with Borland's compilers on Win32 should work more smoothly. In particular Steve Hay has worked to side step many warnings emitted by their compilers and at least one C compiler internal error.
Perl extensions on Windows now can be statically built into the Perl DLL.
Also, it's now possible to build a perl-static.exe
that doesn't depend on the Perl DLL on Win32. See the Win32 makefiles for details. (Vadim Konovalov)
All ppport.h files in the XS modules bundled with perl are now autogenerated at build time. (Marcus Holland-Moritz)
Efforts have been made to make perl and the core XS modules compilable with various C++ compilers (although the situation is not perfect with some of the compilers on some of the platforms tested.)
Support for building perl with Microsoft's 64-bit compiler has been improved. (ActiveState)
Perl can now be compiled with Microsoft Visual C++ 2005 (and 2008 Beta 2).
All win32 builds (MS-Win, WinCE) have been merged and cleaned up.
README files and changelogs for CPAN modules bundled with perl are no longer installed.
Perl has been reported to work on Symbian OS. See perlsymbian for more information.
Many improvements have been made towards making Perl work correctly on z/OS.
Perl has been reported to work on DragonFlyBSD and MidnightBSD.
Perl has also been reported to work on NexentaOS ( http://www.gnusolaris.org/ ).
The VMS port has been improved. See perlvms.
Support for Cray XT4 Catamount/Qk has been added. See hints/catamount.sh in the source code distribution for more information.
Vendor patches have been merged for RedHat and Gentoo.
DynaLoader::dl_unload_file() now works on Windows.
strict
wasn't in effect in regexp-eval blocks (/(?{...})/
).
CORE::require() and CORE::do() were always parsed as require() and do() when they were overridden. This is now fixed.
You can now use a non-arrowed form for chained subscripts after a list slice, like in:
({foo => "bar"})[0]{foo}
This used to be a syntax error; a ->
was required.
no warnings 'category'
works correctly with -wPreviously when running with warnings enabled globally via -w
, selective disabling of specific warning categories would actually turn off all warnings. This is now fixed; now no warnings 'io';
will only turn off warnings in the io
class. Previously it would erroneously turn off all warnings.
Several memory leaks in ithreads were closed. Also, ithreads were made less memory-intensive.
threads
is now a dual-life module, also available on CPAN. It has been expanded in many ways. A kill() method is available for thread signalling. One can get thread status, or the list of running or joinable threads.
A new threads->exit()
method is used to exit from the application (this is the default for the main thread) or from the current thread only (this is the default for all other threads). On the other hand, the exit() built-in now always causes the whole application to terminate. (Jerry D. Hedden)
chr() on a negative value now gives \x{FFFD}
, the Unicode replacement character, unless when the bytes
pragma is in effect, where the low eight bits of the value are used.
On Windows, the PERL5SHELL environment variable is now checked for taintedness. (Rafael Garcia-Suarez)
stat()
and -X
filetests now treat *FILE{IO} filehandles like *FILE filehandles. (Steve Peters)
Overloading now works when references are reblessed into another class. Internally, this has been implemented by moving the flag for "overloading" from the reference to the referent, which logically is where it should always have been. (Nicholas Clark)
A few bugs related to UTF-8 handling with objects that have stringification overloaded have been fixed. (Nicholas Clark)
Traditionally, eval 'syntax error'
has leaked badly. Many (but not all) of these leaks have now been eliminated or reduced. (Dave Mitchell)
In previous versions, perl would read the file /dev/urandom if it existed when seeding its random number generator. That file is unlikely to exist on Windows, and if it did would probably not contain appropriate data, so perl no longer tries to read it on Windows. (Alex Davies)
The PERLIO_DEBUG
environment variable no longer has any effect for setuid scripts and for scripts run with -T.
Moreover, with a thread-enabled perl, using PERLIO_DEBUG
could lead to an internal buffer overflow. This has been fixed.
PerlIO::scalar will now prevent writing to read-only scalars. Moreover, seek() is now supported with PerlIO::scalar-based filehandles, the underlying string being zero-filled as needed. (Rafael, Jarkko Hietaniemi)
study() never worked for UTF-8 strings, but could lead to false results. It's now a no-op on UTF-8 data. (Yves Orton)
The signals SIGILL, SIGBUS and SIGSEGV are now always delivered in an "unsafe" manner (contrary to other signals, that are deferred until the perl interpreter reaches a reasonably stable state; see "Deferred Signals (Safe Signals)" in perlipc). (Rafael)
When a module or a file is loaded through an @INC-hook, and when this hook has set a filename entry in %INC, __FILE__ is now set for this module accordingly to the contents of that %INC entry. (Rafael)
-t
switch fixThe -w
and -t
switches can now be used together without messing up which categories of warnings are activated. (Rafael)
Duping a filehandle which has the :utf8
PerlIO layer set will now properly carry that layer on the duped filehandle. (Rafael)
Localizing a hash element whose key was given as a variable didn't work correctly if the variable was changed while the local() was in effect (as in local $h{$x}; ++$x
). (Bo Lindbergh)
Perl will now try to tell you the name of the variable (if any) that was undefined.
A new deprecation warning, Deprecated use of my() in false conditional, has been added, to warn against the use of the dubious and deprecated construct
my $x if 0;
See perldiag. Use state
variables instead.
A new warning, !=~ should be !~
, is emitted to prevent this misspelling of the non-matching operator.
The warning Newline in left-justified string has been removed.
The error Too late for "-T" option has been reformulated to be more descriptive.
This warning is now emitted in more consistent cases; in short, when one of the declarations involved is a my
variable:
my $x; my $x; # warns my $x; our $x; # warns our $x; my $x; # warns
On the other hand, the following:
our $x; our $x;
now gives a "our" variable %s redeclared
warning.
These new warnings are now emitted when a dirhandle is used but is either closed or not really a dirhandle.
Two deprecation warnings have been added: (Rafael)
Opening dirhandle %s also as a file Opening filehandle %s also as a directory
Perl's command-line switch -P
is now deprecated.
Perl will warn you against potential backwards compatibility problems with the use VERSION
syntax.
perl -V
has several improvements, making it more useable from shell scripts to get the value of configuration variables. See perlrun for details.
In general, the source code of perl has been refactored, tidied up, and optimized in many places. Also, memory management and allocation has been improved in several points.
When compiling the perl core with gcc, as many gcc warning flags are turned on as is possible on the platform. (This quest for cleanliness doesn't extend to XS code because we cannot guarantee the tidiness of code we didn't write.) Similar strictness flags have been added or tightened for various other C compilers.
The relative ordering of constants that define the various types of SV
have changed; in particular, SVt_PVGV
has been moved before SVt_PVLV
, SVt_PVAV
, SVt_PVHV
and SVt_PVCV
. This is unlikely to make any difference unless you have code that explicitly makes assumptions about that ordering. (The inheritance hierarchy of B::*
objects has been changed to reflect this.)
Related to this, the internal type SVt_PVBM
has been removed. This dedicated type of SV
was used by the index
operator and parts of the regexp engine to facilitate fast Boyer-Moore matches. Its use internally has been replaced by SV
s of type SVt_PVGV
.
A new type SVt_BIND
has been added, in readiness for the project to implement Perl 6 on 5. There deliberately is no implementation yet, and they cannot yet be created or destroyed.
The C preprocessor symbols PERL_PM_APIVERSION
and PERL_XS_APIVERSION
, which were supposed to give the version number of the oldest perl binary-compatible (resp. source-compatible) with the present one, were not used, and sometimes had misleading values. They have been removed.
The BASEOP
structure now uses less space. The op_seq
field has been removed and replaced by a single bit bit-field op_opt
. op_type
is now 9 bits long. (Consequently, the B::OP
class doesn't provide an seq
method anymore.)
perl's parser is now generated by bison (it used to be generated by byacc.) As a result, it seems to be a bit more robust.
Also, Dave Mitchell improved the lexer debugging output under -DT
.
const
Andy Lester supplied many improvements to determine which function parameters and local variables could actually be declared const
to the C compiler. Steve Peters provided new *_set
macros and reworked the core to use these rather than assigning to macros in LVALUE context.
A new file, mathoms.c, has been added. It contains functions that are no longer used in the perl core, but that remain available for binary or source compatibility reasons. However, those functions will not be compiled in if you add -DNO_MATHOMS
in the compiler flags.
AvFLAGS
has been removedThe AvFLAGS
macro has been removed.
av_*
changesThe av_*()
functions, used to manipulate arrays, no longer accept null AV*
parameters.
The implementation of the special variables $^H and %^H has changed, to allow implementing lexical pragmas in pure Perl.
The inheritance hierarchy of B::
modules has changed; B::NV
now inherits from B::SV
(it used to inherit from B::IV
).
The anonymous hash and array constructors now take 1 op in the optree instead of 3, now that pp_anonhash and pp_anonlist return a reference to an hash/array when the op is flagged with OPf_SPECIAL. (Nicholas Clark)
There's still a remaining problem in the implementation of the lexical $_
: it doesn't work inside /(?{...})/
blocks. (See the TODO test in t/op/mydef.t.)
Stacked filetest operators won't work when the filetest
pragma is in effect, because they rely on the stat() buffer _
being populated, and filetest bypasses stat().
The handling of Unicode still is unclean in several places, where it's dependent on whether a string is internally flagged as UTF-8. This will be made more consistent in perl 5.12, but that won't be possible without a certain amount of backwards incompatibility.
When compiled with g++ and thread support on Linux, it's reported that the $!
stops working correctly. This is related to the fact that the glibc provides two strerror_r(3) implementation, and perl selects the wrong one.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/rt3/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
The Changes file and the perl590delta to perl595delta man pages for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl595delta - what is new for perl v5.9.5
This document describes differences between the 5.9.4 and the 5.9.5 development releases. See "p590-NAME", "p591-NAME", "p592-NAME", "p593-NAME" and "p594-NAME" for the differences between 5.8.0 and 5.9.4.
When perl is run under taint mode, printf()
and sprintf()
will now reject any tainted format argument. (Rafael Garcia-Suarez)
Undefining or deleting a signal handler via undef $SIG{FOO}
is now equivalent to setting it to 'DEFAULT'
. (Rafael)
defined @$foo
and defined %$bar
are now subject to strict 'refs'
(that is, $foo
and $bar
shall be proper references there.) (Nicholas Clark)
(However, defined(@foo)
and defined(%bar)
are discouraged constructs anyway.)
(?p{})
has been removedThe regular expression construct (?p{})
, which was deprecated in perl 5.8, has been removed. Use (??{})
instead. (Rafael)
Support for pseudo-hashes has been removed from Perl 5.9. (The fields
pragma remains here, but uses an alternate implementation.)
perlcc
, the byteloader and the supporting modules (B::C, B::CC, B::Bytecode, etc.) are no longer distributed with the perl sources. Those experimental tools have never worked reliably, and, due to the lack of volunteers to keep them in line with the perl interpreter developments, it was decided to remove them instead of shipping a broken version of those. The last version of those modules can be found with perl 5.9.4.
However the B compiler framework stays supported in the perl core, as with the more useful modules it has permitted (among others, B::Deparse and B::Concise).
The JPL (Java-Perl Linguo) has been removed from the perl sources tarball.
Perl will now immediately throw an exception if you modify any package's @ISA
in such a way that it would cause recursive inheritance.
Previously, the exception would not occur until Perl attempted to make use of the recursive inheritance while resolving a method or doing a $foo->isa($bar)
lookup.
It is now possible to write recursive patterns without using the (??{})
construct. This new way is more efficient, and in many cases easier to read.
Each capturing parenthesis can now be treated as an independent pattern that can be entered by using the (?PARNO)
syntax (PARNO
standing for "parenthesis number"). For example, the following pattern will match nested balanced angle brackets:
/ ^ # start of line ( # start capture buffer 1 < # match an opening angle bracket (?: # match one of: (?> # don't backtrack over the inside of this group [^<>]+ # one or more non angle brackets ) # end non backtracking group | # ... or ... (?1) # recurse to bracket 1 and try it again )* # 0 or more times. > # match a closing angle bracket ) # end capture buffer one $ # end of line /x
Note, users experienced with PCRE will find that the Perl implementation of this feature differs from the PCRE one in that it is possible to backtrack into a recursed pattern, whereas in PCRE the recursion is atomic or "possessive" in nature. (Yves Orton)
It is now possible to name capturing parenthesis in a pattern and refer to the captured contents by name. The naming syntax is (?
. It's possible to backreference to a named buffer with the \k
syntax. In code, the new magical hashes %+
and %-
can be used to access the contents of the capture buffers.
Thus, to replace all doubled chars, one could write
s/(?.)\k /$+{letter}/g
Only buffers with defined contents will be "visible" in the %+
hash, so it's possible to do something like
foreach my $name (keys %+) { print "content of buffer '$name' is $+{$name}\n"; }
The %-
hash is a bit more complete, since it will contain array refs holding values from all capture buffers similarly named, if there should be many of them.
%+
and %-
are implemented as tied hashes through the new module Tie::Hash::NamedCapture
.
Users exposed to the .NET regex engine will find that the perl implementation differs in that the numerical ordering of the buffers is sequential, and not "unnamed first, then named". Thus in the pattern
/(A)(?B)(C)(?D)/
$1 will be 'A', $2 will be 'B', $3 will be 'C' and $4 will be 'D' and not $1 is 'A', $2 is 'C' and $3 is 'B' and $4 is 'D' that a .NET programmer would expect. This is considered a feature. :-) (Yves Orton)
Perl now supports the "possessive quantifier" syntax of the "atomic match" pattern. Basically a possessive quantifier matches as much as it can and never gives any back. Thus it can be used to control backtracking. The syntax is similar to non-greedy matching, except instead of using a '?' as the modifier the '+' is used. Thus ?+
, *+
, ++
, {min,max}+
are now legal quantifiers. (Yves Orton)
The regex engine now supports a number of special-purpose backtrack control verbs: (*THEN), (*PRUNE), (*MARK), (*SKIP), (*COMMIT), (*FAIL) and (*ACCEPT). See perlre for their descriptions. (Yves Orton)
A new syntax \g{N}
or \gN
where "N" is a decimal integer allows a safer form of back-reference notation as well as allowing relative backreferences. This should make it easier to generate and embed patterns that contain backreferences. See "Capture buffers" in perlre. (Yves Orton)
\K
escapeThe functionality of Jeff Pinyan's module Regexp::Keep has been added to the core. You can now use in regular expressions the special escape \K
as a way to do something like floating length positive lookbehind. It is also useful in substitutions like:
s/(foo)bar/$1/g
that can now be converted to
s/foo\Kbar//g
which is much more efficient. (Yves Orton)
Regular expressions now recognize the \v
and \h
escapes, that match vertical and horizontal whitespace, respectively. \V
and \H
logically match their complements.
\R
matches a generic linebreak, that is, vertical whitespace, plus the multi-character sequence "\x0D\x0A"
.
_
prototypeA new prototype character has been added. _
is equivalent to $
(it denotes a scalar), but defaults to $_
if the corresponding argument isn't supplied. Due to the optional nature of the argument, you can only use it at the end of a prototype, or before a semicolon.
This has a small incompatible consequence: the prototype() function has been adjusted to return _
for some built-ins in appropriate cases (for example, prototype('CORE::rmdir')
). (Rafael)
UNITCHECK
, a new special code block has been introduced, in addition to BEGIN
, CHECK
, INIT
and END
.
CHECK
and INIT
blocks, while useful for some specialized purposes, are always executed at the transition between the compilation and the execution of the main program, and thus are useless whenever code is loaded at runtime. On the other hand, UNITCHECK
blocks are executed just after the unit which defined them has been compiled. See perlmod for more information. (Alex Gough)
The built-in function readpipe() is now overridable. Overriding it permits also to override its operator counterpart, qx//
(a.k.a. ``
). Moreover, it now defaults to $_
if no argument is provided. (Rafael)
readline() now defaults to *ARGV
if no argument is provided. (Rafael)
The copy of the Unicode Character Database included in Perl 5.9 has been updated to version 5.0.0.
The smart match operator (~~
) is now available by default (you don't need to enable it with use feature
any longer). (Michael G Schwern)
feature
The feature
pragma is now implicitly loaded when you require a minimal perl version (with the use VERSION
construct) greater than, or equal to, 5.9.5.
mro
A new pragma, mro
(for Method Resolution Order) has been added. It permits to switch, on a per-class basis, the algorithm that perl uses to find inherited methods in case of a multiple inheritance hierarchy. The default MRO hasn't changed (DFS, for Depth First Search). Another MRO is available: the C3 algorithm. See mro for more information. (Brandon Black)
Note that, due to changes in the implementation of class hierarchy search, code that used to undef the *ISA
glob will most probably break. Anyway, undef'ing *ISA
had the side-effect of removing the magic on the @ISA array and should not have been done in the first place.
The three numeric pragmas bignum
, bigint
and bigrat
are now lexically scoped. (Tels)
Many bugs have been fixed; noteworthy are comparisons with NaN, which no longer warn about undef values.
The following things are new:
The config() method now also supports the calling-style config('lib')
in addition to config()->{'lib'}
.
Upon import, using lib => 'Foo'
now warns if the low-level library cannot be found. To suppress the warning, you can use try => 'Foo'
instead. To convert the warning into a die, use only => 'Foo'
instead.
A rounding mode of common
is now supported.
Also, support for the following methods has been added:
In addition, the default math-backend (Calc (Perl) and FastCalc (XS)) now support storing numbers in parts with 9 digits instead of 7 on Perls with either 64bit integer or long double support. This means math operations scale better and are thus faster for really big numbers.
Locale::Maketext::Simple
, needed by CPANPLUS, is a simple wrapper around Locale::Maketext::Lexicon
. Note that Locale::Maketext::Lexicon
isn't included in the perl core; the behaviour of Locale::Maketext::Simple
gracefully degrades when the later isn't present.Params::Check
implements a generic input parsing/checking mechanism. It is used by CPANPLUS.Term::UI
simplifies the task to ask questions at a terminal prompt.Object::Accessor
provides an interface to create per-object accessors.Module::Pluggable
is a simple framework to create modules that accept pluggable sub-modules.Module::Load::Conditional
provides simple ways to query and possibly load installed modules.Time::Piece
provides an object oriented interface to time functions, overriding the built-ins localtime() and gmtime().IPC::Cmd
helps to find and run external commands, possibly interactively.File::Fetch
provide a simple generic file fetching mechanism.Log::Message
and Log::Message::Simple
are used by the log facility of CPANPLUS
.Archive::Extract
is a generic archive extraction mechanism for .tar (plain, gziped or bzipped) or .zip files.CPANPLUS
provides an API and a command-line tool to access the CPAN mirrors.assertions
The assertions
pragma, its submodules assertions::activate
and assertions::compat
and the -A command-line switch have been removed. The interface was not judged mature enough for inclusion in a stable release.
base
The base
pragma now warns if a class tries to inherit from itself. (Curtis "Ovid" Poe)
strict
and warnings
strict
and warnings
will now complain loudly if they are loaded via incorrect casing (as in use Strict;
). (Johan Vromans)
warnings
The warnings
pragma doesn't load Carp
anymore. That means that code that used Carp
routines without having loaded it at compile time might need to be adjusted; typically, the following (faulty) code won't work anymore, and will require parentheses to be added after the function name:
use warnings; require Carp; Carp::confess "argh";
less
less
now does something useful (or at least it tries to). In fact, it has been turned into a lexical pragma. So, in your modules, you can now test whether your users have requested to use less CPU, or less memory, less magic, or maybe even less fat. See less for more. (Joshua ben Jore)
Attribute::Handlers
Attribute::Handlers
can now report the caller's file and line number. (David Feldman)
B::Lint
B::Lint
is now based on Module::Pluggable
, and so can be extended with plugins. (Joshua ben Jore)
B
It's now possible to access the lexical pragma hints (%^H
) by using the method B::COP::hints_hash(). It returns a B::RHE
object, which in turn can be used to get a hash reference via the method B::RHE::HASH(). (Joshua ben Jore)
Thread
As the old 5005thread threading model has been removed, in favor of the ithreads scheme, the Thread
module is now a compatibility wrapper, to be used in old code only. It has been removed from the default list of dynamic extensions.
cpanp
cpanp
, the CPANPLUS shell, has been added. (cpanp-run-perl
, an helper for CPANPLUS operation, has been added too, but isn't intended for direct use).
cpan2dist
cpan2dist
is a new utility, that comes with CPANPLUS. It's a tool to create distributions (or packages) from CPAN modules.
pod2html
The output of pod2html
has been enhanced to be more customizable via CSS. Some formatting problems were also corrected. (Jari Aalto)
A new manual page, perlunifaq (the Perl Unicode FAQ), has been added (Juerd Waalboer).
Efforts have been made to make perl and the core XS modules compilable with various C++ compilers (although the situation is not perfect with some of the compilers on some of the platforms tested.)
Perl now can be compiled with Microsoft Visual C++ 2005.
It's now possible to build a perl-static.exe
that doesn't depend on perl59.dll
on Win32. See the Win32 makefiles for details. (Vadim Konovalov)
All win32 builds (MS-Win, WinCE) have been merged and cleaned up.
d_pseudofork
and d_printf_format_null
A new configuration variable, available as $Config{d_pseudofork}
in the Config module, has been added, to distinguish real fork() support from fake pseudofork used on Windows platforms.
A new configuration variable, d_printf_format_null
, has been added, to see if printf-like formats are allowed to be NULL.
Configure -h
has been extended with the most used option.
Much less 'Whoa there' messages.
Better detection of 64bit(only) systems, and setting all the (library) paths accordingly.
Perl has been reported to work on MidnightBSD.
Support for Cray XT4 Catamount/Qk has been added.
Vendor patches have been merged for RedHat and GenToo.
PerlIO::scalar will now prevent writing to read-only scalars. Moreover, seek() is now supported with PerlIO::scalar-based filehandles, the underlying string being zero-filled as needed. (Rafael, Jarkko Hietaniemi)
study() never worked for UTF-8 strings, but could lead to false results. It's now a no-op on UTF-8 data. (Yves Orton)
The signals SIGILL, SIGBUS and SIGSEGV are now always delivered in an "unsafe" manner (contrary to other signals, that are deferred until the perl interpreter reaches a reasonably stable state; see "Deferred Signals (Safe Signals)" in perlipc). (Rafael)
When a module or a file is loaded through an @INC-hook, and when this hook has set a filename entry in %INC, __FILE__ is now set for this module accordingly to the contents of that %INC entry. (Rafael)
The -w
and -t
switches can now be used together without messing up what categories of warnings are activated or not. (Rafael)
Duping a filehandle which has the :utf8
PerlIO layer set will now properly carry that layer on the duped filehandle. (Rafael)
Localizing an hash element whose key was given as a variable didn't work correctly if the variable was changed while the local() was in effect (as in local $h{$x}; ++$x
). (Bo Lindbergh)
Two deprecation warnings have been added: (Rafael)
Opening dirhandle %s also as a file Opening filehandle %s also as a directory
The anonymous hash and array constructors now take 1 op in the optree instead of 3, now that pp_anonhash and pp_anonlist return a reference to an hash/array when the op is flagged with OPf_SPECIAL (Nicholas Clark).
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/rt3/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl594delta - what is new for perl v5.9.4
This document describes differences between the 5.9.3 and the 5.9.4 development releases. See "p590-NAME", "p591-NAME", "p592-NAME" and "p593-NAME" for the differences between 5.8.0 and 5.9.3.
A bareword argument to chdir() is now recognized as a file handle. Earlier releases interpreted the bareword as a directory name. (Gisle Aas)
An old feature of perl was that before require
or use
look for a file with a .pm extension, they will first look for a similar filename with a .pmc extension. If this file is found, it will be loaded in place of any potentially existing file ending in a .pm extension.
Previously, .pmc files were loaded only if more recent than the matching .pm file. Starting with 5.9.4, they'll be always loaded if they exist. (This trick is used by Pugs.)
The special arrays @-
and @+
are no longer interpolated in regular expressions. (Sadahiro Tomoyuki)
If you call a subroutine by a tainted name, and if it defers to an AUTOLOAD function, then $AUTOLOAD will be (correctly) tainted. (Rick Delaney)
A new class of variables has been introduced. State variables are similar to my
variables, but are declared with the state
keyword in place of my
. They're visible only in their lexical scope, but their value is persistent: unlike my
variables, they're not undefined at scope entry, but retain their previous value. (Rafael Garcia-Suarez)
To use state variables, one needs to enable them by using
use feature "state";
or by using the -E
command-line switch in one-liners.
See "Persistent variables via state()" in perlsub.
The UNIVERSAL
class has a new method, DOES()
. It has been added to solve semantic problems with the isa()
method. isa()
checks for inheritance, while DOES()
has been designed to be overridden when module authors use other types of relations between classes (in addition to inheritance). (chromatic)
See "$obj->DOES( ROLE )" in UNIVERSAL.
The constant folding routine is now wrapped in an exception handler, and if folding throws an exception (such as attempting to evaluate 0/0), perl now retains the current optree, rather than aborting the whole program. (Nicholas Clark, Dave Mitchell)
It's possible to enhance the mechanism of subroutine hooks in @INC by adding a source filter on top of the filehandle opened and returned by the hook. This feature was planned a long time ago, but wasn't quite working until now. See "require" in perlfunc for details. (Nicholas Clark)
MAD, which stands for Misc Attribute Decoration, is a still-in-development work leading to a Perl 5 to Perl 6 converter. To enable it, it's necessary to pass the argument -Dmad
to Configure. The obtained perl isn't binary compatible with a regular perl 5.9.4, and has space and speed penalties; moreover not all regression tests still pass with it. (Larry Wall, Nicholas Clark)
encoding::warnings
is now a lexical pragma. (Although on older perls, which don't have support for lexical pragmas, it keeps its global behaviour.) (Audrey Tang)threads
is now a dual-life module, also available on CPAN. It has been expanded in many ways. A kill() method is available for thread signalling. One can get thread status, or the list of running or joinable threads.
A new threads->exit()
method is used to exit from the application (this is the default for the main thread) or from the current thread only (this is the default for all other threads). On the other hand, the exit() built-in now always causes the whole application to terminate. (Jerry D. Hedden)
Hash::Util::FieldHash
, by Anno Siegel, has been added. This module provides support for field hashes: hashes that maintain an association of a reference with a value, in a thread-safe garbage-collected way. Such hashes are useful to implement inside-out objects.Module::Build
, by Ken Williams, has been added. It's an alternative to ExtUtils::MakeMaker
to build and install perl modules.Module::Load
, by Jos Boumans, has been added. It provides a single interface to load Perl modules and .pl files.Module::Loaded
, by Jos Boumans, has been added. It's used to mark modules as loaded or unloaded.Package::Constants
, by Jos Boumans, has been added. It's a simple helper to list all constants declared in a given package.Win32API::File
, by Tye McQueen, has been added (for Windows builds). This module provides low-level access to Win32 system API calls for files/dirs.config_data
is a new utility that comes with Module::Build
. It provides a command-line interface to the configuration of Perl modules that use Module::Build's framework of configurability (that is, *::ConfigData
modules that contain local configuration information for their parent modules.)
The perlpragma manpage documents how to write one's own lexical pragmas in pure Perl (something that is possible starting with 5.9.4).
The perlreguts manpage, courtesy of Yves Orton, describes internals of the Perl regular expression engine.
The perlunitut manpage is an tutorial for programming with Unicode and string encodings in Perl, courtesy of Juerd Waalboer.
Several internal data structures (typeglobs, GVs, CVs, formats) have been restructured to use less memory. (Nicholas Clark)
The UTF-8 caching code is now more efficient, and used more often. (Nicholas Clark)
The regular expression engine is no longer recursive, meaning that patterns that used to overflow the stack will either die with useful explanations, or run to completion, which, since they were able to blow the stack before, will likely take a very long time to happen. If you were experiencing the occasional stack overflow (or segfault) and upgrade to discover that now perl apparently hangs instead, look for a degenerate regex. (Dave Mitchell)
Classes of a single character are now treated the same as if the character had been used as a literal, meaning that code that uses char-classes as an escaping mechanism will see a speedup. (Yves Orton)
Alternations, where possible, are optimised into more efficient matching structures. String literal alternations are merged into a trie and are matched simultaneously. This means that instead of O(N) time for matching N alternations at a given point the new code performs in O(1) time. (Yves Orton)
Note: Much code exists that works around perl's historic poor performance on alternations. Often the tricks used to do so will disable the new optimisations. Hopefully the utility modules used for this purpose will be educated about these new optimisations by the time 5.10 is released.
When a pattern starts with a trie-able alternation and there aren't better optimisations available the regex engine will use Aho-Corasick matching to find the start point. (Yves Orton)
On Windows, perl's stat() function normally opens the file to determine the link count and update attributes that may have been changed through hard links. Setting ${^WIN32_SLOPPY_STAT} to a true value speeds up stat() by not performing this operation. (Jan Dubois)
There is now Configure support for creating a relocatable perl tree. If you Configure with -Duserelocatableinc
, then the paths in @INC (and everything else in %Config) can be optionally located via the path of the perl executable.
That means that, if the string ".../"
is found at the start of any path, it's substituted with the directory of $^X. So, the relocation can be configured on a per-directory basis, although the default with -Duserelocatableinc
is that everything is relocated. The initial install is done to the original configured prefix.
Many improvements have been made towards making Perl work correctly on z/OS.
Perl has been reported to work on DragonFlyBSD.
All ppport.h files in the XS modules bundled with perl are now autogenerated at build time. (Marcus Holland-Moritz)
The configuration process now detects whether strlcat() and strlcpy() are available. When they are not available, perl's own version is used (from Russ Allbery's public domain implementation). Various places in the perl interpreter now use them. (Steve Peters)
Support for building XS extension modules with the free MinGW compiler has been improved in the case where perl itself was built with the Microsoft VC++ compiler. (ActiveState)
Support for building perl with Microsoft's 64-bit compiler has been improved. (ActiveState)
On Windows, the PERL5SHELL environment variable is now checked for taintedness. (Rafael Garcia-Suarez)
stat()
and -X
filetests now treat *FILE{IO} filehandles like *FILE filehandles. (Steve Peters)
Overloading now works when references are reblessed into another class. Internally, this has been implemented by moving the flag for "overloading" from the reference to the referent, which logically is where it should always have been. (Nicholas Clark)
A few bugs related to UTF-8 handling with objects that have stringification overloaded have been fixed. (Nicholas Clark)
Traditionally, eval 'syntax error'
has leaked badly. Many (but not all) of these leaks have now been eliminated or reduced. (Dave Mitchell)
In previous versions, perl would read the file /dev/urandom if it existed when seeding its random number generator. That file is unlikely to exist on Windows, and if it did would probably not contain appropriate data, so perl no longer tries to read it on Windows. (Alex Davies)
One can assign initial values to state variables, but not when they're declared as a sub-part of a list assignment. See perldiag.
A new file, mathoms.c, contains functions that aren't used anymore in the perl core, but remain around because modules out there might still use them. They come from a factorization effort: for example, many PP functions are now shared for several ops.
The implementation of the special variables $^H and %^H has changed, to allow implementing lexical pragmas in pure perl.
One warning test (number 263 in lib/warnings.t) fails under UTF-8 locales.
Bytecode tests fail under several platforms. We are considering removing support for byteloader and compiler before the 5.10.0 release.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/rt3/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl593delta - what is new for perl v5.9.3
This document describes differences between the 5.9.2 and the 5.9.3 development releases. See "p590-NAME", "p591-NAME" and "p592-NAME" for the differences between 5.8.0 and 5.9.2.
-f _
The identifier _
is now forced to be a bareword after a filetest operator. This solves a number of misparsing issues when a global _
subroutine is defined.
mkdir()
mkdir()
without arguments now defaults to $_
.
The construct eval { goto &foo }
is now disallowed. (Note that the similar construct, but with eval("")
instead, was already forbidden.)
$#
has been removedThe deprecated $#
variable (output format for numbers) has been removed. A new warning, $# is no longer supported
, has been added.
:unique
The :unique
attribute has been made a no-op, since its current implementation was fundamentally flawed and not threadsafe.
sort
pragmaThe sort
pragma is now lexically scoped. Its effect used to be global.
feature
pragmaThe feature
pragma is used to enable new syntax that would break Perl's backwards-compatibility with older releases of the language. It's a lexical pragma, like strict
or warnings
.
Currently the following new features are available: switch
(adds a switch statement), ~~
(adds a Perl 6-like smart match operator), say
(adds a say
built-in function), and err
(adds an err
keyword). Those features are described below.
Note that err
low-precedence defined-or operator used to be enabled by default (although as a weak keyword, meaning that any function would override it). It's now only recognized when explicitly turned on (and is then a regular keyword).
Those features, and the feature
pragma itself, have been contributed by Robin Houston.
Perl 5 now has a switch statement. It's available when use feature 'switch'
is in effect. This feature introduces three new keywords, given
, when
, and default
:
given ($foo) { when (/^abc/) { $abc = 1; } when (/^def/) { $def = 1; } when (/^xyz/) { $xyz = 1; } default { $nothing = 1; } }
A more complete description of how Perl matches the switch variable against the when
conditions is given in "Switch statements" in perlsyn.
This kind of match is called smart match, and it's also possible to use it outside of switch statements, via the new ~~
operator (enabled via the use feature '~~'
directive). See "Smart matching in detail" in perlsyn.
say()
say() is a new built-in, only available when use feature 'say'
is in effect, that is similar to print(), but that implicitly appends a newline to the printed string. See "say" in perlfunc.
CLONE_SKIP()
Perl has now support for the CLONE_SKIP
special subroutine. Like CLONE
, CLONE_SKIP
is called once per package; however, it is called just before cloning starts, and in the context of the parent thread. If it returns a true value, then no objects of that class will be cloned. See perlmod for details. (Contributed by Dave Mitchell.)
${^CHILD_ERROR_NATIVE}
A new internal variable, ${^CHILD_ERROR_NATIVE}
, gives the native status returned by the last pipe close, backtick command, successful call to wait() or waitpid(), or from the system() operator. See perlrun for details. (Contributed by Gisle Aas.)
The support for assertions, introduced in perl 5.9.0, has been improved. The syntax for the -A
command-line switch has changed; it now accepts an optional module name, defaulting to assertions::activate
. See assertions and perlrun. (Contributed by Salvador Fandiño GarcÃa.)
The copy of the Unicode Character Database included in Perl 5.9 has been updated to 4.1.0.
no VERSION
You can now use no
followed by a version number to specify that you want to use a version of perl older than the specified one.
You can now use recursive subroutines with sort(), thanks to Robin Houston.
The compile-time value of the %^H
hint variable can now propagate into eval("")uated code. This makes it more useful to implement lexical pragmas.
As a side-effect of this, the overloaded-ness of constants now propagates into eval("").
-E is equivalent to -e, but it implicitly enables all optional features (like use feature ":5.10"
).
chdir
, chmod
and chown
on filehandleschdir
, chmod
and chown
can now work on filehandles as well as filenames, if the system supports respectively fchdir
, fchmod
and fchown
, thanks to a patch provided by Gisle Aas.
$(
and $)
now return groups in the order where the OS returns them, thanks to Gisle Aas. This wasn't previously the case.
feature
, has been added; see above in "p593-Core Enhancements".assertions::compat
, also available on CPAN, allows the use of assertions on perl versions prior to 5.9.0 (that is the first one to natively support them).Math::BigInt::FastCalc
is an XS-enabled, and thus faster, version of Math::BigInt::Calc
.Compress::Zlib
is an interface to the zlib compression library. It comes with a bundled version of zlib, so having a working zlib is not a prerequisite to install it. It's used by Archive::Tar
(see below).IO::Zlib
is an IO::
-style interface to Compress::Zlib
.Archive::Tar
is a module to manipulate tar
archives.Digest::SHA
is a module used to calculate many types of SHA digests, has been included for SHA support in the CPAN module.ExtUtils::CBuilder
and ExtUtils::ParseXS
have been added.ptar
ptar
is a pure perl implementation of tar
, that comes with Archive::Tar
.
ptardiff
ptardiff
is a small script used to generate a diff between the contents of a tar archive and a directory tree. Like ptar
, it comes with Archive::Tar
.
shasum
This command-line utility, used to print or to check SHA digests, comes with the new Digest::SHA
module.
h2xs
enhancementsh2xs
implements a new option --use-xsloader
to force use of XSLoader
even in backwards compatible modules.
The handling of authors' names that had apostrophes has been fixed.
Any enums with negative values are now skipped.
perlivp
enhancementsperlivp
no longer checks for *.ph files by default. Use the new -a
option to run all tests.
The perlglossary manpage is a glossary of terms used in the Perl documentation, technical and otherwise, kindly provided by O'Reilly Media, Inc.
perltodo now lists a rough roadmap to Perl 5.10.
Some pure-perl code that perl was using to retrieve Unicode properties and transliteration mappings has been reimplemented in XS.
The interpreter internals now support a far more memory efficient form of inlineable constants. Storing a reference to a constant value in a symbol table is equivalent to a full typeglob referencing a constant subroutine, but using about 400 bytes less memory. This proxy constant subroutine is automatically upgraded to a real typeglob with subroutine if necessary. The approach taken is analogous to the existing space optimisation for subroutine stub declarations, which are stored as plain scalars in place of the full typeglob.
Several of the core modules have been converted to use this feature for their system dependent constants - as a result use POSIX;
now takes about 200K less memory.
PERL_DONT_CREATE_GVSV
The new compilation flag PERL_DONT_CREATE_GVSV
, introduced as an option in perl 5.8.8, is turned on by default in perl 5.9.3. It prevents perl from creating an empty scalar with every new typeglob. See "p589-NAME" for details.
Weak reference creation is now O(1) rather than O(n), courtesy of Nicholas Clark. Weak reference deletion remains O(n), but if deletion only happens at program exit, it may be skipped completely.
Salvador Fandiño provided improvements to reduce the memory usage of sort
and to speed up some cases.
Parallel makes should work properly now, although there may still be problems if make test
is instructed to run in parallel.
Building with Borland's compilers on Win32 should work more smoothly. In particular Steve Hay has worked to side step many warnings emitted by their compilers and at least one C compiler internal error.
Perl extensions on Windows now can be statically built into the Perl DLL, thanks to a work by Vadim Konovalov.
Perl is being ported to Symbian OS. See perlsymbian for more information.
The VMS port has been improved. See perlvms.
DynaLoader::dl_unload_file() now works on Windows.
Portability of Perl on various recent compilers on Windows has been improved (Borland C++, Visual C++ 7.0).
Configure
will now detect clearenv
and unsetenv
, thanks to a patch from Alan Burlison. It will also probe for futimes
(and use it internally if available), and whether sprintf
correctly returns the length of the formatted string.
README files and changelogs for CPAN modules bundled with perl are no longer installed.
defined $$x
use strict "refs"
was ignoring taking a hard reference in an argument to defined(), as in :
use strict "refs"; my $x = "foo"; if (defined $$x) {...}
This now correctly produces the run-time error Can't use string as a SCALAR ref while "strict refs" in use
. (However, defined @$foo
and defined %$foo
are still allowed. Those constructs are discouraged anyway.)
CORE::require() and CORE::do() were always parsed as require() and do() when they were overridden. This is now fixed.
You can now use a non-arrowed form for chained subscripts after a list slice, like in:
({foo => "bar"})[0]{foo}
This used to be a syntax error; a ->
was required.
Perl 5.9.2 introduced a change so that assignments of undef
to a scalar, or of an empty list to an array or a hash, were optimised out. As this could cause problems when goto
jumps were involved, this change was backed out.
Using the sprintf() function with some formats could lead to a buffer overflow in some specific cases. This has been fixed, along with several other bugs, notably in bounds checking.
In related fixes, it was possible for badly written code that did not follow the documentation of Sys::Syslog
to have formatting vulnerabilities. Sys::Syslog
has been changed to protect people from poor quality third party code.
Previously when running with warnings enabled globally via -w
, selective disabling of specific warning categories would actually turn off all warnings. This is now fixed; now no warnings 'io';
will only turn off warnings in the io
class. Previously it would erroneously turn off all warnings.
FindBin
now works better with directories where access rights are more restrictive than usual.$!
and $^E
.$(
and $)
, now dynamically allocate memory rather than using a fixed sized array. The fixed size array could cause C stack exhaustion on systems configured to use large numbers of groups.PerlIO::scalar
now works better with non-default $/
settings.x
repetition operator is now able to operate on qw//
lists. This used to raise a syntax error.open
pragma is no longer ignored for three-argument opens.unsetenv
and clearenv
if present to delete keys from %ENV
and delete %ENV
entirely, thanks to a patch from Alan Burlison.\x{FFFD}
, the Unicode replacement character, unless when the bytes
pragma is in effect, where the low eight bytes of the value are used.lcfirst
and ucfirst
could corrupt the string for certain cases where the length UTF-8 encoding of the string in lower case, upper case or title case differed. This was fixed by Nicholas Clark.This is a new warning, produced in situations like the following one:
$r = do {my @a; \$#a}; $$r = 503;
This is a new warning, produced when number has been passed as a argument to select(), instead of a bitmask.
# Wrong, will now warn $rin = fileno(STDIN); ($nfound,$timeleft) = select($rout=$rin, undef, undef, $timeout); # Should be $rin = ''; vec($rin,fileno(STDIN),1) = 1; ($nfound,$timeleft) = select($rout=$rin, undef, undef, $timeout);
This syntax error indicates that the lexer couldn't find the final delimiter of a ?PATTERN?
construct. Mentioning the ternary operator in this error message makes syntax diagnostic easier.
This warning is now emitted in more consistent cases; in short, when one of the declarations involved is a my
variable:
my $x; my $x; # warns my $x; our $x; # warns our $x; my $x; # warns
On the other hand, the following:
our $x; our $x;
now gives a "our" variable %s redeclared
warning.
These new warnings are now emitted when a dirhandle is used but is either closed or not really a dirhandle.
In general, the source code of perl has been refactored, tied up, and optimized in many places. Also, memory management and allocation has been improved in a couple of points.
Andy Lester supplied many improvements to determine which function parameters and local variables could actually be declared const
to the C compiler. Steve Peters provided new *_set
macros and reworked the core to use these rather than assigning to macros in LVALUE context.
Dave Mitchell improved the lexer debugging output under -DT
.
A new file, mathoms.c, has been added. It contains functions that are no longer used in the perl core, but that remain available for binary or source compatibility reasons. However, those functions will not be compiled in if you add -DNO_MATHOMS
in the compiler flags.
The AvFLAGS
macro has been removed.
The av_*()
functions, used to manipulate arrays, no longer accept null AV*
parameters.
The inheritance hierarchy of B::
modules has changed; B::NV
now inherits from B::SV
(it used to inherit from B::IV
).
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl592delta - what is new for perl v5.9.2
This document describes differences between the 5.9.1 and the 5.9.2 development releases. See "p590-NAME" and "p591-NAME" for the differences between 5.8.0 and 5.9.1.
The semantics of pack() and unpack() regarding UTF-8-encoded data has been changed. Processing is now by default character per character instead of byte per byte on the underlying encoding. Notably, code that used things like pack("a*", $string)
to see through the encoding of string will now simply get back the original $string. Packed strings can also get upgraded during processing when you store upgraded characters. You can get the old behaviour by using use bytes
.
To be consistent with pack(), the C0
in unpack() templates indicates that the data is to be processed in character mode, i.e. character by character; on the contrary, U0
in unpack() indicates UTF-8 mode, where the packed string is processed in its UTF-8-encoded Unicode form on a byte by byte basis. This is reversed with regard to perl 5.8.X.
Moreover, C0
and U0
can also be used in pack() templates to specify respectively character and byte modes.
C0
and U0
in the middle of a pack or unpack format now switch to the specified encoding mode, honoring parens grouping. Previously, parens were ignored.
Also, there is a new pack() character format, W
, which is intended to replace the old C
. C
is kept for unsigned chars coded as bytes in the strings internal representation. W
represents unsigned (logical) character values, which can be greater than 255. It is therefore more robust when dealing with potentially UTF-8-encoded data (as C
will wrap values outside the range 0..255, and not respect the string encoding).
In practice, that means that pack formats are now encoding-neutral, except C
.
For consistency, A
in unpack() format now trims all Unicode whitespace from the end of the string. Before perl 5.9.2, it used to strip only the classical ASCII space characters.
The internal dump output has been improved, so that non-printable characters such as newline and backspace are output in \x
notation, rather than octal.
The -C option can no longer be used on the #!
line. It wasn't working there anyway.
Perl can now be built to detect attempts to assign pathologically large chunks of memory. Previously such assignments would suffer from integer wrap-around during size calculations causing a misallocation, which would crash perl, and could theoretically be used for "stack smashing" attacks. The wrapping defaults to enabled on platforms where we know it works (most AIX configurations, BSDi, Darwin, DEC OSF/1, FreeBSD, HP-UX, GNU Linux, OpenBSD, Solaris, VMS and most Win32 compilers) and defaults to disabled on other platforms.
The copy of the Unicode Character Database included in Perl 5.9 has been updated to 4.0.1 from 4.0.0.
Paul Szabo has analysed and patched suidperl
to remove existing known insecurities. Currently there are no known holes in suidperl
, but previous experience shows that we cannot be confident that these were the last. You may no longer invoke the set uid perl directly, so to preserve backwards compatibility with scripts that invoke #!/usr/bin/suidperl the only set uid binary is now sperl5.9.
n (sperl5.9.2
for this release). suidperl
is installed as a hard link to perl
; both suidperl
and perl
will invoke sperl5.9.2
automatically the set uid binary, so this change should be completely transparent.
For new projects the core perl team would strongly recommend that you use dedicated, single purpose security tools such as sudo
in preference to suidperl
.
The PERLIO_DEBUG
environment variable has no longer any effect for setuid scripts and for scripts run with -T.
Moreover, with a thread-enabled perl, using PERLIO_DEBUG
could lead to an internal buffer overflow. This has been fixed.
In addition to bug fixes, format
's features have been enhanced. See perlform.
Perl's regular expression engine now contains support for matching on the intersection of two Unicode character classes. You can also now refer to user-defined character classes from within other user defined character classes.
There are two new byte-order modifiers, >
(big-endian) and <
(little-endian), that can be appended to most pack() and unpack() template characters and groups to force a certain byte-order for that type or group. See "pack" in perlfunc and perlpacktut for details.
A new pack() template character, "."
, returns the number of characters read so far.
A new variable, ${^RE_DEBUG_FLAGS}, controls what debug flags are in effect for the regular expression engine when running under use re "debug"
. See re for details.
A new variable ${^UTF8LOCALE} indicates where a UTF-8 locale was detected by perl at startup.
encoding::warnings
, by Audrey Tang, is a module to emit warnings whenever an ASCII character string containing high-bit bytes is implicitly converted into UTF-8.Module::CoreList
, by Richard Clamp, is a small handy module that tells you what versions of core modules ship with any versions of Perl 5. It comes with a command-line frontend, corelist
.Dual-lived modules have been updated to be kept up-to-date with respect to CPAN.
The dual-lived modules which contain an _
in their version number are actually ahead of the corresponding CPAN release.
B::Concise
was significantly improved.
There is experimental support for Linux abstract Unix domain sockets.
syslog()
can now use numeric constants for facility names and priorities, in addition to strings.
Detached threads are now also supported on Windows.
corelist
utility is now installed with perl (see "p592-New modules" above).h2ph
and h2xs
have been made a bit more robust with regard to "modern" C code.find2perl
, regarding -exec
and -eval
. Also the options -path
, -ipath
and -iname
have been added.It can also display the parent inheritance tree of a given class.
Perl has a new -dt command-line flag, which enables threads support in the debugger.
/i
, lc
, uc
, etc) are faster.@a = sort @a
was optimized to do in-place sort. Likewise, reverse sort ...
is now optimized to sort in reverse, avoiding the generation of a temporary intermediate list.my $s = undef; my @a = (); my %h = ();
map
in scalar context is now optimized.Run-time customization of @INC can be enabled by passing the -Dusesitecustomize
flag to configure. When enabled, this will make perl run $sitelibexp/sitecustomize.pl before anything else. This script can then be set up to add additional entries to @INC.
There is alpha support for relocatable @INC entries.
Perl should build on Interix and on GNU/kFreeBSD.
Most of those bugs were reported in the perl 5.8.x maintenance track. Notably, quite a few utf8 bugs were fixed, and several memory leaks were suppressed. The perl58Xdelta manpages have more details on them.
Development-only bug fixes include :
$Foo::_
was wrongly forced as $main::_
.
A new warning, !=~ should be !~
, is emitted to prevent this misspelling of the non-matching operator.
The warning Newline in left-justified string has been removed.
The error Too late for "-T" option has been reformulated to be more descriptive.
There is a new compilation error, Illegal declaration of subroutine, for an obscure case of syntax errors.
The diagnostic output of Carp has been changed slightly, to add a space after the comma between arguments. This makes it much easier for tools such as web browsers to wrap it, but might confuse any automatic tools which perform detailed parsing of Carp output.
perl -V
has several improvements, making it more useable from shell scripts to get the value of configuration variables. See perlrun for details.
The perl core has been refactored and reorganised in several places. In short, this release will not be binary compatible with any previous perl release.
For threaded builds, ext/threads/shared/t/wait.t has been reported to fail some tests on HP-UX 10.20.
Net::Ping might fail some tests on HP-UX 11.00 with the latest OS upgrades.
t/io/dup.t, t/io/open.t and lib/ExtUtils/t/Constant.t fail some tests on some BSD flavours.
The current plan for perl 5.9.3 is to add CPANPLUS as a core module. More regular expression optimizations are also in the works.
It is planned to release a development version of perl more frequently, i.e. each time something major changes.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl591delta - what is new for perl v5.9.1
This document describes differences between the 5.9.0 and the 5.9.1 development releases. See "p590-NAME" for the differences between 5.8.0 and 5.9.0.
The lvalues returned by the three argument form of substr() used to be a "fixed length window" on the original string. In some cases this could cause surprising action at distance or other undefined behaviour. Now the length of the window adjusts itself to the length of the string assigned to it.
:unique
attribute is only meaningful for globalsNow applying :unique
to lexical variables and to subroutines will result in a compilation error.
$_
The default variable $_
can now be lexicalized, by declaring it like any other lexical variable, with a simple
my $_;
The operations that default on $_
will use the lexically-scoped version of $_
when it exists, instead of the global $_
.
In a map
or a grep
block, if $_
was previously my'ed, then the $_
inside the block is lexical as well (and scoped to the block).
In a scope where $_
has been lexicalized, you can still have access to the global version of $_
by using $::_
, or, more simply, by overriding the lexical declaration with our $_
.
As of perl 5.8.2/5.9.0, tied hashes did not return anything useful in scalar context, for example when used as boolean tests:
if (%tied_hash) { ... }
The old nonsensical behaviour was always to return false, regardless of whether the hash is empty or has elements.
There is now an interface for the implementors of tied hashes to implement the behaviour of a hash in scalar context, via the SCALAR method (see perltie). Without a SCALAR method, perl will try to guess whether the hash is empty, by testing if it's inside an iteration (in this case it can't be empty) or by calling FIRSTKEY.
Formats were improved in several ways. A new field, ^*
, can be used for variable-width, one-line-at-a-time text. Null characters are now handled correctly in picture lines. Using @#
and ~~
together will now produce a compile-time error, as those format fields are incompatible. perlform has been improved, and miscellaneous bugs fixed.
As a new form of syntactic sugar, it's now possible to stack up filetest operators. You can now write -f -w -x $file
in a row to mean -x $file && -w _ && -f _
. See "-X" in perlfunc.
In Benchmark
, cmpthese() and timestr() now use the time statistics of children instead of parent when the selected style is 'nop'.
The error messages produced by Carp
now include spaces between the arguments in function argument lists: this makes long error messages appear more nicely in browsers and other tools.
Exporter
will now recognize grouping tags (such as :name
) anywhere in the import list, not only at the beginning.
A function again
is provided to resolve problems where modules in different directories wish to use FindBin.
You can now weaken references to read only values.
cond_wait
has a new two argument form. cond_timedwait
has been added.
find2perl
now assumes -print
as a default action. Previously, it needed to be specified explicitly.
A new utility, prove
, makes it easy to run an individual regression test at the command line. prove
is part of Test::Harness, which users of earlier Perl versions can install from CPAN.
The perl debugger now supports a save
command, to save the current history to a file, and an i
command, which prints the inheritance tree of its argument (if the Class::ISA
module is installed.)
The documentation has been revised in places to produce more standard manpages.
The long-existing feature of /(?{...})/
regexps setting $_
and pos() is now documented.
Sorting arrays in place (@a = sort @a
) is now optimized to avoid making a temporary copy of the array.
The operations involving case mapping on UTF-8 strings (uc(), lc(), //i
, etc.) have been greatly speeded up.
Access to elements of lexical arrays via a numeric constant between 0 and 255 is now faster. (This used to be only the case for global arrays.)
Using substr() on a UTF-8 string could cause subsequent accesses on that string to return garbage. This was due to incorrect UTF-8 offsets being cached, and is now fixed.
join() could return garbage when the same join() statement was used to process 8 bit data having earlier processed UTF-8 data, due to the flags on that statement's temporary workspace not being reset correctly. This is now fixed.
Using Unicode keys with tied hashes should now work correctly.
chop() and chomp() used to mangle UTF-8 strings. This has been fixed.
sprintf() used to misbehave when the format string was in UTF-8. This is now fixed.
Hashes with the :unique
attribute weren't made read-only in new threads. They are now.
$a .. $b
will now work as expected when either $a or $b is undef
.
Reading $^E now preserves $!. Previously, the C code implementing $^E did not preserve errno
, so reading $^E could cause errno
and therefore $!
to change unexpectedly.
strict
wasn't in effect in regexp-eval blocks (/(?{...})/
).
A new deprecation warning, Deprecated use of my() in false conditional, has been added, to warn against the use of the dubious and deprecated construct
my $x if 0;
See perldiag.
The fatal error DESTROY created new reference to dead object is now documented in perldiag.
A new error, %ENV is aliased to %s, is produced when taint checks are enabled and when *ENV
has been aliased (and thus doesn't reflect the program's environment anymore.)
These news matter to you only if you either write XS code or like to know about or hack Perl internals (using Devel::Peek or any of the B::
modules counts), or like to run Perl with the -D
option.
The relative ordering of constants that define the various types of SV
have changed; in particular, SVt_PVGV
has been moved before SVt_PVLV
, SVt_PVAV
, SVt_PVHV
and SVt_PVCV
. This is unlikely to make any difference unless you have code that explicitly makes assumptions about that ordering. (The inheritance hierarchy of B::*
objects has been changed to reflect this.)
The C preprocessor symbols PERL_PM_APIVERSION
and PERL_XS_APIVERSION
, which were supposed to give the version number of the oldest perl binary-compatible (resp. source-compatible) with the present one, were not used, and sometimes had misleading values. They have been removed.
The BASEOP
structure now uses less space. The op_seq
field has been removed and replaced by two one-bit fields, op_opt
and op_static
. opt_type
is now 9 bits long. (Consequently, the B::OP
class doesn't provide an seq
method anymore.)
perl's parser is now generated by bison (it used to be generated by byacc.) As a result, it seems to be a bit more robust.
Configure
now invokes callbacks regardless of the value of the variable they are called for. Previously callbacks were only invoked in the case $variable $define)
branch. This change should only affect platform maintainers writing configuration hints files.
The portability and cleanliness of the Win32 makefiles has been improved.
There are still a couple of problems in the implementation of the lexical $_
: it doesn't work inside /(?{...})/
blocks and with regard to the reverse() built-in used without arguments. (See the TODO tests in t/op/mydef.t.)
The test ext/IPC/SysV/t/ipcsysv.t may fail on OpenBSD. This hasn't been diagnosed yet.
On some configurations on AIX 5, one test in lib/Time/Local.t fails. When configured with long doubles, perl may fail tests 224-236 in t/op/pow.t on the same platform.
For threaded builds, ext/threads/shared/t/wait.t has been reported to fail some tests on HP-UX 10.20.
This is a non-exhaustive, non-ordered, non-contractual and non-definitive list of things to do (or nice to have) for perl 5.10.0 :
Clean up and finish support for assertions. See assertions.
Reimplement the mechanism of lexical pragmas to be more extensible. Fix current pragmas that don't work well (or at all) with lexical scopes or in run-time eval(STRING) (sort
, re
, encoding
for example). MJD has a preliminary patch that implements this.
Fix (or rewrite) the implementation of the /(?{...})/
closures.
Conversions from byte strings to UTF-8 currently map high bit characters to Unicode without translation (or, depending on how you look at it, by implicitly assuming that the byte strings are in Latin-1). As perl assumes the C locale by default, upgrading a string to UTF-8 may change the meaning of its contents regarding character classes, case mapping, etc. This should probably emit a warning (at least).
Introduce a new special block, UNITCHECK, which is run at the end of a compilation unit (module, file, eval(STRING) block). This will correspond to the Perl 6 CHECK. Perl 5's CHECK cannot be changed or removed because the O.pm/B.pm backend framework depends on it.
Study the possibility of adding a new prototype character, _
, meaning "this argument defaults to $_".
Make the peephole optimizer optional.
Allow lexical aliases (maybe via the syntax my \$alias = \$foo
.
Fix the bugs revealed by running the test suite with the -t
switch (via make test.taintwarn
).
Make threads more robust.
Make no 6
and no v6
work (opposite of use 5.005
, etc.).
A test suite for the B module would be nice.
A ponie.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl590delta - what is new for perl v5.9.0
This document describes differences between the 5.8.0 release and the 5.9.0 release.
Mainly due to security reasons, the "random ordering" of hashes has been made even more random. Previously while the order of hash elements from keys(), values(), and each() was essentially random, it was still repeatable. Now, however, the order varies between different runs of Perl.
Perl has never guaranteed any ordering of the hash keys, and the ordering has already changed several times during the lifetime of Perl 5. Also, the ordering of hash keys has always been, and continues to be, affected by the insertion order.
The added randomness may affect applications.
One possible scenario is when output of an application has included hash data. For example, if you have used the Data::Dumper module to dump data into different files, and then compared the files to see whether the data has changed, now you will have false positives since the order in which hashes are dumped will vary. In general the cure is to sort the keys (or the values); in particular for Data::Dumper to use the Sortkeys
option. If some particular order is really important, use tied hashes: for example the Tie::IxHash module which by default preserves the order in which the hash elements were added.
More subtle problem is reliance on the order of "global destruction". That is what happens at the end of execution: Perl destroys all data structures, including user data. If your destructors (the DESTROY subroutines) have assumed any particular ordering to the global destruction, there might be problems ahead. For example, in a destructor of one object you cannot assume that objects of any other class are still available, unless you hold a reference to them. If the environment variable PERL_DESTRUCT_LEVEL is set to a non-zero value, or if Perl is exiting a spawned thread, it will also destruct the ordinary references and the symbol tables that are no longer in use. You can't call a class method or an ordinary function on a class that has been collected that way.
The hash randomisation is certain to reveal hidden assumptions about some particular ordering of hash elements, and outright bugs: it revealed a few bugs in the Perl core and core modules.
To disable the hash randomisation in runtime, set the environment variable PERL_HASH_SEED to 0 (zero) before running Perl (for more information see "PERL_HASH_SEED" in perlrun), or to disable the feature completely in compile time, compile with -DNO_HASH_SEED
(see INSTALL).
See "Algorithmic Complexity Attacks" in perlsec for the original rationale behind this change.
In Perl 5.8.0 all filehandles, including the standard filehandles, were implicitly set to be in Unicode UTF-8 if the locale settings indicated the use of UTF-8. This feature caused too many problems, so the feature was turned off and redesigned: see "p590-Core Enhancements".
The version strings or v-strings (see "Version Strings" in perldata) feature introduced in Perl 5.6.0 has been a source of some confusion-- especially when the user did not want to use it, but Perl thought it knew better. Especially troublesome has been the feature that before a "=>" a version string (a "v" followed by digits) has been interpreted as a v-string instead of a string literal. In other words:
%h = ( v65 => 42 );
has meant since Perl 5.6.0
%h = ( 'A' => 42 );
(at least in platforms of ASCII progeny) Perl 5.8.1 restored the more natural interpretation
%h = ( 'v65' => 42 );
The multi-number v-strings like v65.66 and 65.66.67 still continue to be v-strings in Perl 5.8.
The -C switch has changed in an incompatible way. The old semantics of this switch only made sense in Win32 and only in the "use utf8" universe in 5.6.x releases, and do not make sense for the Unicode implementation in 5.8.0. Since this switch could not have been used by anyone, it has been repurposed. The behavior that this switch enabled in 5.6.x releases may be supported in a transparent, data-dependent fashion in a future release.
For the new life of this switch, see "p590-UTF-8 no longer default under UTF-8 locales", and "-C" in perlrun.
Since version 5.8.1, perl uses the /d switch when running the cmd.exe shell internally for system(), backticks, and when opening pipes to external programs. The extra switch disables the execution of AutoRun commands from the registry, which is generally considered undesirable when running external programs. If you wish to retain compatibility with the older behavior, set PERL5SHELL in your environment to cmd /x/c
.
$*
variable has been removed$*
, which was deprecated in favor of the /s
and /m
regexp modifiers, has been removed.
Perl 5.9.0 has experimental support for assertions. Note that the user interface is not fully stabilized yet, and it may change until the 5.10.0 release. A new command-line switch, -A, is used to activate assertions, which are declared with the assertions
pragma. See assertions.
A new operator //
(defined-or) has been implemented. The following statement:
$a // $b
is merely equivalent to
defined $a ? $a : $b
and
$c //= $d;
can be used instead of
$c = $d unless defined $c;
This operator has the same precedence and associativity as ||
. It has a low-precedence counterpart, err
, which has the same precedence and associativity as or
. Special care has been taken to ensure that those operators Do What You Mean while not breaking old code, but some edge cases involving the empty regular expression may now parse differently. See perlop for details.
In Perl 5.8.0 many Unicode features were introduced. One of them was found to be of more nuisance than benefit: the automagic (and silent) "UTF-8-ification" of filehandles, including the standard filehandles, if the user's locale settings indicated use of UTF-8.
For example, if you had en_US.UTF-8
as your locale, your STDIN and STDOUT were automatically "UTF-8", in other words an implicit binmode(..., ":utf8") was made. This meant that trying to print, say, chr(0xff), ended up printing the bytes 0xc3 0xbf. Hardly what you had in mind unless you were aware of this feature of Perl 5.8.0. The problem is that the vast majority of people weren't: for example in RedHat releases 8 and 9 the default locale setting is UTF-8, so all RedHat users got UTF-8 filehandles, whether they wanted it or not. The pain was intensified by the Unicode implementation of Perl 5.8.0 (still) having nasty bugs, especially related to the use of s/// and tr///. (Bugs that have been fixed in 5.8.1)
Therefore a decision was made to backtrack the feature and change it from implicit silent default to explicit conscious option. The new Perl command line option -C
and its counterpart environment variable PERL_UNICODE can now be used to control how Perl and Unicode interact at interfaces like I/O and for example the command line arguments. See "-C" in perlrun and "PERL_UNICODE" in perlrun for more information.
In Perl 5.8.0 the so-called "safe signals" were introduced. This means that Perl no longer handles signals immediately but instead "between opcodes", when it is safe to do so. The earlier immediate handling easily could corrupt the internal state of Perl, resulting in mysterious crashes.
However, the new safer model has its problems too. Because now an opcode, a basic unit of Perl execution, is never interrupted but instead let to run to completion, certain operations that can take a long time now really do take a long time. For example, certain network operations have their own blocking and timeout mechanisms, and being able to interrupt them immediately would be nice.
Therefore perl 5.8.1 introduced a "backdoor" to restore the pre-5.8.0 (pre-5.7.3, really) signal behaviour. Just set the environment variable PERL_SIGNALS to unsafe
, and the old immediate (and unsafe) signal handling behaviour returns. See "PERL_SIGNALS" in perlrun and "Deferred Signals (Safe Signals)" in perlipc.
In completely unrelated news, you can now use safe signals with POSIX::SigAction. See "POSIX::SigAction" in POSIX.
Formerly, the indices passed to FETCH
, STORE
, EXISTS
, and DELETE
methods in tied array class were always non-negative. If the actual argument was negative, Perl would call FETCHSIZE implicitly and add the result to the index before passing the result to the tied array method. This behaviour is now optional. If the tied array class contains a package variable named $NEGATIVE_INDICES
which is set to a true value, negative values will be passed to FETCH
, STORE
, EXISTS
, and DELETE
unchanged.
The syntaxes
local ${$x} local @{$x} local %{$x}
now do localise variables, given that the $x is a valid variable name.
The copy of the Unicode Character Database included in Perl 5.8 has been updated to 4.0.0 from 3.2.0. This means for example that the Unicode character properties are as in Unicode 4.0.0.
unpack()
now defaults to unpacking the $_
.
map
in void context is no longer expensive. map
is now context aware, and will not construct a list if called in void context.
If a socket gets closed by the server while printing to it, the client now gets a SIGPIPE. While this new feature was not planned, it fell naturally out of PerlIO changes, and is to be considered an accidental feature.
PerlIO::get_layers(FH) returns the names of the PerlIO layers active on a filehandle.
PerlIO::via layers can now have an optional UTF8 method to indicate whether the layer wants to "auto-:utf8" the stream.
utf8::is_utf8() has been added as a quick way to test whether a scalar is encoded internally in UTF-8 (Unicode).
The following modules and pragmata have been updated since Perl 5.8.0:
In much better shape than it used to be. Still far from perfect, but maybe worth a try.
An optional feature, :hireswallclock
, now allows for high resolution wall clock times (uses Time::HiRes).
See B::Bytecode.
Now has bytes::substr.
One can now have custom character name aliases.
There is now a simple command line frontend to the CPAN.pm module called cpan.
A new option, Pair, allows choosing the separator between hash keys and values.
Significant updates on the encoding pragma functionality (tr/// and the DATA filehandle, formats).
If a filehandle has been marked as to have an encoding, unmappable characters are detected already during input, not later (when the corrupted data is being used).
The ISO 8859-6 conversion table has been corrected (the 0x30..0x39 erroneously mapped to U+0660..U+0669, instead of U+0030..U+0039). The GSM 03.38 conversion did not handle escape sequences correctly. The UTF-7 encoding has been added (making Encode feature-complete with Unicode::String).
A lot of bugs have been fixed since v1.60, the version included in Perl v5.8.0. Especially noteworthy are the bug in Calc that caused div and mod to fail for some large values, and the fixes to the handling of bad inputs.
Some new features were added, e.g. the broot() method, you can now pass parameters to config() to change some settings at runtime, and it is now possible to trap the creation of NaN and infinity.
As usual, some optimizations took place and made the math overall a tad faster. In some cases, quite a lot faster, actually. Especially alternative libraries like Math::BigInt::GMP benefit from this. In addition, a lot of the quite clunky routines like fsqrt() and flog() are now much much faster.
Diamond inheritance now works.
Reading from non-string scalars (like the special variables, see perlvar) now works.
Complete rewrite. As a side-effect, no longer refuses to startup when run by root.
New utilities: refaddr, isvstring, looks_like_number, set_prototype.
Can now store code references (via B::Deparse, so not foolproof).
Earlier versions of the strict pragma did not check the parameters implicitly passed to its "import" (use) and "unimport" (no) routine. This caused the false idiom such as:
use strict qw(@ISA); @ISA = qw(Foo);
This however (probably) raised the false expectation that the strict refs, vars and subs were being enforced (and that @ISA was somehow "declared"). But the strict refs, vars, and subs are not enforced when using this false idiom.
Starting from Perl 5.8.1, the above will cause an error to be raised. This may cause programs which used to execute seemingly correctly without warnings and errors to fail when run under 5.8.1. This happens because
use strict qw(@ISA);
will now fail with the error:
Unknown 'strict' tag(s) '@ISA'
The remedy to this problem is to replace this code with the correct idiom:
use strict; use vars qw(@ISA); @ISA = qw(Foo);
Now much more picky about extra or missing output from test scripts.
Use of nanosleep(), if available, allows mixing subsecond sleeps with alarms.
Several fixes, for example for join() problems and memory leaks. In some platforms (like Linux) that use glibc the minimum memory footprint of one ithread has been reduced by several hundred kilobytes.
Many memory leaks have been fixed.
Now returns extra information.
The h2xs
utility now produces a more modern layout: Foo-Bar/lib/Foo/Bar.pm instead of Foo/Bar/Bar.pm. Also, the boilerplate test is now called t/Foo-Bar.t instead of t/1.t.
The Perl debugger (lib/perl5db.pl) has now been extensively documented and bugs found while documenting have been fixed.
perldoc
has been rewritten from scratch to be more robust and feature rich.
perlcc -B
works now at least somewhat better, while perlcc -c
is rather more broken. (The Perl compiler suite as a whole continues to be experimental.)
perl573delta has been added to list the differences between the (now quite obsolete) development releases 5.7.2 and 5.7.3.
perl58delta and perl581delta have been added: these are the perldeltas of 5.8.0 and 5.8.1, detailing the differences respectively between 5.6.0 and 5.8.0, and between 5.8.0 and 5.8.1.
perlartistic has been added: it is the Artistic License in pod format, making it easier for modules to refer to it.
perlcheat has been added: it is a Perl cheat sheet.
perlgpl has been added: it is the GNU General Public License in pod format, making it easier for modules to refer to it.
perlmacosx has been added to tell about the installation and use of Perl in Mac OS X.
perlos400 has been added to tell about the installation and use of Perl in OS/400 PASE.
perlreref has been added: it is a regular expressions quick reference.
The Unix standard Perl location, /usr/bin/perl, is no longer overwritten by default if it exists. This change was very prudent because so many Unix vendors already provide a /usr/bin/perl, but simultaneously many system utilities may depend on that exact version of Perl, so better not to overwrite it.
One can now specify installation directories for site and vendor man and HTML pages, and site and vendor scripts. See INSTALL.
One can now specify a destination directory for Perl installation by specifying the DESTDIR variable for make install
. (This feature is slightly different from the previous Configure -Dinstallprefix=...
.) See INSTALL.
gcc versions 3.x introduced a new warning that caused a lot of noise during Perl compilation: gcc -Ialreadyknowndirectory (warning: changing search order)
. This warning has now been avoided by Configure weeding out such directories before the compilation.
One can now build subsets of Perl core modules by using the Configure flags -Dnoextensions=...
and -Donlyextensions=...
, see INSTALL.
In Cygwin Perl can now be built with threads (Configure -Duseithreads
). This works with both Cygwin 1.3.22 and Cygwin 1.5.3.
In newer FreeBSD releases Perl 5.8.0 compilation failed because of trying to use malloc.h, which in FreeBSD is just a dummy file, and a fatal error to even try to use. Now malloc.h is not used.
Perl is now known to build also in Hitachi HI-UXMPP.
Perl is now known to build again in LynxOS.
Mac OS X now installs with Perl version number embedded in installation directory names for easier upgrading of user-compiled Perl, and the installation directories in general are more standard. In other words, the default installation no longer breaks the Apple-provided Perl. On the other hand, with Configure -Dprefix=/usr
you can now really replace the Apple-supplied Perl (please be careful).
Mac OS X now builds Perl statically by default. This change was done mainly for faster startup times. The Apple-provided Perl is still dynamically linked and shared, and you can enable the sharedness for your own Perl builds by Configure -Duseshrplib
.
Perl has been ported to IBM's OS/400 PASE environment. The best way to build a Perl for PASE is to use an AIX host as a cross-compilation environment. See README.os400.
Yet another cross-compilation option has been added: now Perl builds on OpenZaurus, an Linux distribution based on Mandrake + Embedix for the Sharp Zaurus PDA. See the Cross/README file.
Tru64 when using gcc 3 drops the optimisation for toke.c to -O2
because of gigantic memory use with the default -O3
.
Tru64 can now build Perl with the newer Berkeley DBs.
Building Perl on WinCE has been much enhanced, see README.ce and README.perlce.
There have been many fixes in the area of anonymous subs, lexicals and closures. Although this means that Perl is now more "correct", it is possible that some existing code will break that happens to rely on the faulty behaviour. In practice this is unlikely unless your code contains a very complex nesting of anonymous subs, evals and lexicals.
If an input filehandle is marked :utf8
and Perl sees illegal UTF-8 coming in when doing
, if warnings are enabled a warning is immediately given - instead of being silent about it and Perl being unhappy about the broken data later. (The :encoding(utf8)
layer also works the same way.)
binmode(SOCKET, ":utf8") only worked on the input side, not on the output side of the socket. Now it works both ways.
For threaded Perls certain system database functions like getpwent() and getgrent() now grow their result buffer dynamically, instead of failing. This means that at sites with lots of users and groups the functions no longer fail by returning only partial results.
Perl 5.8.0 had accidentally broken the capability for users to define their own uppercase<->lowercase Unicode mappings (as advertised by the Camel). This feature has been fixed and is also documented better.
In 5.8.0 this
$some_unicode .=;
didn't work correctly but instead corrupted the data. This has now been fixed.
Tied methods like FETCH etc. may now safely access tied values, i.e. resulting in a recursive call to FETCH etc. Remember to break the recursion, though.
At startup Perl blocks the SIGFPE signal away since there isn't much Perl can do about it. Previously this blocking was in effect also for programs executed from within Perl. Now Perl restores the original SIGFPE handling routine, whatever it was, before running external programs.
Linenumbers in Perl scripts may now be greater than 65536, or 2**16. (Perl scripts have always been able to be larger than that, it's just that the linenumber for reported errors and warnings have "wrapped around".) While scripts that large usually indicate a need to rethink your code a bit, such Perl scripts do exist, for example as results from generated code. Now linenumbers can go all the way to 4294967296, or 2**32.
Linux
HP-UX
VMS
poll()
, and IO::Poll now uses the vendor-supplied function if detected.Win32
All the warnings related to pack() and unpack() were made more informative and consistent.
The old version
A thread exited while %d other threads were still running
was misleading because the "other" included also the thread giving the warning.
It is not illegal to clear a restricted hash, so the warning was removed.
You must specify the block of code for sub
.
The old version
Invalid [] range "%s" in transliteration operator
was simply wrong because there are no "[] ranges" in tr///.
Self-explanatory.
The padding spaces would appear after the newline, which is probably not what you had in mind.
If you think this
$x & $y == 0
tests whether the bitwise AND of $x and $y is zero, you will like this warning.
You cannot read() (or sysread()) from a closed or unopened filehandle.
Something pulled the plug on a live tied variable, Perl plays safe by bailing out.
An illegal user-defined Unicode casemapping was specified.
Something modified the values being iterated over. This is not good.
These news matter to you only if you either write XS code or like to know about or hack Perl internals (using Devel::Peek or any of the B::
modules counts), or like to run Perl with the -D
option.
The embedding examples of perlembed have been reviewed to be up to date and consistent: for example, the correct use of PERL_SYS_INIT3() and PERL_SYS_TERM().
Extensive reworking of the pad code (the code responsible for lexical variables) has been conducted by Dave Mitchell.
Extensive work on the v-strings by John Peacock.
UTF-8 length and position cache: to speed up the handling of Unicode (UTF-8) scalars, a cache was introduced. Potential problems exist if an extension bypasses the official APIs and directly modifies the PV of an SV: the UTF-8 cache does not get cleared as it should.
APIs obsoleted in Perl 5.8.0, like sv_2pv, sv_catpvn, sv_catsv, sv_setsv, are again available.
Certain Perl core C APIs like cxinc and regatom are no longer available at all to code outside the Perl core of the Perl core extensions. This is intentional. They never should have been available with the shorter names, and if you application depends on them, you should (be ashamed and) contact perl5-porters to discuss what are the proper APIs.
Certain Perl core C APIs like Perl_list
are no longer available without their Perl_
prefix. If your XS module stops working because some functions cannot be found, in many cases a simple fix is to add the Perl_
prefix to the function and the thread context aTHX_
as the first argument of the function call. This is also how it should always have been done: letting the Perl_-less forms to leak from the core was an accident. For cleaner embedding you can also force this for all APIs by defining at compile time the cpp define PERL_NO_SHORT_NAMES.
Perl_save_bool() has been added.
Regexp objects (those created with qr
) now have S-magic rather than R-magic. This fixed regexps of the form /...(??{...;$x})/ to no longer ignore changes made to $x. The S-magic avoids dropping the caching optimization and making (??{...}) constructs obscenely slow (and consequently useless). See also "Magic Variables" in perlguts. Regexp::Copy was affected by this change.
The Perl internal debugging macros DEBUG() and DEB() have been renamed to PERL_DEBUG() and PERL_DEB() to avoid namespace conflicts.
-DL
removed (the leaktest had been broken and unsupported for years, use alternative debugging mallocs or tools like valgrind and Purify).
Verbose modifier v
added for -DXv
and -Dsv
, see perlrun.
In Perl 5.8.0 there were about 69000 separate tests in about 700 test files, in Perl 5.9.0 there are about 77000 separate tests in about 780 test files. The exact numbers depend on the Perl configuration and on the operating system platform.
The hash randomisation mentioned in "p590-Incompatible Changes" is definitely problematic: it will wake dormant bugs and shake out bad assumptions.
Many of the rarer platforms that worked 100% or pretty close to it with perl 5.8.0 have been left a little bit untended since their maintainers have been otherwise busy lately, and therefore there will be more failures on those platforms. Such platforms include Mac OS Classic, IBM z/OS (and other EBCDIC platforms), and NetWare. The most common Perl platforms (Unix and Unix-like, Microsoft platforms, and VMS) have large enough testing and expert population that they are doing well.
Tied hashes do not currently return anything useful in scalar context, for example when used as boolean tests:
if (%tied_hash) { ... }
The current nonsensical behaviour is always to return false, regardless of whether the hash is empty or has elements.
The root cause is that there is no interface for the implementors of tied hashes to implement the behaviour of a hash in scalar context.
The subtests 9 and 18 of lib/Net/Ping/t/450_service.t, and the subtest 2 of lib/Net/Ping/t/510_ping_udp.t might fail if you have an unusual networking setup. For example in the latter case the test is trying to send a UDP ping to the IP address 127.0.0.1.
The C-generating compiler backend B::C (the frontend being perlcc -c
) is even more broken than it used to be because of the extensive lexical variable changes. (The good news is that B::Bytecode and ByteLoader are better than they used to be.)
IBM z/OS and other EBCDIC platforms continue to be problematic regarding Unicode support. Many Unicode tests are skipped when they really should be fixed.
In Cygwin 1.5 the io/tell and op/sysio tests have failures for some yet unknown reason. In 1.5.5 the threads tests stress_cv, stress_re, and stress_string are failing unless the environment variable PERLIO is set to "perlio" (which makes also the io/tell failure go away).
Perl 5.8.1 does build and work well with Cygwin 1.3: with (uname -a) CYGWIN_NT-5.0 ... 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 ...
a 100% "make test" was achieved with Configure -des -Duseithreads
.
With certain HP C compiler releases (e.g. B.11.11.02) you will get many warnings like this (lines wrapped for easier reading):
cc: "/usr/include/sys/socket.h", line 504: warning 562: Redeclaration of "sendfile" with a different storage class specifier: "sendfile" will have internal linkage. cc: "/usr/include/sys/socket.h", line 505: warning 562: Redeclaration of "sendpath" with a different storage class specifier: "sendpath" will have internal linkage.
The warnings show up both during the build of Perl and during certain lib/ExtUtils tests that invoke the C compiler. The warning, however, is not serious and can be ignored.
The test t/uni/tr_7jis.t is known to report failure under 'make test' or the test harness with certain releases of IRIX (at least IRIX 6.5 and MIPSpro Compilers Version 7.3.1.1m), but if run manually the test fully passes.
The Perl malloc (-Dusemymalloc
) does not work at all in Mac OS X. This is not that serious, though, since the native malloc works just fine.
In the latest Tru64 releases (e.g. v5.1B or later) gcc cannot be used to compile a threaded Perl (-Duseithreads) because the system
file doesn't know about gcc.
As of the 5.8.0 release, sysopen()/sysread()/syswrite() do not behave like they used to in 5.6.1 and earlier with respect to "text" mode. These built-ins now always operate in "binary" mode (even if sysopen() was passed the O_TEXT flag, or if binmode() was used on the file handle). Note that this issue should only make a difference for disk files, as sockets and pipes have always been in "binary" mode in the Windows port. As this behavior is currently considered a bug, compatible behavior may be re-introduced in a future release. Until then, the use of sysopen(), sysread() and syswrite() is not supported for "text" mode operations.
Here are some things that are planned for perl 5.10.0 :
pragma
pragma.use
, require
, and $VERSION
. $^V will also be a "version object" so the printf("%vd",...) construct will no longer be needed. The v-ful version (v1.2.3) will become obsolete. The equivalence of strings and v-strings (e.g. that currently 5.8.0 is equal to "\5\8\0") will go away. There may be no deprecation warning for v-strings, though: it is quite hard to detect when v-strings are being used safely, and when they are not.If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/. There may also be information at http://www.perl.com/, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/.
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl589delta - what is new for perl v5.8.9
This document describes differences between the 5.8.8 release and the 5.8.9 release.
The 5.8.9 release will be the last significant release of the 5.8.x series. Any future releases of 5.8.x will likely only be to deal with security issues, and platform build failures. Hence you should look to migrating to 5.10.x, if you have not started already. See "p589-Known Problems" for more information.
A particular construction in the source code of extensions written in C++ may need changing. See "p589-Changed Internals" for more details. All extensions written in C, most written in C++, and all existing compiled extensions are unaffected. This was necessary to improve C++ support.
Other than this, there are no changes intentionally incompatible with 5.8.8. If any exist, they are bugs and reports are welcome.
The copy of the Unicode Character Database included in Perl 5.8 has been updated to 5.1.0 from 4.1.0. See http://www.unicode.org/versions/Unicode5.1.0/#NotableChanges for the notable changes.
It is now possible to call stat
and the -X
filestat operators on directory handles. As both directory and file handles are barewords, there can be ambiguities over which was intended. In these situations the file handle semantics are preferred. Both also treat *FILE{IO}
filehandles like *FILE
filehandles.
It's possible to enhance the mechanism of subroutine hooks in @INC by adding a source filter on top of the filehandle opened and returned by the hook. This feature was planned a long time ago, but wasn't quite working until now. See "require" in perlfunc for details. (Nicholas Clark)
The constant folding routine is now wrapped in an exception handler, and if folding throws an exception (such as attempting to evaluate 0/0), perl now retains the current optree, rather than aborting the whole program. Without this change, programs would not compile if they had expressions that happened to generate exceptions, even though those expressions were in code that could never be reached at runtime. (Nicholas Clark, Dave Mitchell)
no VERSION
You can now use no
followed by a version number to specify that you want to use a version of perl older than the specified one.
The code that caches calculated UTF-8 byte offsets for character offsets for a string has been re-written. Several bugs have been located and eliminated, and the code now makes better use of the information it has, so should be faster. In particular, it doesn't scan to the end of a string before calculating an offset within the string, which should speed up some operations on long strings. It is now possible to disable the caching code at run time, to verify that it is not the cause of suspected problems.
There is now Configure support for creating a perl tree that is relocatable at run time. see "p589-Relocatable installations".
${^CHILD_ERROR_NATIVE}
This variable gives the native status returned by the last pipe close, backtick command, successful call to wait
or waitpid
, or from the system
operator. See perlvar for details. (Contributed by Gisle Aas.)
${^UTF8CACHE}
This variable controls the state of the internal UTF-8 offset caching code. 1 for on (the default), 0 for off, -1 to debug the caching code by checking all its results against linear scans, and panicking on any discrepancy.
readpipe
is now overridableThe built-in function readpipe
is now overridable. Overriding it permits also to override its operator counterpart, qx//
(also known as ``
).
Perl 5.8.9 (and 5.10.0 onwards) now provides a couple of macros to do very basic exception handling in XS modules. You can use these macros if you call code that may croak
, but you need to do some cleanup before giving control back to Perl. See "Exception Handling" in perlguts for more details.
-Dq
suppresses the EXECUTING... message when running under -D
-Dl
logs runops loop entry and exit, and jump level popping.-Dv
displays the process id as part of the trace output.Some pure-perl code that the regexp engine was using to retrieve Unicode properties and transliteration mappings has been reimplemented in XS for faster execution. (SADAHIRO Tomoyuki)
The interpreter internals now support a far more memory efficient form of inlineable constants. Storing a reference to a constant value in a symbol table is equivalent to a full typeglob referencing a constant subroutine, but using about 400 bytes less memory. This proxy constant subroutine is automatically upgraded to a real typeglob with subroutine if necessary. The approach taken is analogous to the existing space optimisation for subroutine stub declarations, which are stored as plain scalars in place of the full typeglob.
However, to aid backwards compatibility of existing code, which (wrongly) does not expect anything other than typeglobs in symbol tables, nothing in core uses this feature, other than the regression tests.
Stubs for prototyped subroutines have been stored in symbol tables as plain strings, and stubs for unprototyped subroutines as the number -1, since 5.005, so code which assumes that the core only places typeglobs in symbol tables has been making incorrect assumptions for over 10 years.
Compile support added for:
Module::Pluggable
is a simple framework to create modules that accept pluggable sub-modules. The bundled version is 3.8Module::CoreList
is a hash of hashes that is keyed on perl version as indicated in $]
. The bundled version is 2.17Win32API::File
now available in core on Microsoft Windows. The bundled version is 0.1001_01Devel::InnerPackage
finds all the packages defined by a single file. It is part of the Module::Pluggable
distribution. The bundled version is 0.3attributes
upgraded to version 0.09AutoLoader
upgraded to version 5.67AutoSplit
upgraded to 1.06autouse
upgraded to version 1.06B
upgraded from 1.09_01 to 1.19
B::NV::COP_SEQ_RANGE_LOW
, B::NV::COP_SEQ_RANGE_HIGH
, B::NV::PARENT_PAD_INDEX
, B::NV::PARENT_FAKELEX_FLAGS
, which hides the difference in storage in 5.10.0 and later.B::sub_generation
, which exposes PL_sub_generation
B::GV::isGV_with_GP
, which on pre-5.10 perls always returns true.B::HE
added with methods VAL
, HASH
and SVKEY_force
B::GVf_IMPORTED_CV
flag is now set correctly when a proxy constant subroutine is imported.PMOP
s.B::BM::PREVIOUS
returns now U32
, not U16
. B::CV::START
and B:CV::ROOT
return now NULL
on an XSUB, B::CV::XSUB
and B::CV::XSUBANY
return 0 on a non-XSUB.B::C
upgraded to 1.05B::Concise
upgraded to 0.76
-src
causes the rendering of each statement (starting with the nextstate OP) to be preceded by the first line of source code that generates it.-stash="somepackage"
, require
s "somepackage", and then renders each function defined in its namespace.B::Debug
upgraded to version 1.05B::Deparse
upgraded to version 0.87
print readpipe $x, $y
.''-
()>, ::()
, sub :: {}
, etc. correctly [RT #43010]. All bugs in parsing these kinds of syntax are now fixed:
perl -MO=Deparse -e '"my %h = "->()' perl -MO=Deparse -e '::->()' perl -MO=Deparse -e 'sub :: {}' perl -MO=Deparse -e 'package a; sub a::b::c {}' perl -MO=Deparse -e 'sub the::main::road {}'
$^H{v_string}
, which is automatically set by the internals.B::Lint
upgraded to version 1.11B::Terse
upgraded to version 1.05base
upgraded to version 2.13
$SIG{__DIE__}
in that module.@ISA
Benchmark
upgraded to version 1.10bigint
upgraded to 0.23bignum
upgraded to 0.23bigrat
upgraded to 0.23blib
upgraded to 0.04Carp
upgraded to version 1.10
The argument backtrace code now shows undef
as undef
, instead of a string "undef".
CGI
upgraded to version 3.42charnames
upgraded to 1.06constant
upgraded to version 1.17CPAN
upgraded to version 1.9301Cwd
upgraded to version 3.29 with some platform specific improvements (including for VMS).Data::Dumper
upgraded to version 2.121_17
realloc()
are slow, such as Win32.DB_File
upgraded to version 1.817DB_Filter
upgraded to version 0.02Devel::DProf
upgraded to version 20080331.00Devel::Peek
upgraded to version 1.04Devel::PPPort
upgraded to version 3.14diagnostics
upgraded to version 1.16Digest
upgraded to version 1.15Digest::MD5
upgraded to version 2.37DirHandle
upgraded to version 1.02
$.
, $@
, $!
, $^E
, and $?
before closing the directory handle to suppress leaking any side effects of warnings about it already being closed.DynaLoader
upgraded to version 1.09
DynaLoader
can now dynamically load a loadable object from a file with a non-default file extension.
Encode
upgraded to version 2.26
Encode::Alias
includes a fix for encoding "646" on Solaris (better known as ASCII).
English
upgraded to version 1.03Errno
upgraded to version 1.10Exporter
upgraded to version 5.63ExtUtils::Command
upgraded to version 1.15ExtUtils::Constant
upgraded to version 0.21ExtUtils::Embed
upgraded to version 1.28ExtUtils::Install
upgraded to version 1.50_01ExtUtils::Installed
upgraded to version 1.43ExtUtils::MakeMaker
upgraded to version 6.48
INSTALLSITESCRIPT
and INSTALLVENDORSCRIPT
configuration.ExtUtils::Manifest
upgraded to version 1.55ExtUtils::ParseXS
upgraded to version 2.19Fatal
upgraded to version 1.06
CORE::GLOBAL
to be made fatal.Fcntl
upgraded to version 1.06fields
upgraded to version 2.12File::Basename
upgraded to version 2.77FileCache
upgraded to version 1.07File::Compare
upgraded to 1.1005File::Copy
upgraded to 2.13
File::DosGlob
upgraded to 1.01File::Find
upgraded to version 1.13File::Glob
upgraded to version 1.06
File::Path
upgraded to version 2.07_02File::Spec
upgraded to version 3.29
abs2rel
when handling both relative arguments.File::stat
upgraded to version 1.01File::Temp
upgraded to version 0.20filetest
upgraded to version 1.02Filter::Util::Call
upgraded to version 1.07Filter::Simple
upgraded to version 0.83FindBin
upgraded to version 1.49GDBM_File
upgraded to version 1.09Getopt::Long
upgraded to version 2.37Getopt::Std
upgraded to version 1.06Hash::Util
upgraded to version 0.06if
upgraded to version 0.05IO
upgraded to version 1.23
Reduced number of calls to getpeername
in IO::Socket
IPC::Open
upgraded to version 1.03IPC::Open3
upgraded to version 1.03IPC::SysV
upgraded to version 2.00lib
upgraded to version 0.61
libnet
upgraded to version 1.22List::Util
upgraded to 1.19Locale::Maketext
upgraded to 1.13Math::BigFloat
upgraded to version 1.60Math::BigInt
upgraded to version 1.89Math::BigRat
upgraded to version 0.22
as_float
method.Math::Complex
upgraded to version 1.54.Math::Trig
upgraded to version 1.18.NDBM_File
upgraded to version 1.07
Net::Ping
upgraded to version 2.35NEXT
upgraded to version 0.61
NEXT
when working with AUTOLOAD
, eval
block, and within overloaded stringification.ODBM_File
upgraded to 1.07open
upgraded to 1.06ops
upgraded to 1.02PerlIO::encoding
upgraded to version 0.11PerlIO::scalar
upgraded to version 0.06
PerlIO::scalar
doesn't respect readonly-ness.PerlIO::via
upgraded to version 0.05Pod::Html
upgraded to version 1.09Pod::Parser
upgraded to version 1.35Pod::Usage
upgraded to version 1.35POSIX
upgraded to version 1.15
POSIX
constants that duplicate those in Fcntl
are now imported from Fcntl
and re-exported, rather than being duplicated by POSIX
POSIX::remove
can remove empty directories.POSIX::setlocale
safer to call multiple times.POSIX::SigRt
added, which provides access to POSIX realtime signal functionality on systems that support it.re
upgraded to version 0.06_01Safe
upgraded to version 2.16Scalar::Util
upgraded to 1.19SDBM_File
upgraded to version 1.06SelfLoader
upgraded to version 1.17Shell
upgraded to version 0.72sigtrap
upgraded to version 1.04Socket
upgraded to version 1.81
gethostbyname
Storable
upgraded to 2.19Switch
upgraded to version 2.13Sys::Syslog
upgraded to version 0.27Term::ANSIColor
upgraded to version 1.12Term::Cap
upgraded to version 1.12Term::ReadLine
upgraded to version 1.03Test::Builder
upgraded to version 0.80Test::Harness
upgraded version to 2.64
Test::More
upgraded to version 0.80Test::Simple
upgraded to version 0.80Text::Balanced
upgraded to version 1.98Text::ParseWords
upgraded to version 3.27Text::Soundex
upgraded to version 3.03Text::Tabs
upgraded to version 2007.1117Text::Wrap
upgraded to version 2006.1117Thread
upgraded to version 2.01Thread::Semaphore
upgraded to version 2.09Thread::Queue
upgraded to version 2.11
peek
, insert
and extract
Tie::Handle
upgraded to version 4.2Tie::Hash
upgraded to version 1.03Tie::Memoize
upgraded to version 1.1
Tie::Memoize::EXISTS
now correctly caches its results.Tie::RefHash
upgraded to version 1.38Tie::Scalar
upgraded to version 1.01Tie::StdHandle
upgraded to version 4.2Time::gmtime
upgraded to version 1.03Time::Local
upgraded to version 1.1901Time::HiRes
upgraded to version 1.9715 with various build improvements (including VMS) and minor platform-specific bug fixes (including for HP-UX 11 ia64).threads
upgraded to 1.71
is_running
, is_detached
and is_joinable
. list
method enhanced to return running or joinable threads.kill
exit
method.threads::shared
upgraded to version 1.27
shared_clone
creates a copy of an object leaving shared elements as-is and deep-cloning non-shared elements.is_shared
method.Unicode::Normalize
upgraded to version 1.02Unicode::UCD
upgraded to version 0.25warnings
upgraded to version 1.05_01Win32
upgraded to version 0.38
GetCurrentProcessId
which returns the regular Windows process identifier of the current process, even when called from within a fork.XSLoader
upgraded to version 0.10XS::APItest
and XS::Typemap
are for internal use only and hence no longer installed. Many more tests have been added to XS::APItest
.NEXT::AUTOLOAD
no longer emits warnings under the debugger.fork
s.Perl 5.8.9 adds a new utility perlthanks, which is a variant of perlbug, but for sending non-bug-reports to the authors and maintainers of Perl. Getting nothing but bug reports can become a bit demoralising - we'll see if this changes things.
perlbug now checks if you're reporting about a non-core module and suggests you report it to the CPAN author instead.
h2xs -X
""
and <>
quoting in #include
statements.#if defined A || defined B
[RT #39130]As usual, the documentation received its share of corrections, clarifications and other nitfixes. More tags were added for indexing.
perlunitut is a tutorial written by Juerd Waalboer on Unicode-related terminology and how to correctly handle Unicode in Perl scripts.
perlunicode is updated in section user defined properties.
perluniintro has been updated in the example of detecting data that is not valid in particular encoding.
perlcommunity provides an overview of the Perl Community along with further resources.
CORE documents the pseudo-namespace for Perl's core routines.
perlglossary adds deprecated modules and features and to be dropped modules.
perlhack has been updated and added resources on smoke testing.
The Perl FAQs (perlfaq1..perlfaq9) have been updated.
perlcheat is updated with better details on \w
, \d
, and \s
.
perldebug is updated with information on how to call the debugger.
perldiag documentation updated with subroutine with an ampersand on the argument to exists
and delete
and also several terminology updates on warnings.
perlfork documents the limitation of exec
inside pseudo-processes.
caller
and pop
.alarm
now mentions Time::HiRes::ualarm
in preference to select
.-X
, filetest operators are the same as unary operators, but not regarding parsing and parentheses (spotted by Eirik Berg Hanssen).perllocale documentation is adjusted for number localization and POSIX::setlocale
to fix Debian bug #379463.
perlmodlib is updated with CPAN::API::HOWTO
and Sys::Syslog::win32::Win32
perlre documentation updated to reflect the differences between [[:xxxxx:]]
and \p{IsXxxxx}
matches. Also added section on /g
and /c
modifiers.
perlreguts describe the internals of the regular expressions engine. It has been contributed by Yves Orton.
perlrebackslash describes all perl regular expression backslash and escape sequences.
perlrecharclass describes the syntax and use of character classes in Perl Regular Expressions.
perlrun is updated to clarify on the hash seed PERL_HASH_SEED. Also more information in options -x
and -u
.
perlsub example is updated to use a lexical variable for opendir
syntax.
perlvar fixes confusion about real GID $(
and effective GID $)
.
Perl thread tutorial example is fixed in section "Queues: Passing Data Around" in perlthrtut and perlothrtut.
perlhack documentation extensively improved by Jarkko Hietaniemi and others.
perltoot provides information on modifying @UNIVERSAL::ISA
.
perlport documentation extended to include different kill(-9, ...)
semantics on Windows. It also clearly states dump
is not supported on Win32 and cygwin.
INSTALL has been updated and modernised.
-DPERL_DONT_CREATE_GVSV
to avoid creating these empty scalars. This will significantly decrease the number of scalars allocated for all configurations, and the number of scalars that need to be copied for ithread creation. Whilst this option is binary compatible with existing perl installations, it does change a long-standing assumption about the internals, hence it is not enabled by default, as some third party code may rely on the old behaviour.
We would recommend testing with this configuration on new deployments of perl, particularly for multi-threaded servers, to see whether all third party code is compatible with it, as this configuration may give useful performance improvements. For existing installations we would not recommend changing to this configuration unless thorough testing is performed before deployment.
diagnostics
no longer uses $&
, which results in large speedups for regexp matching in all code using it.[]
and {}
) now incurs no more overhead than creating an anonymous list or hash. Nicholas Clark provided changes with a saving of two ops and one stack push, which was measured as a slightly better than 5% improvement for these operations.strlen()
have been eliminated, either because the length was already known, or by adopting or enhancing APIs that pass lengths. This has been aided by the adoption of a my_sprintf()
wrapper, which returns the correct C89 value - the length of the formatted string. Previously we could not rely on the return value of sprintf()
, because on some ancient but extant platforms it still returns char *
.index
is now faster if the search string is stored in UTF-8 but only contains characters in the Latin-1 range.There is now Configure support for creating a relocatable perl tree. If you Configure with -Duserelocatableinc
, then the paths in @INC
(and everything else in %Config
) can be optionally located via the path of the perl executable.
At start time, if any paths in @INC
or Config
that Configure marked as relocatable (by starting them with ".../"
), then they are prefixed the directory of $^X
. This allows the relocation can be configured on a per-directory basis, although the default with -Duserelocatableinc
is that everything is relocated. The initial install is done to the original configured prefix.
Configure is now better at removing temporary files. Tom Callaway (from RedHat) also contributed patches that complete the set of flags passed to the compiler and the linker, in particular that -fPIC
is now enabled on Linux. It will also croak when your /dev/null isn't a device.
A new configuration variable d_pseudofork
has been to Configure, and is available as $Config{d_pseudofork}
in the Config
module. This distinguishes real fork
support from the pseudofork emulation used on Windows platforms.
Config.pod and config.sh are now placed correctly for cross-compilation.
$Config{useshrplib}
is now 'true' rather than 'yes' when using a shared perl library.
Parallel makes should work properly now, although there may still be problems if make test
is instructed to run in parallel.
Many compilation warnings have been cleaned up. A very stubborn compiler warning in S_emulate_eaccess()
was killed after six attempts. g++ support has been tuned, especially for FreeBSD.
mkppport has been integrated, and all ppport.h files in the core will now be autogenerated at build time (and removed during cleanup).
installman now works with -Duserelocatableinc
and DESTDIR
.
installperl no longer installs:
There are improved hints for AIX, Cygwin, DEC/OSF, FreeBSD, HP/UX, Irix 6 Linux, MachTen, NetBSD, OS/390, QNX, SCO, Solaris, SunOS, System V Release 5.x (UnixWare 7, OpenUNIX 8), Ultrix, UMIPS, uts and VOS.
-std=c89
and -ansi
if using long long
as the main integral type, else in FreeBSD 6.2 (and perhaps other releases), system headers do not declare some functions required by perl.ignore_versioned_solibs=y
.config.h
ccflags
when building munchconfig.exe
.Thread
extension on VMS when -Duseithreads
has been chosen.setlocale
tests have been re-enabled for Windows XP onwards.Many many bugs related to the internal Unicode implementation (UTF-8) have been fixed. In particular, long standing bugs related to returning Unicode via tie
, overloading or $@
are now gone, some of which were never reported.
unpack
will internally convert the string back from UTF-8 on numeric types. This is a compromise between the full consistency now in 5.10, and the current behaviour, which is often used as a "feature" on string types.
Using :crlf
and UTF-16
IO layers together will now work.
Fixed problems with split
, Unicode /\s+/
and / \0/
.
Fixed bug RT #40641 - encoding of Unicode characters in regular expressions.
Fixed a bug where using certain patterns in a regexp led to a panic. [RT #45337]
Perl no longer segfaults (due to infinite internal recursion) if the locale's character is not UTF-8 [RT #41442]:
use open ':locale'; print STDERR "\x{201e}"; # „
Inconsistencies have been fixed in the reference counting PerlIO uses to keep track of Unix file descriptors, and the API used by XS code to manage getting and releasing FILE *
s
Several bugs have been fixed in Magic, the internal system used to implement features such as tie
, tainting and threads sharing.
undef @array
on a tied array now correctly calls the CLEAR
method.
Some of the bitwise ops were not checking whether their arguments were magical before using them. [RT #24816]
Magic is no longer invoked twice by the expression \&$x
A bug with assigning large numbers and tainting has been resolved. [RT #40708]
A new entry has been added to the MAGIC vtable - svt_local
. This is used when copying magic to the new value during local
, allowing certain problems with localising shared variables to be resolved.
For the implementation details, see "Magic Virtual Tables" in perlguts.
Internally, perl object-ness is on the referent, not the reference, even though methods can only be called via a reference. However, the original implementation of overloading stored flags related to overloading on the reference, relying on the flags being copied when the reference was copied, or set at the creation of a new reference. This manifests in a bug - if you rebless an object from a class that has overloading, into one that does not, then any other existing references think that they (still) point to an overloaded object, choose these C code paths, and then throw errors. Analogously, blessing into an overloaded class when other references exist will result in them not using overloading.
The implementation has been fixed for 5.10, but this fix changes the semantics of flag bits, so is not binary compatible, so can't be applied to 5.8.9. However, 5.8.9 has a work-around that implements the same bug fix. If the referent has multiple references, then all the other references are located and corrected. A full search is avoided whenever possible by scanning lexicals outwards from the current subroutine, and the argument stack.
A certain well known Linux vendor applied incomplete versions of this bug fix to their /usr/bin/perl and then prematurely closed bug reports about performance issues without consulting back upstream. This not being enough, they then proceeded to ignore the necessary fixes to these unreleased changes for 11 months, until massive pressure was applied by their long-suffering paying customers, catalysed by the failings being featured on a prominent blog and Slashdot.
strict
now propagates correctly into string evalsUnder 5.8.8 and earlier:
$ perl5.8.8 -e 'use strict; eval "use foo bar" or die $@' Can't locate foo.pm in @INC (@INC contains: ... .) at (eval 1) line 2. BEGIN failed--compilation aborted at (eval 1) line 2.
Under 5.8.9 and later:
$ perl5.8.9 -e 'use strict; eval "use foo bar" or die $@' Bareword "bar" not allowed while "strict subs" in use at (eval 1) line 1.
This may cause problems with programs that parse the error message and rely on the buggy behaviour.
=cute
(and other words beginning with =cut
) as a synonym for =cut
.CORE::require
CORE::require
and CORE::do
were always parsed as require
and do
when they were overridden. This is now fixed.
while (my $x ...) { ...; redo }
shouldn't undef $x
.
In the presence of my
in the conditional of a while()
, until()
, or for(;;)
loop, we now add an extra scope to the body so that redo
doesn't undef
the lexical.
encoding
pragma now correctly ignores anything following an @
character in the LC_ALL
and LANG
environment variables. [RT # 49646]unpack
used in scalar context with ()
groups is resolved. [RT #50256]$!
could be changed by a signal handler interrupting a system
call.defined
even under the influence of use strict 'refs'
.lc
/uc
inside sort
affected the return value.*{"BONK"} = \&{"BONK"}
didn't work correctly.goto &xsub
corrupts perl internals.${10}
(note the bracket) instead of just $10
.Perl_newCONSTSUB()
is now thread safe.PerlIOStdio_close()
to avoid race conditions. Hopefully this fixes failures in the threads tests free.t and blocks.t.USE_MULTI
and USE_ITHREADS
but without USE_IMP_SYS
has been fixed.OS2::REXX
upgraded to version 1.04$Config{gccversion}
.-DPTR_IS_LONG
when using 64 bit integersPerlIO::Scalar
in-memory file record-style reads.Test::Harness
2.64 have been fixed.fcntl()
locking capability test in configure.com.shrplib='define'
with useshrplib='true'
on VMS.File::Find
used to fail when the target directory is a bare drive letter and no_chdir
is 1 (the default is 0). [RT #41555]USE_MULTI
and USE_ITHREADS
but without USE_IMP_SYS
has been fixed.binmode
on Win32 and Cygwin may cause a segmentation fault.eq
when using nomethod
.overload
with 64 bit integers corrected.PerlIO
file descriptors is now correctly handled.keys %+
no longer throws an 'ambiguous'
warning.#!perl -d
could trigger an assertion, which has been fixed.@INC
when calling require
.@INC
report the correct file name when __FILE__
is used.-foo=bar
with the -s
on the <#!> line. This has been fixed. See http://bugs.activestate.com/show_bug.cgi?id=43483tr///
is now threadsafe. Previously it was storing a swash inside its OP, rather than in a pad.threads
cleanup veto has been extended to include perl_free()
and perl_destruct()
$ENV{TZ}
would not always be respected by the underlying calls to localtime_r()
. Perl now forces the inspection of the environment on these systems.$^R
is now more consistently set when executing regexps using the (?{...})
construct. In particular, it will still be set even if backreferences or optional sub-patterns (?:...)?
are used.This new fatal error occurs when the C routine Perl_sv_chop()
was passed a position that is not within the scalar's string buffer. This is caused by buggy XS code, and at this point recovery is not possible.
This new fatal error occurs when the perl process has to abort due to too many pending signals, which is bound to prevent perl from being able to handle further incoming signals safely.
This new fatal error occurs when the ACL version file test operator is used where it is not available on the current platform. Earlier checks mean that it should never be possible to get this.
New error indicating that a tied array has claimed to have a negative number of elements.
Previously the internal error from the SV upgrade code was the less informative Can't upgrade that kind of scalar. It now reports the current internal type, and the new type requested.
This error, thrown if an invalid argument is provided to exists
now correctly includes "or a subroutine". [RT #38955]
This error in Fatal
previously did not show the name of the builtin in question (now represented by %s above).
This error previously did not state the column.
This can now also be generated by a seek
on a file handle using PerlIO::scalar
.
New error, introduced as part of the fix to RT #40641 to handle encoding of Unicode characters in regular expression comments.
A more informative fatal error issued when calling dump
on Win32 and Cygwin. (Given that the purpose of dump
is to abort with a core dump, and core dumps can't be produced on these platforms, this is more useful than silently exiting.)
The perl sources can now be compiled with a C++ compiler instead of a C compiler. A necessary implementation details is that under C++, the macro XS
used to define XSUBs now includes an extern "C"
definition. A side effect of this is that C++ code that used the construction
typedef XS(SwigPerlWrapper);
now needs to be written
typedef XSPROTO(SwigPerlWrapper);
using the new XSPROTO
macro, in order to compile. C extensions are unaffected, although C extensions are encouraged to use XSPROTO
too. This change was present in the 5.10.0 release of perl, so any actively maintained code that happened to use this construction should already have been adapted. Code that needs changing will fail with a compilation error.
set
magic on localizing/assigning to a magic variable will now only trigger for container magics, i.e. it will for %ENV
or %SIG
but not for $#array
.
The new API macro newSVpvs()
can be used in place of constructions such as newSVpvn("ISA", 3)
. It takes a single string constant, and at C compile time determines its length.
The new API function Perl_newSV_type()
can be used as a more efficient replacement of the common idiom
sv = newSV(0); sv_upgrade(sv, type);
Similarly Perl_newSVpvn_flags()
can be used to combine Perl_newSVpv()
with Perl_sv_2mortal()
or the equivalent Perl_sv_newmortal()
with Perl_sv_setpvn()
Two new macros mPUSHs()
and mXPUSHs()
are added, to make it easier to push mortal SVs onto the stack. They were then used to fix several bugs where values on the stack had not been mortalised.
A Perl_signbit()
function was added to test the sign of an NV
. It maps to the system one when available.
Perl_av_reify()
, Perl_lex_end()
, Perl_mod()
, Perl_op_clear()
, Perl_pop_return()
, Perl_qerror()
, Perl_setdefout()
, Perl_vivify_defelem()
and Perl_yylex()
are now visible to extensions. This was required to allow Data::Alias
to work on Windows.
Perl_find_runcv()
is now visible to perl core extensions. This was required to allow Sub::Current
to work on Windows.
ptr_table*
functions are now available in unthreaded perl. Storable
takes advantage of this.
There have been many small cleanups made to the internals. In particular, Perl_sv_upgrade()
has been simplified considerably, with a straight-through code path that uses memset()
and memcpy()
to initialise the new body, rather than assignment via multiple temporary variables. It has also benefited from simplification and de-duplication of the arena management code.
A lot of small improvements in the code base were made due to reports from the Coverity static code analyzer.
Corrected use and documentation of Perl_gv_stashpv()
, Perl_gv_stashpvn()
, Perl_gv_stashsv()
functions (last parameter is a bitmask, not boolean).
PERL_SYS_INIT
, PERL_SYS_INIT3
and PERL_SYS_TERM
macros have been changed into functions.
PERLSYS_TERM
no longer requires a context. PerlIO_teardown()
is now called without a context, and debugging output in this function has been disabled because that required that an interpreter was present, an invalid assumption at termination time.
All compile time options which affect binary compatibility have been grouped together into a global variable (PL_bincompat_options
).
The values of PERL_REVISION
, PERL_VERSION
and PERL_SUBVERSION
are now baked into global variables (and hence into any shared perl library). Additionally under MULTIPLICITY
, the perl executable now records the size of the interpreter structure (total, and for this version). Coupled with PL_bincompat_options
this will allow 5.8.10 (and later), when compiled with a shared perl library, to perform sanity checks in main()
to verify that the shared library is indeed binary compatible.
Symbolic references can now have embedded NULs. The new public function Perl_get_cvn_flags()
can be used in extensions if you have to handle them.
The core code, and XS code in ext that is not dual-lived on CPAN, no longer uses the macros PL_na
, NEWSV()
, Null()
, Nullav
, Nullcv
, Nullhv
, Nullhv
etc. Their use is discouraged in new code, particularly PL_na
, which is a small performance hit.
Many modules updated from CPAN incorporate new tests. Some core specific tests have been added:
Tests for the DynaLoader
module.
Tests for compile-time constant folding.
Tests incorporated from 5.10.0 which check that there is no unexpected interaction between the internal types PVBM
and PVGV
.
Tests for the new form of constant subroutines.
Tests for Attribute::Handlers
.
Tests for dbmopen
.
Calls all tests in t/op/inccode.t after first tying @INC
.
Tests for source filters returned from code references in @INC
.
Tests for RT #30970.
Tests for RT #41484.
Tests for the qr//
construct.
Tests for the qr//
construct within another regexp.
Tests for the qr//
construct.
Tests for RT #32840.
Tests for study
on tied scalars.
Tests for subst
run under -T
mode.
Tests for undef
and delete
on stash entries that are bound to subroutines or methods.
Tests for Perl_sv_upgrade()
.
MRO tests for isa
and package aliases.
Tests for calling Pod::Parser
twice.
Tests for inheriting file descriptors across exec
(close-on-exec).
Tests for the UTF-8 caching code.
Test that strange encodings do not upset Perl_pp_chr()
.
Tests for RT #40641.
Tests for RT #40641.
Tests for returning Unicode from overloaded values.
Tests for returning Unicode from tied variables.
There are no known new bugs.
However, programs that rely on bugs that have been fixed will have problems. Also, many bug fixes present in 5.10.0 can't be back-ported to the 5.8.x branch, because they require changes that are binary incompatible, or because the code changes are too large and hence too risky to incorporate.
We have only limited volunteer labour, and the maintenance burden is getting increasingly complex. Hence this will be the last significant release of the 5.8.x series. Any future releases of 5.8.x will likely only be to deal with security issues, and platform build failures. Hence you should look to migrating to 5.10.x, if you have not started already. Alternatively, if business requirements constrain you to continue to use 5.8.x, you may wish to consider commercial support from firms such as ActiveState.
readdir()
, cwd()
, $^X
and @INC
now use the alternate (short) filename if the long name is outside the current codepage (Jan Dubois).
Win32
upgraded to version 0.38. Now has a documented 'WinVista' response from GetOSName
and support for Vista's privilege elevation in IsAdminUser
. Support for Unicode characters in path names. Improved cygwin and Win64 compatibility.Win32API
updated to 0.1001_01killpg()
support added to MSWin32
(Jan Dubois).File::Spec::Win32
upgraded to version 3.2701OS2::Process
upgraded to 1.03
Ilya Zakharevich has added and documented several Window*
and Clipbrd*
functions.
OS2::REXX::DLL
, OS2::REXX
updated to version 1.03DCLsym
upgraded to version 1.03Stdio
upgraded to version 2.4VMS::XSSymSet
upgraded to 1.1.Nick Ing-Simmons, long time Perl hacker, author of the Tk
and Encode
modules, perlio.c in the core, and 5.003_02 pumpking, died of a heart attack on 25th September 2006. He will be missed.
Some of the work in this release was funded by a TPF grant.
Steve Hay worked behind the scenes working out the causes of the differences between core modules, their CPAN releases, and previous core releases, and the best way to rectify them. He doesn't want to do it again. I know this feeling, and I'm very glad he did it this time, instead of me.
Paul Fenwick assembled a team of 18 volunteers, who broke the back of writing this document. In particular, Bradley Dean, Eddy Tan, and Vincent Pit provided half the team's contribution.
Schwern verified the list of updated module versions, correcting quite a few errors that I (and everyone else) had missed, both wrongly stated module versions, and changed modules that had not been listed.
The crack Berlin-based QA team of Andreas König and Slaven Rezic tirelessly re-built snapshots, tested most everything CPAN against them, and then identified the changes responsible for any module regressions, ensuring that several show-stopper bugs were stomped before the first release candidate was cut.
The other core committers contributed most of the changes, and applied most of the patches sent in by the hundreds of contributors listed in AUTHORS.
And obviously, Larry Wall, without whom we wouldn't have Perl.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org. There may also be information at http://www.perl.org, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
perl588delta - what is new for perl v5.8.8
This document describes differences between the 5.8.7 release and the 5.8.8 release.
There are no changes intentionally incompatible with 5.8.7. If any exist, they are bugs and reports are welcome.
chdir
, chmod
and chown
can now work on filehandles as well as filenames, if the system supports respectively fchdir
, fchmod
and fchown
, thanks to a patch provided by Gisle Aas.Attribute::Handlers
upgraded to version 0.78_02
attrs
upgraded to version 1.02
autouse
upgraded to version 1.05
B
upgraded to version 1.09_01
B::
modules has been corrected; B::NV
now inherits from B::SV
(instead of B::IV
).blib
upgraded to version 1.03
ByteLoader
upgraded to version 0.06
CGI
upgraded to version 3.15
self_url()
removedscrolling_list()
select attribute fixedvirtual_port
now works properly with the https protocolupload_hook()
and append()
now works in function-oriented modePOST_MAX
doesn't cause the client to hang any more-tabindex
pragma has been added to turn automatic indexes back onend_form()
doesn't emit empty (and non-validating)
CGI::Carp
works better in certain mod_perl configurations
- Setting
$CGI::TMPDIRECTORY
is now effective
- Enhanced documentation
charnames
upgraded to version 1.05
viacode()
now accept hex strings and has been optimized.
CPAN
upgraded to version 1.76_02
- 1 minor bug fix for Win32
Cwd
upgraded to version 3.12
canonpath()
on Win32 now collapses foo\.. sections correctly.
- Improved behaviour on Symbian OS.
- Enhanced documentation and typo fixes
- Internal cleanup
Data::Dumper
upgraded to version 2.121_08
- A problem where
Data::Dumper
would sometimes update the iterator state of hashes has been fixed
- Numeric labels now work
- Internal cleanup
DB
upgraded to version 1.01
- A problem where the state of the regexp engine would sometimes get clobbered when running under the debugger has been fixed.
DB_File
upgraded to version 1.814
- Adds support for Berkeley DB 4.4.
Devel::DProf
upgraded to version 20050603.00
- Internal cleanup
Devel::Peek
upgraded to version 1.03
- Internal cleanup
Devel::PPPort
upgraded to version 3.06_01
--compat-version
argument checking has been improved
- Files passed on the command line are filtered by default
--nofilter
option to override the filtering has been added
- Enhanced documentation
diagnostics
upgraded to version 1.15
- Documentation typo fix
Digest
upgraded to version 1.14
- The constructor now knows which module implements SHA-224
- Documentation tweaks and typo fixes
Digest::MD5
upgraded to version 2.36
XSLoader
is now used for faster loading
- Enhanced documentation including MD5 weaknesses discovered lately
Dumpvalue
upgraded to version 1.12
- Documentation fix
DynaLoader
upgraded but unfortunately we're not able to increment its version number :-(
- Implements
dl_unload_file
on Win32
- Internal cleanup
XSLoader
0.06 incorporated; small optimisation for calling bootstrap_inherit()
and documentation enhancements.
Encode
upgraded to version 2.12
- A coderef is now acceptable for
CHECK
!
- 3 new characters added to the ISO-8859-7 encoding
- New encoding
MIME-Header-ISO_2022_JP
added
- Problem with partial characters and
encoding(utf-8-strict)
fixed.
- Documentation enhancements and typo fixes
English
upgraded to version 1.02
- the
$COMPILING
variable has been added
ExtUtils::Constant
upgraded to version 0.17
- Improved compatibility with older versions of perl
ExtUtils::MakeMaker
upgraded to version 6.30 (was 6.17)
- Too much to list here; see http://search.cpan.org/dist/ExtUtils-MakeMaker/Changes
File::Basename
upgraded to version 2.74, with changes contributed by Michael Schwern.
- Documentation clarified and errors corrected.
basename
now strips trailing path separators before processing the name.
basename
now returns /
for parameter /
, to make basename
consistent with the shell utility of the same name.
- The suffix is no longer stripped if it is identical to the remaining characters in the name, again for consistency with the shell utility.
- Some internal code cleanup.
File::Copy
upgraded to version 2.09
- Copying a file onto itself used to fail.
- Moving a file between file systems now preserves the access and modification time stamps
File::Find
upgraded to version 1.10
- Win32 portability fixes
- Enhanced documentation
File::Glob
upgraded to version 1.05
- Internal cleanup
File::Path
upgraded to version 1.08
mkpath
now preserves errno
when mkdir
fails
File::Spec
upgraded to version 3.12
File::Spec-
rootdir()> now returns \
on Win32, instead of /
$^O
could sometimes become tainted. This has been fixed.
canonpath
on Win32 now collapses foo/..
(or foo\..
) sections correctly, rather than doing the "misguided" work it was previously doing. Note that canonpath
on Unix still does not collapse these sections, as doing so would be incorrect.
- Some documentation improvements
- Some internal code cleanup
FileCache
upgraded to version 1.06
- POD formatting errors in the documentation fixed
Filter::Simple
upgraded to version 0.82
FindBin
upgraded to version 1.47
- Now works better with directories where access rights are more restrictive than usual.
GDBM_File
upgraded to version 1.08
- Internal cleanup
Getopt::Long
upgraded to version 2.35
prefix_pattern
has now been complemented by a new configuration option long_prefix_pattern
that allows the user to specify what prefix patterns should have long option style semantics applied.
- Options can now take multiple values at once (experimental)
- Various bug fixes
if
upgraded to version 0.05
- Give more meaningful error messages from
if
when invoked with a condition in list context.
- Restore backwards compatibility with earlier versions of perl
IO
upgraded to version 1.22
- Enhanced documentation
- Internal cleanup
IPC::Open2
upgraded to version 1.02
- Enhanced documentation
IPC::Open3
upgraded to version 1.02
- Enhanced documentation
List::Util
upgraded to version 1.18 (was 1.14)
- Fix pure-perl version of
refaddr
to avoid blessing an un-blessed reference
- Use
XSLoader
for faster loading
- Fixed various memory leaks
- Internal cleanup and portability fixes
Math::Complex
upgraded to version 1.35
atan2(0, i)
now works, as do all the (computable) complex argument cases
- Fixes for certain bugs in
make
and emake
- Support returning the kth root directly
- Support
[2,-3pi/8]
in emake
- Support
inf
for make
/emake
- Document
make
/emake
more visibly
Math::Trig
upgraded to version 1.03
- Add more great circle routines:
great_circle_waypoint
and great_circle_destination
MIME::Base64
upgraded to version 3.07
- Use
XSLoader
for faster loading
- Enhanced documentation
- Internal cleanup
NDBM_File
upgraded to version 1.06
- Enhanced documentation
ODBM_File
upgraded to version 1.06
- Documentation typo fixed
- Internal cleanup
Opcode
upgraded to version 1.06
- Enhanced documentation
- Internal cleanup
open
upgraded to version 1.05
- Enhanced documentation
overload
upgraded to version 1.04
- Enhanced documentation
PerlIO
upgraded to version 1.04
PerlIO::via
iterate over layers properly now
PerlIO::scalar
understands $/ = ""
now
encoding(utf-8-strict)
with partial characters now works
- Enhanced documentation
- Internal cleanup
Pod::Functions
upgraded to version 1.03
- Documentation typos fixed
Pod::Html
upgraded to version 1.0504
- HTML output will now correctly link to
=item
s on the same page, and should be valid XHTML.
- Variable names are recognized as intended
- Documentation typos fixed
Pod::Parser
upgraded to version 1.32
- Allow files that start with
=head
on the first line
- Win32 portability fix
- Exit status of
pod2usage
fixed
- New
-noperldoc
switch for pod2usage
- Arbitrary URL schemes now allowed
- Documentation typos fixed
POSIX
upgraded to version 1.09
- Documentation typos fixed
- Internal cleanup
re
upgraded to version 0.05
- Documentation typo fixed
Safe
upgraded to version 2.12
- Minor documentation enhancement
SDBM_File
upgraded to version 1.05
- Documentation typo fixed
- Internal cleanup
Socket
upgraded to version 1.78
- Internal cleanup
Storable
upgraded to version 2.15
- This includes the
STORABLE_attach
hook functionality added by Adam Kennedy, and more frugal memory requirements when storing under ithreads
, by using the ithreads
cloning tracking code.
Switch
upgraded to version 2.10_01
- Documentation typos fixed
Sys::Syslog
upgraded to version 0.13
- Now provides numeric macros and meaningful
Exporter
tags.
- No longer uses
Sys::Hostname
as it may provide useless values in unconfigured network environments, so instead uses INADDR_LOOPBACK
directly.
syslog()
now uses local timestamp.
setlogmask()
now behaves like its C counterpart.
setlogsock()
will now croak()
as documented.
- Improved error and warnings messages.
- Improved documentation.
Term::ANSIColor
upgraded to version 1.10
- Fixes a bug in
colored
when $EACHLINE
is set that caused it to not color lines consisting solely of 0 (literal zero).
- Improved tests.
Term::ReadLine
upgraded to version 1.02
- Documentation tweaks
Test::Harness
upgraded to version 2.56 (was 2.48)
- The
Test::Harness
timer is now off by default.
- Now shows elapsed time in milliseconds.
- Various bug fixes
Test::Simple
upgraded to version 0.62 (was 0.54)
is_deeply()
no longer fails to work for many cases
- Various minor bug fixes
- Documentation enhancements
Text::Tabs
upgraded to version 2005.0824
- Provides a faster implementation of
expand
Text::Wrap
upgraded to version 2005.082401
- Adds
$Text::Wrap::separator2
, which allows you to preserve existing newlines but add line-breaks with some other string.
threads
upgraded to version 1.07
threads
will now honour no warnings 'threads'
- A thread's interpreter is now freed after
$t->join()
rather than after undef $t
, which should fix some ithreads
memory leaks. (Fixed by Dave Mitchell)
- Some documentation typo fixes.
threads::shared
upgraded to version 0.94
- Documentation changes only
- Note: An improved implementation of
threads::shared
is available on CPAN - this will be merged into 5.8.9 if it proves stable.
Tie::Hash
upgraded to version 1.02
- Documentation typo fixed
Time::HiRes
upgraded to version 1.86 (was 1.66)
clock_nanosleep()
and clock()
functions added
- Support for the POSIX
clock_gettime()
and clock_getres()
has been added
- Return
undef
or an empty list if the C gettimeofday()
function fails
- Improved
nanosleep
detection
- Internal cleanup
- Enhanced documentation
Unicode::Collate
upgraded to version 0.52
- Now implements UCA Revision 14 (based on Unicode 4.1.0).
Unicode::Collate-
new> method no longer overwrites user's $_
- Enhanced documentation
Unicode::UCD
upgraded to version 0.24
- Documentation typos fixed
User::grent
upgraded to version 1.01
- Documentation typo fixed
utf8
upgraded to version 1.06
- Documentation typos fixed
vmsish
upgraded to version 1.02
- Documentation typos fixed
warnings
upgraded to version 1.05
- Gentler messing with
Carp::
internals
- Internal cleanup
- Documentation update
Win32
upgraded to version 0.2601
- Provides Windows Vista support to
Win32::GetOSName
- Documentation enhancements
XS::Typemap
upgraded to version 0.02
- Internal cleanup
p588-Utility Changes
p588-h2xs
enhancements
h2xs
implements new option --use-xsloader
to force use of XSLoader
even in backwards compatible modules.
The handling of authors' names that had apostrophes has been fixed.
Any enums with negative values are now skipped.
p588-perlivp
enhancements
perlivp
implements new option -a
and will not check for *.ph files by default any more. Use the -a
option to run all tests.
p588-New Documentation
The perlglossary manpage is a glossary of terms used in the Perl documentation, technical and otherwise, kindly provided by O'Reilly Media, inc.
p588-Performance Enhancements
- Weak reference creation is now O(1) rather than O(n), courtesy of Nicholas Clark. Weak reference deletion remains O(n), but if deletion only happens at program exit, it may be skipped completely.
- Salvador Fandiño provided improvements to reduce the memory usage of
sort
and to speed up some cases.
- Jarkko Hietaniemi and Andy Lester worked to mark as much data as possible in the C source files as
static
, to increase the proportion of the executable file that the operating system can share between process, and thus reduce real memory usage on multi-user systems.
p588-Installation and Configuration Improvements
Parallel makes should work properly now, although there may still be problems if make test
is instructed to run in parallel.
Building with Borland's compilers on Win32 should work more smoothly. In particular Steve Hay has worked to side step many warnings emitted by their compilers and at least one C compiler internal error.
Configure
will now detect clearenv
and unsetenv
, thanks to a patch from Alan Burlison. It will also probe for futimes
and whether sprintf
correctly returns the length of the formatted string, which will both be used in perl 5.8.9.
There are improved hints for next-3.0, vmesa, IX, Darwin, Solaris, Linux, DEC/OSF, HP-UX and MPE/iX
Perl extensions on Windows now can be statically built into the Perl DLL, thanks to a work by Vadim Konovalov. (This improvement was actually in 5.8.7, but was accidentally omitted from "p587-NAME").
p588-Selected Bug Fixes
p588-no warnings 'category' works correctly with -w
Previously when running with warnings enabled globally via -w
, selective disabling of specific warning categories would actually turn off all warnings. This is now fixed; now no warnings 'io';
will only turn off warnings in the io
class. Previously it would erroneously turn off all warnings.
This bug fix may cause some programs to start correctly issuing warnings.
p588-Remove over-optimisation
Perl 5.8.4 introduced a change so that assignments of undef
to a scalar, or of an empty list to an array or a hash, were optimised away. As this could cause problems when goto
jumps were involved, this change has been backed out.
p588-sprintf() fixes
Using the sprintf() function with some formats could lead to a buffer overflow in some specific cases. This has been fixed, along with several other bugs, notably in bounds checking.
In related fixes, it was possible for badly written code that did not follow the documentation of Sys::Syslog
to have formatting vulnerabilities. Sys::Syslog
has been changed to protect people from poor quality third party code.
p588-Debugger and Unicode slowdown
It had been reported that running under perl's debugger when processing Unicode data could cause unexpectedly large slowdowns. The most likely cause of this was identified and fixed by Nicholas Clark.
p588-Smaller fixes
FindBin
now works better with directories where access rights are more restrictive than usual.
- Several memory leaks in ithreads were closed. An improved implementation of
threads::shared
is available on CPAN - this will be merged into 5.8.9 if it proves stable.
- Trailing spaces are now trimmed from
$!
and $^E
.
- Operations that require perl to read a process's list of groups, such as reads of
$(
and $)
, now dynamically allocate memory rather than using a fixed sized array. The fixed size array could cause C stack exhaustion on systems configured to use large numbers of groups.
PerlIO::scalar
now works better with non-default $/
settings.
- You can now use the
x
operator to repeat a qw//
list. This used to raise a syntax error.
- The debugger now traces correctly execution in eval("")uated code that contains #line directives.
- The value of the
open
pragma is no longer ignored for three-argument opens.
- The optimisation of
for (reverse @a)
introduced in perl 5.8.6 could misbehave when the array had undefined elements and was used in LVALUE context. Dave Mitchell provided a fix.
- Some case insensitive matches between UTF-8 encoded data and 8 bit regexps, and vice versa, could give malformed character warnings. These have been fixed by Dave Mitchell and Yves Orton.
lcfirst
and ucfirst
could corrupt the string for certain cases where the length UTF-8 encoding of the string in lower case, upper case or title case differed. This was fixed by Nicholas Clark.
- Perl will now use the C library calls
unsetenv
and clearenv
if present to delete keys from %ENV
and delete %ENV
entirely, thanks to a patch from Alan Burlison.
p588-New or Changed Diagnostics
p588-Attempt to set length of freed array
This is a new warning, produced in situations such as this:
$r = do {my @a; \$#a};
$$r = 503;
p588-Non-string passed as bitmask
This is a new warning, produced when number has been passed as a argument to select(), instead of a bitmask.
# Wrong, will now warn
$rin = fileno(STDIN);
($nfound,$timeleft) = select($rout=$rin, undef, undef, $timeout);
# Should be
$rin = '';
vec($rin,fileno(STDIN),1) = 1;
($nfound,$timeleft) = select($rout=$rin, undef, undef, $timeout);
p588-Search pattern not terminated or ternary operator parsed as search pattern
This syntax error indicates that the lexer couldn't find the final delimiter of a ?PATTERN?
construct. Mentioning the ternary operator in this error message makes it easier to diagnose syntax errors.
p588-Changed Internals
There has been a fair amount of refactoring of the C
source code, partly to make it tidier and more maintainable. The resulting object code and the perl
binary may well be smaller than 5.8.7, in particular due to a change contributed by Dave Mitchell which reworked the warnings code to be significantly smaller. Apart from being smaller and possibly faster, there should be no user-detectable changes.
Andy Lester supplied many improvements to determine which function parameters and local variables could actually be declared const
to the C compiler. Steve Peters provided new *_set
macros and reworked the core to use these rather than assigning to macros in LVALUE context.
Dave Mitchell improved the lexer debugging output under -DT
Nicholas Clark changed the string buffer allocation so that it is now rounded up to the next multiple of 4 (or 8 on platforms with 64 bit pointers). This should reduce the number of calls to realloc
without actually using any extra memory.
The HV
's array of HE*
s is now allocated at the correct (minimal) size, thanks to another change by Nicholas Clark. Compile with -DPERL_USE_LARGE_HV_ALLOC
to use the old, sloppier, default.
For XS or embedding debugging purposes, if perl is compiled with -DDEBUG_LEAKING_SCALARS_FORK_DUMP
in addition to -DDEBUG_LEAKING_SCALARS
then a child process is fork
ed just before global destruction, which is used to display the values of any scalars found to have leaked at the end of global destruction. Without this, the scalars have already been freed sufficiently at the point of detection that it is impossible to produce any meaningful dump of their contents. This feature was implemented by the indefatigable Nicholas Clark, based on an idea by Mike Giroux.
p588-Platform Specific Problems
The optimiser on HP-UX 11.23 (Itanium 2) is currently partly disabled (scaled down to +O1) when using HP C-ANSI-C; the cause of problems at higher optimisation levels is still unclear.
There are a handful of remaining test failures on VMS, mostly due to test fixes and minor module tweaks with too many dependencies to integrate into this release from the development stream, where they have all been corrected. The following is a list of expected failures with the patch number of the fix where that is known:
ext/Devel/PPPort/t/ppphtest.t #26913
ext/List/Util/t/p_tainted.t #26912
lib/ExtUtils/t/PL_FILES.t #26813
lib/ExtUtils/t/basic.t #26813
t/io/fs.t
t/op/cmp.t
p588-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org. There may also be information at http://www.perl.org, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
p588-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p587-NAME
perl587delta - what is new for perl v5.8.7
p587-DESCRIPTION
This document describes differences between the 5.8.6 release and the 5.8.7 release.
p587-Incompatible Changes
There are no changes incompatible with 5.8.6.
p587-Core Enhancements
p587-Unicode Character Database 4.1.0
The copy of the Unicode Character Database included in Perl 5.8 has been updated to 4.1.0 from 4.0.1. See http://www.unicode.org/versions/Unicode4.1.0/#NotableChanges for the notable changes.
p587-suidperl less insecure
A pair of exploits in suidperl
involving debugging code have been closed.
For new projects the core perl team strongly recommends that you use dedicated, single purpose security tools such as sudo
in preference to suidperl
.
p587-Optional site customization script
The perl interpreter can be built to allow the use of a site customization script. By default this is not enabled, to be consistent with previous perl releases. To use this, add -Dusesitecustomize
to the command line flags when running the Configure
script. See also "-f" in perlrun.
p587-Config.pm
is now much smaller.
Config.pm
is now about 3K rather than 32K, with the infrequently used code and %Config
values loaded on demand. This is transparent to the programmer, but means that most code will save parsing and loading 29K of script (for example, code that uses File::Find
).
p587-Modules and Pragmata
- B upgraded to version 1.09
- base upgraded to version 2.07
- bignum upgraded to version 0.17
- bytes upgraded to version 1.02
- Carp upgraded to version 1.04
- CGI upgraded to version 3.10
- Class::ISA upgraded to version 0.33
- Data::Dumper upgraded to version 2.121_02
- DB_File upgraded to version 1.811
- Devel::PPPort upgraded to version 3.06
- Digest upgraded to version 1.10
- Encode upgraded to version 2.10
- FileCache upgraded to version 1.05
- File::Path upgraded to version 1.07
- File::Temp upgraded to version 0.16
- IO::File upgraded to version 1.11
- IO::Socket upgraded to version 1.28
- Math::BigInt upgraded to version 1.77
- Math::BigRat upgraded to version 0.15
- overload upgraded to version 1.03
- PathTools upgraded to version 3.05
- Pod::HTML upgraded to version 1.0503
- Pod::Perldoc upgraded to version 3.14
- Pod::LaTeX upgraded to version 0.58
- Pod::Parser upgraded to version 1.30
- Symbol upgraded to version 1.06
- Term::ANSIColor upgraded to version 1.09
- Test::Harness upgraded to version 2.48
- Test::Simple upgraded to version 0.54
- Text::Wrap upgraded to version 2001.09293, to fix a bug when wrap() was called with a non-space separator.
- threads::shared upgraded to version 0.93
- Time::HiRes upgraded to version 1.66
- Time::Local upgraded to version 1.11
- Unicode::Normalize upgraded to version 0.32
- utf8 upgraded to version 1.05
- Win32 upgraded to version 0.24, which provides Win32::GetFileVersion
p587-Utility Changes
p587-find2perl enhancements
find2perl
has new options -iname
, -path
and -ipath
.
p587-Performance Enhancements
The internal pointer mapping hash used during ithreads cloning now uses an arena for memory allocation. In tests this reduced ithreads cloning time by about 10%.
p587-Installation and Configuration Improvements
- The Win32 "dmake" makefile.mk has been updated to make it compatible with the latest versions of dmake.
PERL_MALLOC
, DEBUG_MSTATS
, PERL_HASH_SEED_EXPLICIT
and NO_HASH_SEED
should now work in Win32 makefiles.
p587-Selected Bug Fixes
- The socket() function on Win32 has been fixed so that it is able to use transport providers which specify a protocol of 0 (meaning any protocol is allowed) once more. (This was broken in 5.8.6, and typically caused the use of ICMP sockets to fail.)
- Another obscure bug involving
substr
and UTF-8 caused by bad internal offset caching has been identified and fixed.
- A bug involving the loading of UTF-8 tables by the regexp engine has been fixed - code such as
"\x{100}" =~ /[[:print:]]/
will no longer give corrupt results.
- Case conversion operations such as
uc
on a long Unicode string could exhaust memory. This has been fixed.
index
/rindex
were buggy for some combinations of Unicode and non-Unicode data. This has been fixed.
read
(and presumably sysread
) would expose the UTF-8 internals when reading from a byte oriented file handle into a UTF-8 scalar. This has been fixed.
- Several
pack
/unpack
bug fixes:
- Checksums with
b
or B
formats were broken.
unpack
checksums could overflow with the C
format.
U0
and C0
are now scoped to ()
pack
sub-templates.
- Counted length prefixes now don't change
C0
/U0
mode.
pack
Z0
used to destroy the preceding character.
P
/p
pack
formats used to only recognise literal undef
- Using closures with ithreads could cause perl to crash. This was due to failure to correctly lock internal OP structures, and has been fixed.
- The return value of
close
now correctly reflects any file errors that occur while flushing the handle's data, instead of just giving failure if the actual underlying file close operation failed.
not() || 1
used to segfault. not()
now behaves like not(0)
, which was the pre 5.6.0 behaviour.
h2ph
has various enhancements to cope with constructs in header files that used to result in incorrect or invalid output.
p587-New or Changed Diagnostics
There is a new taint error, "%ENV is aliased to %s". This error is thrown when taint checks are enabled and when *ENV
has been aliased, so that %ENV
has no env-magic anymore and hence the environment cannot be verified as taint-free.
The internals of pack
and unpack
have been updated. All legitimate templates should work as before, but there may be some changes in the error reported for complex failure cases. Any behaviour changes for non-error cases are bugs, and should be reported.
p587-Changed Internals
There has been a fair amount of refactoring of the C
source code, partly to make it tidier and more maintainable. The resulting object code and the perl
binary may well be smaller than 5.8.6, and hopefully faster in some cases, but apart from this there should be no user-detectable changes.
${^UTF8LOCALE}
has been added to give perl space access to PL_utf8locale
.
The size of the arenas used to allocate SV heads and most SV bodies can now be changed at compile time. The old size was 1008 bytes, the new default size is 4080 bytes.
p587-Known Problems
Unicode strings returned from overloaded operators can be buggy. This is a long standing bug reported since 5.8.6 was released, but we do not yet have a suitable fix for it.
p587-Platform Specific Problems
On UNICOS, lib/Math/BigInt/t/bigintc.t hangs burning CPU. ext/B/t/bytecode.t and ext/Socket/t/socketpair.t both fail tests. These are unlikely to be resolved, as our valiant UNICOS porter's last Cray is being decommissioned.
p587-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org. There may also be information at http://www.perl.org, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
p587-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p586-NAME
perl586delta - what is new for perl v5.8.6
p586-DESCRIPTION
This document describes differences between the 5.8.5 release and the 5.8.6 release.
p586-Incompatible Changes
There are no changes incompatible with 5.8.5.
p586-Core Enhancements
The perl interpreter is now more tolerant of UTF-16-encoded scripts.
On Win32, Perl can now use non-IFS compatible LSPs, which allows Perl to work in conjunction with firewalls such as McAfee Guardian. For full details see the file README.win32, particularly if you're running Win95.
p586-Modules and Pragmata
- With the
base
pragma, an intermediate class with no fields used to messes up private fields in the base class. This has been fixed.
- Cwd upgraded to version 3.01 (as part of the new PathTools distribution)
- Devel::PPPort upgraded to version 3.03
- File::Spec upgraded to version 3.01 (as part of the new PathTools distribution)
- Encode upgraded to version 2.08
- ExtUtils::MakeMaker remains at version 6.17, as later stable releases currently available on CPAN have some issues with core modules on some core platforms.
- I18N::LangTags upgraded to version 0.35
- Math::BigInt upgraded to version 1.73
- Math::BigRat upgraded to version 0.13
- MIME::Base64 upgraded to version 3.05
- POSIX::sigprocmask function can now retrieve the current signal mask without also setting it.
- Time::HiRes upgraded to version 1.65
p586-Utility Changes
Perl has a new -dt command-line flag, which enables threads support in the debugger.
p586-Performance Enhancements
reverse sort ...
is now optimized to sort in reverse, avoiding the generation of a temporary intermediate list.
for (reverse @foo)
now iterates in reverse, avoiding the generation of a temporary reversed list.
p586-Selected Bug Fixes
The regexp engine is now more robust when given invalid utf8 input, as is sometimes generated by buggy XS modules.
foreach
on threads::shared array used to be able to crash Perl. This bug has now been fixed.
A regexp in STDOUT
's destructor used to coredump, because the regexp pad was already freed. This has been fixed.
goto &
is now more robust - bugs in deep recursion and chained goto &
have been fixed.
Using delete
on an array no longer leaks memory. A pop
of an item from a shared array reference no longer causes a leak.
eval_sv()
failing a taint test could corrupt the stack - this has been fixed.
On platforms with 64 bit pointers numeric comparison operators used to erroneously compare the addresses of references that are overloaded, rather than using the overloaded values. This has been fixed.
read
into a UTF8-encoded buffer with an offset off the end of the buffer no longer mis-calculates buffer lengths.
Although Perl has promised since version 5.8 that sort()
would be stable, the two cases sort {$b cmp $a}
and sort {$b <=> $a}
could produce non-stable sorts. This is corrected in perl5.8.6.
Localising $^D
no longer generates a diagnostic message about valid -D flags.
p586-New or Changed Diagnostics
For -t and -T, Too late for "-T" option has been changed to the more informative "-T" is on the #! line, it must also be used on the command line
p586-Changed Internals
From now on all applications embedding perl will behave as if perl were compiled with -DPERL_USE_SAFE_PUTENV. See "Environment access" in the INSTALL file for details.
Most C
source files now have comments at the top explaining their purpose, which should help anyone wishing to get an overview of the implementation.
p586-New Tests
There are significantly more tests for the B
suite of modules.
p586-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org. There may also be information at http://www.perl.org, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
p586-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p585-NAME
perl585delta - what is new for perl v5.8.5
p585-DESCRIPTION
This document describes differences between the 5.8.4 release and the 5.8.5 release.
p585-Incompatible Changes
There are no changes incompatible with 5.8.4.
p585-Core Enhancements
Perl's regular expression engine now contains support for matching on the intersection of two Unicode character classes. You can also now refer to user-defined character classes from within other user defined character classes.
p585-Modules and Pragmata
- Carp improved to work nicely with Safe. Carp's message reporting should now be anomaly free - it will always print out line number information.
- CGI upgraded to version 3.05
- charnames now avoids clobbering $_
- Digest upgraded to version 1.08
- Encode upgraded to version 2.01
- FileCache upgraded to version 1.04
- libnet upgraded to version 1.19
- Pod::Parser upgraded to version 1.28
- Pod::Perldoc upgraded to version 3.13
- Pod::LaTeX upgraded to version 0.57
- Safe now works properly with Carp
- Scalar-List-Utils upgraded to version 1.14
- Shell's documentation has been re-written, and its historical partial auto-quoting of command arguments can now be disabled.
- Test upgraded to version 1.25
- Test::Harness upgraded to version 2.42
- Time::Local upgraded to version 1.10
- Unicode::Collate upgraded to version 0.40
- Unicode::Normalize upgraded to version 0.30
p585-Utility Changes
p585-Perl's debugger
The debugger can now emulate stepping backwards, by restarting and rerunning all bar the last command from a saved command history.
p585-h2ph
h2ph is now able to understand a very limited set of C inline functions -- basically, the inline functions that look like CPP macros. This has been introduced to deal with some of the headers of the newest versions of the glibc. The standard warning still applies; to quote h2ph's documentation, you may need to dicker with the files produced.
p585-Installation and Configuration Improvements
Perl 5.8.5 should build cleanly from source on LynxOS.
p585-Selected Bug Fixes
- The in-place sort optimisation introduced in 5.8.4 had a bug. For example, in code such as
@a = sort ($b, @a)
the result would omit the value $b. This is now fixed.
- The optimisation for unnecessary assignments introduced in 5.8.4 could give spurious warnings. This has been fixed.
- Perl should now correctly detect and read BOM-marked and (BOMless) UTF-16 scripts of either endianness.
- Creating a new thread when weak references exist was buggy, and would often cause warnings at interpreter destruction time. The known bug is now fixed.
- Several obscure bugs involving manipulating Unicode strings with
substr
have been fixed.
- Previously if Perl's file globbing function encountered a directory that it did not have permission to open it would return immediately, leading to unexpected truncation of the list of results. This has been fixed, to be consistent with Unix shells' globbing behaviour.
- Thread creation time could vary wildly between identical runs. This was caused by a poor hashing algorithm in the thread cloning routines, which has now been fixed.
- The internals of the ithreads implementation were not checking if OS-level thread creation had failed. threads->create() now returns
undef
in if thread creation fails instead of crashing perl.
p585-New or Changed Diagnostics
- Perl -V has several improvements
- correctly outputs local patch names that contain embedded code snippets or other characters that used to confuse it.
- arguments to -V that look like regexps will give multiple lines of output.
- a trailing colon suppresses the linefeed and ';' terminator, allowing embedding of queries into shell commands.
- a leading colon removes the 'name=' part of the response, allowing mapping to any name.
- When perl fails to find the specified script, it now outputs a second line suggesting that the user use the
-S
flag:
$ perl5.8.5 missing.pl
Can't open perl script "missing.pl": No such file or directory.
Use -S to search $PATH for it.
p585-Changed Internals
The Unicode character class files used by the regular expression engine are now built at build time from the supplied Unicode consortium data files, instead of being shipped prebuilt. This makes the compressed Perl source tarball about 200K smaller. A side effect is that the layout of files inside lib/unicore has changed.
p585-Known Problems
The regression test t/uni/class.t is now performing considerably more tests, and can take several minutes to run even on a fast machine.
p585-Platform Specific Problems
This release is known not to build on Windows 95.
p585-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org. There may also be information at http://www.perl.org, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
p585-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p584-NAME
perl584delta - what is new for perl v5.8.4
p584-DESCRIPTION
This document describes differences between the 5.8.3 release and the 5.8.4 release.
p584-Incompatible Changes
Many minor bugs have been fixed. Scripts which happen to rely on previously erroneous behaviour will consider these fixes as incompatible changes :-) You are advised to perform sufficient acceptance testing on this release to satisfy yourself that this does not affect you, before putting this release into production.
The diagnostic output of Carp has been changed slightly, to add a space after the comma between arguments. This makes it much easier for tools such as web browsers to wrap it, but might confuse any automatic tools which perform detailed parsing of Carp output.
The internal dump output has been improved, so that non-printable characters such as newline and backspace are output in \x
notation, rather than octal. This might just confuse non-robust tools which parse the output of modules such as Devel::Peek.
p584-Core Enhancements
p584-Malloc wrapping
Perl can now be built to detect attempts to assign pathologically large chunks of memory. Previously such assignments would suffer from integer wrap-around during size calculations causing a misallocation, which would crash perl, and could theoretically be used for "stack smashing" attacks. The wrapping defaults to enabled on platforms where we know it works (most AIX configurations, BSDi, Darwin, DEC OSF/1, FreeBSD, HP/UX, GNU Linux, OpenBSD, Solaris, VMS and most Win32 compilers) and defaults to disabled on other platforms.
p584-Unicode Character Database 4.0.1
The copy of the Unicode Character Database included in Perl 5.8 has been updated to 4.0.1 from 4.0.0.
p584-suidperl less insecure
Paul Szabo has analysed and patched suidperl
to remove existing known insecurities. Currently there are no known holes in suidperl
, but previous experience shows that we cannot be confident that these were the last. You may no longer invoke the set uid perl directly, so to preserve backwards compatibility with scripts that invoke #!/usr/bin/suidperl the only set uid binary is now sperl5.8.
n (sperl5.8.4
for this release). suidperl
is installed as a hard link to perl
; both suidperl
and perl
will invoke sperl5.8.4
automatically the set uid binary, so this change should be completely transparent.
For new projects the core perl team would strongly recommend that you use dedicated, single purpose security tools such as sudo
in preference to suidperl
.
p584-format
In addition to bug fixes, format
's features have been enhanced. See perlform
p584-Modules and Pragmata
The (mis)use of /tmp
in core modules and documentation has been tidied up. Some modules available both within the perl core and independently from CPAN ("dual-life modules") have not yet had these changes applied; the changes will be integrated into future stable perl releases as the modules are updated on CPAN.
p584-Updated modules
- p584-Attribute::Handlers
-
- p584-B
-
- p584-Benchmark
-
- p584-CGI
-
- p584-Carp
-
- p584-Cwd
-
- p584-Exporter
-
- p584-File::Find
-
- p584-IO
-
- p584-IPC::Open3
-
- p584-Local::Maketext
-
- p584-Math::BigFloat
-
- p584-Math::BigInt
-
- p584-Math::BigRat
-
- p584-MIME::Base64
-
- p584-ODBM_File
-
- p584-POSIX
-
- p584-Shell
-
- p584-Socket
-
There is experimental support for Linux abstract Unix domain sockets.
- p584-Storable
-
- p584-Switch
-
Synced with its CPAN version 2.10
- p584-Sys::Syslog
-
syslog()
can now use numeric constants for facility names and priorities, in addition to strings.
- p584-Term::ANSIColor
-
- p584-Time::HiRes
-
- p584-Unicode::UCD
-
- p584-Win32
-
Win32.pm/Win32.xs has moved from the libwin32 module to core Perl
- p584-base
-
- p584-open
-
- p584-threads
-
Detached threads are now also supported on Windows.
- p584-utf8
p584-Performance Enhancements
- Accelerated Unicode case mappings (
/i
, lc
, uc
, etc).
- In place sort optimised (eg
@a = sort @a
)
- Unnecessary assignment optimised away in
my $s = undef;
my @a = ();
my %h = ();
- Optimised
map
in scalar context
p584-Utility Changes
The Perl debugger (lib/perl5db.pl) can now save all debugger commands for sourcing later, and can display the parent inheritance tree of a given class.
p584-Installation and Configuration Improvements
The build process on both VMS and Windows has had several minor improvements made. On Windows Borland's C compiler can now compile perl with PerlIO and/or USE_LARGE_FILES enabled.
perl.exe
on Windows now has a "Camel" logo icon. The use of a camel with the topic of Perl is a trademark of O'Reilly and Associates Inc., and is used with their permission (ie distribution of the source, compiling a Windows executable from it, and using that executable locally). Use of the supplied camel for anything other than a perl executable's icon is specifically not covered, and anyone wishing to redistribute perl binaries with the icon should check directly with O'Reilly beforehand.
Perl should build cleanly on Stratus VOS once more.
p584-Selected Bug Fixes
More utf8 bugs fixed, notably in how chomp
, chop
, send
, and syswrite
and interact with utf8 data. Concatenation now works correctly when use bytes;
is in scope.
Pragmata are now correctly propagated into (?{...}) constructions in regexps. Code such as
my $x = qr{ ... (??{ $x }) ... };
will now (correctly) fail under use strict. (As the inner $x
is and has always referred to $::x
)
The "const in void context" warning has been suppressed for a constant in an optimised-away boolean expression such as 5 || print;
perl -i
could fchmod(stdin)
by mistake. This is serious if stdin is attached to a terminal, and perl is running as root. Now fixed.
p584-New or Changed Diagnostics
Carp
and the internal diagnostic routines used by Devel::Peek
have been made clearer, as described in "p584-Incompatible Changes"
p584-Changed Internals
Some bugs have been fixed in the hash internals. Restricted hashes and their place holders are now allocated and deleted at slightly different times, but this should not be visible to user code.
p584-Future Directions
Code freeze for the next maintenance release (5.8.5) will be on 30th June 2004, with release by mid July.
p584-Platform Specific Problems
This release is known not to build on Windows 95.
p584-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org. There may also be information at http://www.perl.org, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
p584-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p583-NAME
perl583delta - what is new for perl v5.8.3
p583-DESCRIPTION
This document describes differences between the 5.8.2 release and the 5.8.3 release.
If you are upgrading from an earlier release such as 5.6.1, first read the "p58-NAME", which describes differences between 5.6.0 and 5.8.0, and the "p581-NAME" and "p582-NAME", which describe differences between 5.8.0, 5.8.1 and 5.8.2
p583-Incompatible Changes
There are no changes incompatible with 5.8.2.
p583-Core Enhancements
A SCALAR
method is now available for tied hashes. This is called when a tied hash is used in scalar context, such as
if (%tied_hash) {
...
}
The old behaviour was that %tied_hash would return whatever would have been returned for that hash before the hash was tied (so usually 0). The new behaviour in the absence of a SCALAR method is to return TRUE if in the middle of an each
iteration, and otherwise call FIRSTKEY to check if the hash is empty (making sure that a subsequent each
will also begin by calling FIRSTKEY). Please see "SCALAR" in perltie for the full details and caveats.
p583-Modules and Pragmata
- p583-CGI
-
- p583-Cwd
-
- p583-Digest
-
- p583-Digest::MD5
-
- p583-Encode
-
- p583-File::Spec
-
- p583-FindBin
-
A function again
is provided to resolve problems where modules in different directories wish to use FindBin.
- p583-List::Util
-
You can now weaken references to read only values.
- p583-Math::BigInt
-
- p583-PodParser
-
- p583-Pod::Perldoc
-
- p583-POSIX
-
- p583-Unicode::Collate
-
- p583-Unicode::Normalize
-
- p583-Test::Harness
-
- p583-threads::shared
-
cond_wait
has a new two argument form. cond_timedwait
has been added.
p583-Utility Changes
find2perl
now assumes -print
as a default action. Previously, it needed to be specified explicitly.
A new utility, prove
, makes it easy to run an individual regression test at the command line. prove
is part of Test::Harness, which users of earlier Perl versions can install from CPAN.
p583-New Documentation
The documentation has been revised in places to produce more standard manpages.
The documentation for the special code blocks (BEGIN, CHECK, INIT, END) has been improved.
p583-Installation and Configuration Improvements
Perl now builds on OpenVMS I64
p583-Selected Bug Fixes
Using substr() on a UTF8 string could cause subsequent accesses on that string to return garbage. This was due to incorrect UTF8 offsets being cached, and is now fixed.
join() could return garbage when the same join() statement was used to process 8 bit data having earlier processed UTF8 data, due to the flags on that statement's temporary workspace not being reset correctly. This is now fixed.
$a .. $b
will now work as expected when either $a or $b is undef
Using Unicode keys with tied hashes should now work correctly.
Reading $^E now preserves $!. Previously, the C code implementing $^E did not preserve errno
, so reading $^E could cause errno
and therefore $!
to change unexpectedly.
Reentrant functions will (once more) work with C++. 5.8.2 introduced a bugfix which accidentally broke the compilation of Perl extensions written in C++
p583-New or Changed Diagnostics
The fatal error "DESTROY created new reference to dead object" is now documented in perldiag.
p583-Changed Internals
The hash code has been refactored to reduce source duplication. The external interface is unchanged, and aside from the bug fixes described above, there should be no change in behaviour.
hv_clear_placeholders
is now part of the perl API
Some C macros have been tidied. In particular macros which create temporary local variables now name these variables more defensively, which should avoid bugs where names clash.
is now always included.
p583-Configuration and Building
Configure
now invokes callbacks regardless of the value of the variable they are called for. Previously callbacks were only invoked in the case $variable $define)
branch. This change should only affect platform maintainers writing configuration hints files.
p583-Platform Specific Problems
The regression test ext/threads/shared/t/wait.t fails on early RedHat 9 and HP-UX 10.20 due to bugs in their threading implementations. RedHat users should see https://rhn.redhat.com/errata/RHBA-2003-136.html and consider upgrading their glibc.
p583-Known Problems
Detached threads aren't supported on Windows yet, as they may lead to memory access violation problems.
There is a known race condition opening scripts in suidperl
. suidperl
is neither built nor installed by default, and has been deprecated since perl 5.8.0. You are advised to replace use of suidperl with tools such as sudo ( http://www.courtesan.com/sudo/ )
We have a backlog of unresolved bugs. Dealing with bugs and bug reports is unglamorous work; not something ideally suited to volunteer labour, but that is all that we have.
The perl5 development team are implementing changes to help address this problem, which should go live in early 2004.
p583-Future Directions
Code freeze for the next maintenance release (5.8.4) is on March 31st 2004, with release expected by mid April. Similarly 5.8.5's freeze will be at the end of June, with release by mid July.
p583-Obituary
Iain 'Spoon' Truskett, Perl hacker, author of perlreref and contributor to CPAN, died suddenly on 29th December 2003, aged 24. He will be missed.
p583-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org. There may also be information at http://www.perl.org, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
p583-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p582-NAME
perl582delta - what is new for perl v5.8.2
p582-DESCRIPTION
This document describes differences between the 5.8.1 release and the 5.8.2 release.
If you are upgrading from an earlier release such as 5.6.1, first read the "p58-NAME", which describes differences between 5.6.0 and 5.8.0, and the "p581-NAME", which describes differences between 5.8.0 and 5.8.1.
p582-Incompatible Changes
For threaded builds for modules calling certain re-entrant system calls, binary compatibility was accidentally lost between 5.8.0 and 5.8.1. Binary compatibility with 5.8.0 has been restored in 5.8.2, which necessitates breaking compatibility with 5.8.1. We see this as the lesser of two evils.
This will only affect people who have a threaded perl 5.8.1, and compiled modules which use these calls, and now attempt to run the compiled modules with 5.8.2. The fix is to re-compile and re-install the modules using 5.8.2.
p582-Core Enhancements
p582-Hash Randomisation
The hash randomisation introduced with 5.8.1 has been amended. It transpired that although the implementation introduced in 5.8.1 was source compatible with 5.8.0, it was not binary compatible in certain cases. 5.8.2 contains an improved implementation which is both source and binary compatible with both 5.8.0 and 5.8.1, and remains robust against the form of attack which prompted the change for 5.8.1.
We are grateful to the Debian project for their input in this area. See "Algorithmic Complexity Attacks" in perlsec for the original rationale behind this change.
p582-Threading
Several memory leaks associated with variables shared between threads have been fixed.
p582-Modules and Pragmata
p582-Updated Modules And Pragmata
The following modules and pragmata have been updated since Perl 5.8.1:
- p582-Devel::PPPort
-
- p582-Digest::MD5
-
- p582-I18N::LangTags
-
- p582-libnet
-
- p582-MIME::Base64
-
- p582-Pod::Perldoc
-
- p582-strict
-
Documentation improved
- p582-Tie::Hash
-
Documentation improved
- p582-Time::HiRes
-
- p582-Unicode::Collate
-
- p582-Unicode::Normalize
-
- p582-UNIVERSAL
-
Documentation improved
p582-Selected Bug Fixes
Some syntax errors involving unrecognized filetest operators are now handled correctly by the parser.
p582-Changed Internals
Interpreter initialization is more complete when -DMULTIPLICITY is off. This should resolve problems with initializing and destroying the Perl interpreter more than once in a single process.
p582-Platform Specific Problems
Dynamic linker flags have been tweaked for Solaris and OS X, which should solve problems seen while building some XS modules.
Bugs in OS/2 sockets and tmpfile have been fixed.
In OS X setreuid
and friends are troublesome - perl will now work around their problems as best possible.
p582-Future Directions
Starting with 5.8.3 we intend to make more frequent maintenance releases, with a smaller number of changes in each. The intent is to propagate bug fixes out to stable releases more rapidly and make upgrading stable releases less of an upheaval. This should give end users more flexibility in their choice of upgrade timing, and allow them easier assessment of the impact of upgrades. The current plan is for code freezes as follows
- 5.8.3 23:59:59 GMT, Wednesday December 31st 2003
- 5.8.4 23:59:59 GMT, Wednesday March 31st 2004
- 5.8.5 23:59:59 GMT, Wednesday June 30th 2004
with the release following soon after, when testing is complete.
See "p581-Future Directions" for more soothsaying.
p582-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/. There may also be information at http://www.perl.com/, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
p582-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p581-NAME
perl581delta - what is new for perl v5.8.1
p581-DESCRIPTION
This document describes differences between the 5.8.0 release and the 5.8.1 release.
If you are upgrading from an earlier release such as 5.6.1, first read the "p58-NAME", which describes differences between 5.6.0 and 5.8.0.
In case you are wondering about 5.6.1, it was bug-fix-wise rather identical to the development release 5.7.1. Confused? This timeline hopefully helps a bit: it lists the new major releases, their maintenance releases, and the development releases.
New Maintenance Development
5.6.0 2000-Mar-22
5.7.0 2000-Sep-02
5.6.1 2001-Apr-08
5.7.1 2001-Apr-09
5.7.2 2001-Jul-13
5.7.3 2002-Mar-05
5.8.0 2002-Jul-18
5.8.1 2003-Sep-25
p581-Incompatible Changes
p581-Hash Randomisation
Mainly due to security reasons, the "random ordering" of hashes has been made even more random. Previously while the order of hash elements from keys(), values(), and each() was essentially random, it was still repeatable. Now, however, the order varies between different runs of Perl.
Perl has never guaranteed any ordering of the hash keys, and the ordering has already changed several times during the lifetime of Perl 5. Also, the ordering of hash keys has always been, and continues to be, affected by the insertion order.
The added randomness may affect applications.
One possible scenario is when output of an application has included hash data. For example, if you have used the Data::Dumper module to dump data into different files, and then compared the files to see whether the data has changed, now you will have false positives since the order in which hashes are dumped will vary. In general the cure is to sort the keys (or the values); in particular for Data::Dumper to use the Sortkeys
option. If some particular order is really important, use tied hashes: for example the Tie::IxHash module which by default preserves the order in which the hash elements were added.
More subtle problem is reliance on the order of "global destruction". That is what happens at the end of execution: Perl destroys all data structures, including user data. If your destructors (the DESTROY subroutines) have assumed any particular ordering to the global destruction, there might be problems ahead. For example, in a destructor of one object you cannot assume that objects of any other class are still available, unless you hold a reference to them. If the environment variable PERL_DESTRUCT_LEVEL is set to a non-zero value, or if Perl is exiting a spawned thread, it will also destruct the ordinary references and the symbol tables that are no longer in use. You can't call a class method or an ordinary function on a class that has been collected that way.
The hash randomisation is certain to reveal hidden assumptions about some particular ordering of hash elements, and outright bugs: it revealed a few bugs in the Perl core and core modules.
To disable the hash randomisation in runtime, set the environment variable PERL_HASH_SEED to 0 (zero) before running Perl (for more information see "PERL_HASH_SEED" in perlrun), or to disable the feature completely in compile time, compile with -DNO_HASH_SEED
(see INSTALL).
See "Algorithmic Complexity Attacks" in perlsec for the original rationale behind this change.
p581-UTF-8 On Filehandles No Longer Activated By Locale
In Perl 5.8.0 all filehandles, including the standard filehandles, were implicitly set to be in Unicode UTF-8 if the locale settings indicated the use of UTF-8. This feature caused too many problems, so the feature was turned off and redesigned: see "p581-Core Enhancements".
""
>p581-Single-number v-strings are no longer v-strings before "=>"
The version strings or v-strings (see "Version Strings" in perldata) feature introduced in Perl 5.6.0 has been a source of some confusion-- especially when the user did not want to use it, but Perl thought it knew better. Especially troublesome has been the feature that before a "=>" a version string (a "v" followed by digits) has been interpreted as a v-string instead of a string literal. In other words:
%h = ( v65 => 42 );
has meant since Perl 5.6.0
%h = ( 'A' => 42 );
(at least in platforms of ASCII progeny) Perl 5.8.1 restores the more natural interpretation
%h = ( 'v65' => 42 );
The multi-number v-strings like v65.66 and 65.66.67 still continue to be v-strings in Perl 5.8.
p581-(Win32) The -C Switch Has Been Repurposed
The -C switch has changed in an incompatible way. The old semantics of this switch only made sense in Win32 and only in the "use utf8" universe in 5.6.x releases, and do not make sense for the Unicode implementation in 5.8.0. Since this switch could not have been used by anyone, it has been repurposed. The behavior that this switch enabled in 5.6.x releases may be supported in a transparent, data-dependent fashion in a future release.
For the new life of this switch, see "p581-UTF-8 no longer default under UTF-8 locales", and "-C" in perlrun.
p581-(Win32) The /d Switch Of cmd.exe
Perl 5.8.1 uses the /d switch when running the cmd.exe shell internally for system(), backticks, and when opening pipes to external programs. The extra switch disables the execution of AutoRun commands from the registry, which is generally considered undesirable when running external programs. If you wish to retain compatibility with the older behavior, set PERL5SHELL in your environment to cmd /x/c
.
p581-Core Enhancements
p581-UTF-8 no longer default under UTF-8 locales
In Perl 5.8.0 many Unicode features were introduced. One of them was found to be of more nuisance than benefit: the automagic (and silent) "UTF-8-ification" of filehandles, including the standard filehandles, if the user's locale settings indicated use of UTF-8.
For example, if you had en_US.UTF-8
as your locale, your STDIN and STDOUT were automatically "UTF-8", in other words an implicit binmode(..., ":utf8") was made. This meant that trying to print, say, chr(0xff), ended up printing the bytes 0xc3 0xbf. Hardly what you had in mind unless you were aware of this feature of Perl 5.8.0. The problem is that the vast majority of people weren't: for example in RedHat releases 8 and 9 the default locale setting is UTF-8, so all RedHat users got UTF-8 filehandles, whether they wanted it or not. The pain was intensified by the Unicode implementation of Perl 5.8.0 (still) having nasty bugs, especially related to the use of s/// and tr///. (Bugs that have been fixed in 5.8.1)
Therefore a decision was made to backtrack the feature and change it from implicit silent default to explicit conscious option. The new Perl command line option -C
and its counterpart environment variable PERL_UNICODE can now be used to control how Perl and Unicode interact at interfaces like I/O and for example the command line arguments. See "-C" in perlrun and "PERL_UNICODE" in perlrun for more information.
p581-Unsafe signals again available
In Perl 5.8.0 the so-called "safe signals" were introduced. This means that Perl no longer handles signals immediately but instead "between opcodes", when it is safe to do so. The earlier immediate handling easily could corrupt the internal state of Perl, resulting in mysterious crashes.
However, the new safer model has its problems too. Because now an opcode, a basic unit of Perl execution, is never interrupted but instead let to run to completion, certain operations that can take a long time now really do take a long time. For example, certain network operations have their own blocking and timeout mechanisms, and being able to interrupt them immediately would be nice.
Therefore perl 5.8.1 introduces a "backdoor" to restore the pre-5.8.0 (pre-5.7.3, really) signal behaviour. Just set the environment variable PERL_SIGNALS to unsafe
, and the old immediate (and unsafe) signal handling behaviour returns. See "PERL_SIGNALS" in perlrun and "Deferred Signals (Safe Signals)" in perlipc.
In completely unrelated news, you can now use safe signals with POSIX::SigAction. See "POSIX::SigAction" in POSIX.
p581-Tied Arrays with Negative Array Indices
Formerly, the indices passed to FETCH
, STORE
, EXISTS
, and DELETE
methods in tied array class were always non-negative. If the actual argument was negative, Perl would call FETCHSIZE implicitly and add the result to the index before passing the result to the tied array method. This behaviour is now optional. If the tied array class contains a package variable named $NEGATIVE_INDICES
which is set to a true value, negative values will be passed to FETCH
, STORE
, EXISTS
, and DELETE
unchanged.
p581-local ${$x}
The syntaxes
local ${$x}
local @{$x}
local %{$x}
now do localise variables, given that the $x is a valid variable name.
p581-Unicode Character Database 4.0.0
The copy of the Unicode Character Database included in Perl 5.8 has been updated to 4.0.0 from 3.2.0. This means for example that the Unicode character properties are as in Unicode 4.0.0.
p581-Deprecation Warnings
There is one new feature deprecation. Perl 5.8.0 forgot to add some deprecation warnings, these warnings have now been added. Finally, a reminder of an impending feature removal.
p581-(Reminder) Pseudo-hashes are deprecated (really)
Pseudo-hashes were deprecated in Perl 5.8.0 and will be removed in Perl 5.10.0, see "p58-NAME" for details. Each attempt to access pseudo-hashes will trigger the warning Pseudo-hashes are deprecated
. If you really want to continue using pseudo-hashes but not to see the deprecation warnings, use:
no warnings 'deprecated';
Or you can continue to use the fields pragma, but please don't expect the data structures to be pseudohashes any more.
p581-(Reminder) 5.005-style threads are deprecated (really)
5.005-style threads (activated by use Thread;
) were deprecated in Perl 5.8.0 and will be removed after Perl 5.8, see "p58-NAME" for details. Each 5.005-style thread creation will trigger the warning 5.005 threads are deprecated
. If you really want to continue using the 5.005 threads but not to see the deprecation warnings, use:
no warnings 'deprecated';
p581-(Reminder) The $* variable is deprecated (really)
The $*
variable controlling multi-line matching has been deprecated and will be removed after 5.8. The variable has been deprecated for a long time, and a deprecation warning Use of $* is deprecated
is given, now the variable will just finally be removed. The functionality has been supplanted by the /s
and /m
modifiers on pattern matching. If you really want to continue using the $*
-variable but not to see the deprecation warnings, use:
no warnings 'deprecated';
p581-Miscellaneous Enhancements
map
in void context is no longer expensive. map
is now context aware, and will not construct a list if called in void context.
If a socket gets closed by the server while printing to it, the client now gets a SIGPIPE. While this new feature was not planned, it fell naturally out of PerlIO changes, and is to be considered an accidental feature.
PerlIO::get_layers(FH) returns the names of the PerlIO layers active on a filehandle.
PerlIO::via layers can now have an optional UTF8 method to indicate whether the layer wants to "auto-:utf8" the stream.
utf8::is_utf8() has been added as a quick way to test whether a scalar is encoded internally in UTF-8 (Unicode).
p581-Modules and Pragmata
p581-Updated Modules And Pragmata
The following modules and pragmata have been updated since Perl 5.8.0:
- p581-base
-
- p581-B::Bytecode
-
In much better shape than it used to be. Still far from perfect, but maybe worth a try.
- p581-B::Concise
-
- p581-B::Deparse
-
- p581-Benchmark
-
An optional feature, :hireswallclock
, now allows for high resolution wall clock times (uses Time::HiRes).
- p581-ByteLoader
-
See B::Bytecode.
- p581-bytes
-
Now has bytes::substr.
- p581-CGI
-
- p581-charnames
-
One can now have custom character name aliases.
- p581-CPAN
-
There is now a simple command line frontend to the CPAN.pm module called cpan.
- p581-Data::Dumper
-
A new option, Pair, allows choosing the separator between hash keys and values.
- p581-DB_File
-
- p581-Devel::PPPort
-
- p581-Digest::MD5
-
- p581-Encode
-
Significant updates on the encoding pragma functionality (tr/// and the DATA filehandle, formats).
If a filehandle has been marked as to have an encoding, unmappable characters are detected already during input, not later (when the corrupted data is being used).
The ISO 8859-6 conversion table has been corrected (the 0x30..0x39 erroneously mapped to U+0660..U+0669, instead of U+0030..U+0039). The GSM 03.38 conversion did not handle escape sequences correctly. The UTF-7 encoding has been added (making Encode feature-complete with Unicode::String).
- p581-fields
-
- p581-libnet
-
- p581-Math::BigInt
-
A lot of bugs have been fixed since v1.60, the version included in Perl v5.8.0. Especially noteworthy are the bug in Calc that caused div and mod to fail for some large values, and the fixes to the handling of bad inputs.
Some new features were added, e.g. the broot() method, you can now pass parameters to config() to change some settings at runtime, and it is now possible to trap the creation of NaN and infinity.
As usual, some optimizations took place and made the math overall a tad faster. In some cases, quite a lot faster, actually. Especially alternative libraries like Math::BigInt::GMP benefit from this. In addition, a lot of the quite clunky routines like fsqrt() and flog() are now much much faster.
- p581-MIME::Base64
-
- p581-NEXT
-
Diamond inheritance now works.
- p581-Net::Ping
-
- p581-PerlIO::scalar
-
Reading from non-string scalars (like the special variables, see perlvar) now works.
- p581-podlators
-
- p581-Pod::LaTeX
-
- p581-PodParsers
-
- p581-Pod::Perldoc
-
Complete rewrite. As a side-effect, no longer refuses to startup when run by root.
- p581-Scalar::Util
-
New utilities: refaddr, isvstring, looks_like_number, set_prototype.
- p581-Storable
-
Can now store code references (via B::Deparse, so not foolproof).
- p581-strict
-
Earlier versions of the strict pragma did not check the parameters implicitly passed to its "import" (use) and "unimport" (no) routine. This caused the false idiom such as:
use strict qw(@ISA);
@ISA = qw(Foo);
This however (probably) raised the false expectation that the strict refs, vars and subs were being enforced (and that @ISA was somehow "declared"). But the strict refs, vars, and subs are not enforced when using this false idiom.
Starting from Perl 5.8.1, the above will cause an error to be raised. This may cause programs which used to execute seemingly correctly without warnings and errors to fail when run under 5.8.1. This happens because
use strict qw(@ISA);
will now fail with the error:
Unknown 'strict' tag(s) '@ISA'
The remedy to this problem is to replace this code with the correct idiom:
use strict;
use vars qw(@ISA);
@ISA = qw(Foo);
- p581-Term::ANSIcolor
-
- p581-Test::Harness
-
Now much more picky about extra or missing output from test scripts.
- p581-Test::More
-
- p581-Test::Simple
-
- p581-Text::Balanced
-
- p581-Time::HiRes
-
Use of nanosleep(), if available, allows mixing subsecond sleeps with alarms.
- p581-threads
-
Several fixes, for example for join() problems and memory leaks. In some platforms (like Linux) that use glibc the minimum memory footprint of one ithread has been reduced by several hundred kilobytes.
- p581-threads::shared
-
Many memory leaks have been fixed.
- p581-Unicode::Collate
-
- p581-Unicode::Normalize
-
- p581-Win32::GetFolderPath
-
- p581-Win32::GetOSVersion
-
Now returns extra information.
p581-Utility Changes
The h2xs
utility now produces a more modern layout: Foo-Bar/lib/Foo/Bar.pm instead of Foo/Bar/Bar.pm. Also, the boilerplate test is now called t/Foo-Bar.t instead of t/1.t.
The Perl debugger (lib/perl5db.pl) has now been extensively documented and bugs found while documenting have been fixed.
perldoc
has been rewritten from scratch to be more robust and feature rich.
perlcc -B
works now at least somewhat better, while perlcc -c
is rather more broken. (The Perl compiler suite as a whole continues to be experimental.)
p581-New Documentation
perl573delta has been added to list the differences between the (now quite obsolete) development releases 5.7.2 and 5.7.3.
perl58delta has been added: it is the perldelta of 5.8.0, detailing the differences between 5.6.0 and 5.8.0.
perlartistic has been added: it is the Artistic License in pod format, making it easier for modules to refer to it.
perlcheat has been added: it is a Perl cheat sheet.
perlgpl has been added: it is the GNU General Public License in pod format, making it easier for modules to refer to it.
perlmacosx has been added to tell about the installation and use of Perl in Mac OS X.
perlos400 has been added to tell about the installation and use of Perl in OS/400 PASE.
perlreref has been added: it is a regular expressions quick reference.
p581-Installation and Configuration Improvements
The Unix standard Perl location, /usr/bin/perl, is no longer overwritten by default if it exists. This change was very prudent because so many Unix vendors already provide a /usr/bin/perl, but simultaneously many system utilities may depend on that exact version of Perl, so better not to overwrite it.
One can now specify installation directories for site and vendor man and HTML pages, and site and vendor scripts. See INSTALL.
One can now specify a destination directory for Perl installation by specifying the DESTDIR variable for make install
. (This feature is slightly different from the previous Configure -Dinstallprefix=...
.) See INSTALL.
gcc versions 3.x introduced a new warning that caused a lot of noise during Perl compilation: gcc -Ialreadyknowndirectory (warning: changing search order)
. This warning has now been avoided by Configure weeding out such directories before the compilation.
One can now build subsets of Perl core modules by using the Configure flags -Dnoextensions=...
and -Donlyextensions=...
, see INSTALL.
p581-Platform-specific enhancements
In Cygwin Perl can now be built with threads (Configure -Duseithreads
). This works with both Cygwin 1.3.22 and Cygwin 1.5.3.
In newer FreeBSD releases Perl 5.8.0 compilation failed because of trying to use malloc.h, which in FreeBSD is just a dummy file, and a fatal error to even try to use. Now malloc.h is not used.
Perl is now known to build also in Hitachi HI-UXMPP.
Perl is now known to build again in LynxOS.
Mac OS X now installs with Perl version number embedded in installation directory names for easier upgrading of user-compiled Perl, and the installation directories in general are more standard. In other words, the default installation no longer breaks the Apple-provided Perl. On the other hand, with Configure -Dprefix=/usr
you can now really replace the Apple-supplied Perl (please be careful).
Mac OS X now builds Perl statically by default. This change was done mainly for faster startup times. The Apple-provided Perl is still dynamically linked and shared, and you can enable the sharedness for your own Perl builds by Configure -Duseshrplib
.
Perl has been ported to IBM's OS/400 PASE environment. The best way to build a Perl for PASE is to use an AIX host as a cross-compilation environment. See README.os400.
Yet another cross-compilation option has been added: now Perl builds on OpenZaurus, an Linux distribution based on Mandrake + Embedix for the Sharp Zaurus PDA. See the Cross/README file.
Tru64 when using gcc 3 drops the optimisation for toke.c to -O2
because of gigantic memory use with the default -O3
.
Tru64 can now build Perl with the newer Berkeley DBs.
Building Perl on WinCE has been much enhanced, see README.ce and README.perlce.
p581-Selected Bug Fixes
p581-Closures, eval and lexicals
There have been many fixes in the area of anonymous subs, lexicals and closures. Although this means that Perl is now more "correct", it is possible that some existing code will break that happens to rely on the faulty behaviour. In practice this is unlikely unless your code contains a very complex nesting of anonymous subs, evals and lexicals.
p581-Generic fixes
If an input filehandle is marked :utf8
and Perl sees illegal UTF-8 coming in when doing
, if warnings are enabled a warning is immediately given - instead of being silent about it and Perl being unhappy about the broken data later. (The :encoding(utf8)
layer also works the same way.)
binmode(SOCKET, ":utf8") only worked on the input side, not on the output side of the socket. Now it works both ways.
For threaded Perls certain system database functions like getpwent() and getgrent() now grow their result buffer dynamically, instead of failing. This means that at sites with lots of users and groups the functions no longer fail by returning only partial results.
Perl 5.8.0 had accidentally broken the capability for users to define their own uppercase<->lowercase Unicode mappings (as advertised by the Camel). This feature has been fixed and is also documented better.
In 5.8.0 this
$some_unicode .= ;
didn't work correctly but instead corrupted the data. This has now been fixed.
Tied methods like FETCH etc. may now safely access tied values, i.e. resulting in a recursive call to FETCH etc. Remember to break the recursion, though.
At startup Perl blocks the SIGFPE signal away since there isn't much Perl can do about it. Previously this blocking was in effect also for programs executed from within Perl. Now Perl restores the original SIGFPE handling routine, whatever it was, before running external programs.
Linenumbers in Perl scripts may now be greater than 65536, or 2**16. (Perl scripts have always been able to be larger than that, it's just that the linenumber for reported errors and warnings have "wrapped around".) While scripts that large usually indicate a need to rethink your code a bit, such Perl scripts do exist, for example as results from generated code. Now linenumbers can go all the way to 4294967296, or 2**32.
p581-Platform-specific fixes
Linux
- Setting $0 works again (with certain limitations that Perl cannot do much about: see "$0" in perlvar)
HP-UX
- Setting $0 now works.
VMS
- Configuration now tests for the presence of
poll()
, and IO::Poll now uses the vendor-supplied function if detected.
- A rare access violation at Perl start-up could occur if the Perl image was installed with privileges or if there was an identifier with the subsystem attribute set in the process's rightslist. Either of these circumstances triggered tainting code that contained a pointer bug. The faulty pointer arithmetic has been fixed.
- The length limit on values (not keys) in the %ENV hash has been raised from 255 bytes to 32640 bytes (except when the PERL_ENV_TABLES setting overrides the default use of logical names for %ENV). If it is necessary to access these long values from outside Perl, be aware that they are implemented using search list logical names that store the value in pieces, each 255-byte piece (up to 128 of them) being an element in the search list. When doing a lookup in %ENV from within Perl, the elements are combined into a single value. The existing VMS-specific ability to access individual elements of a search list logical name via the $ENV{'foo;N'} syntax (where N is the search list index) is unimpaired.
- The piping implementation now uses local rather than global DCL symbols for inter-process communication.
- File::Find could become confused when navigating to a relative directory whose name collided with a logical name. This problem has been corrected by adding directory syntax to relative path names, thus preventing logical name translation.
Win32
- A memory leak in the fork() emulation has been fixed.
- The return value of the ioctl() built-in function was accidentally broken in 5.8.0. This has been corrected.
- The internal message loop executed by perl during blocking operations sometimes interfered with messages that were external to Perl. This often resulted in blocking operations terminating prematurely or returning incorrect results, when Perl was executing under environments that could generate Windows messages. This has been corrected.
- Pipes and sockets are now automatically in binary mode.
- The four-argument form of select() did not preserve $! (errno) properly when there were errors in the underlying call. This is now fixed.
- The "CR CR LF" problem of has been fixed, binmode(FH, ":crlf") is now effectively a no-op.
p581-New or Changed Diagnostics
All the warnings related to pack() and unpack() were made more informative and consistent.
p581-Changed "A thread exited while %d threads were running"
The old version
A thread exited while %d other threads were still running
was misleading because the "other" included also the thread giving the warning.
p581-Removed "Attempt to clear a restricted hash"
It is not illegal to clear a restricted hash, so the warning was removed.
p581-New "Illegal declaration of anonymous subroutine"
You must specify the block of code for sub
.
p581-Changed "Invalid range "%s" in transliteration operator"
The old version
Invalid [] range "%s" in transliteration operator
was simply wrong because there are no "[] ranges" in tr///.
p581-New "Missing control char name in \c"
Self-explanatory.
p581-New "Newline in left-justified string for %s"
The padding spaces would appear after the newline, which is probably not what you had in mind.
p581-New "Possible precedence problem on bitwise %c operator"
If you think this
$x & $y == 0
tests whether the bitwise AND of $x and $y is zero, you will like this warning.
p581-New "Pseudo-hashes are deprecated"
This warning should have been already in 5.8.0, since they are.
p581-New "read() on %s filehandle %s"
You cannot read() (or sysread()) from a closed or unopened filehandle.
p581-New "5.005 threads are deprecated"
This warning should have been already in 5.8.0, since they are.
p581-New "Tied variable freed while still in use"
Something pulled the plug on a live tied variable, Perl plays safe by bailing out.
p581-New "To%s: illegal mapping '%s'"
An illegal user-defined Unicode casemapping was specified.
p581-New "Use of freed value in iteration"
Something modified the values being iterated over. This is not good.
p581-Changed Internals
These news matter to you only if you either write XS code or like to know about or hack Perl internals (using Devel::Peek or any of the B::
modules counts), or like to run Perl with the -D
option.
The embedding examples of perlembed have been reviewed to be up to date and consistent: for example, the correct use of PERL_SYS_INIT3() and PERL_SYS_TERM().
Extensive reworking of the pad code (the code responsible for lexical variables) has been conducted by Dave Mitchell.
Extensive work on the v-strings by John Peacock.
UTF-8 length and position cache: to speed up the handling of Unicode (UTF-8) scalars, a cache was introduced. Potential problems exist if an extension bypasses the official APIs and directly modifies the PV of an SV: the UTF-8 cache does not get cleared as it should.
APIs obsoleted in Perl 5.8.0, like sv_2pv, sv_catpvn, sv_catsv, sv_setsv, are again available.
Certain Perl core C APIs like cxinc and regatom are no longer available at all to code outside the Perl core of the Perl core extensions. This is intentional. They never should have been available with the shorter names, and if you application depends on them, you should (be ashamed and) contact perl5-porters to discuss what are the proper APIs.
Certain Perl core C APIs like Perl_list
are no longer available without their Perl_
prefix. If your XS module stops working because some functions cannot be found, in many cases a simple fix is to add the Perl_
prefix to the function and the thread context aTHX_
as the first argument of the function call. This is also how it should always have been done: letting the Perl_-less forms to leak from the core was an accident. For cleaner embedding you can also force this for all APIs by defining at compile time the cpp define PERL_NO_SHORT_NAMES.
Perl_save_bool() has been added.
Regexp objects (those created with qr
) now have S-magic rather than R-magic. This fixed regexps of the form /...(??{...;$x})/ to no longer ignore changes made to $x. The S-magic avoids dropping the caching optimization and making (??{...}) constructs obscenely slow (and consequently useless). See also "Magic Variables" in perlguts. Regexp::Copy was affected by this change.
The Perl internal debugging macros DEBUG() and DEB() have been renamed to PERL_DEBUG() and PERL_DEB() to avoid namespace conflicts.
-DL
removed (the leaktest had been broken and unsupported for years, use alternative debugging mallocs or tools like valgrind and Purify).
Verbose modifier v
added for -DXv
and -Dsv
, see perlrun.
p581-New Tests
In Perl 5.8.0 there were about 69000 separate tests in about 700 test files, in Perl 5.8.1 there are about 77000 separate tests in about 780 test files. The exact numbers depend on the Perl configuration and on the operating system platform.
p581-Known Problems
The hash randomisation mentioned in "p581-Incompatible Changes" is definitely problematic: it will wake dormant bugs and shake out bad assumptions.
If you want to use mod_perl 2.x with Perl 5.8.1, you will need mod_perl-1.99_10 or higher. Earlier versions of mod_perl 2.x do not work with the randomised hashes. (mod_perl 1.x works fine.) You will also need Apache::Test 1.04 or higher.
Many of the rarer platforms that worked 100% or pretty close to it with perl 5.8.0 have been left a little bit untended since their maintainers have been otherwise busy lately, and therefore there will be more failures on those platforms. Such platforms include Mac OS Classic, IBM z/OS (and other EBCDIC platforms), and NetWare. The most common Perl platforms (Unix and Unix-like, Microsoft platforms, and VMS) have large enough testing and expert population that they are doing well.
p581-Tied hashes in scalar context
Tied hashes do not currently return anything useful in scalar context, for example when used as boolean tests:
if (%tied_hash) { ... }
The current nonsensical behaviour is always to return false, regardless of whether the hash is empty or has elements.
The root cause is that there is no interface for the implementors of tied hashes to implement the behaviour of a hash in scalar context.
p581-Net::Ping 450_service and 510_ping_udp failures
The subtests 9 and 18 of lib/Net/Ping/t/450_service.t, and the subtest 2 of lib/Net/Ping/t/510_ping_udp.t might fail if you have an unusual networking setup. For example in the latter case the test is trying to send a UDP ping to the IP address 127.0.0.1.
p581-B::C
The C-generating compiler backend B::C (the frontend being perlcc -c
) is even more broken than it used to be because of the extensive lexical variable changes. (The good news is that B::Bytecode and ByteLoader are better than they used to be.)
p581-Platform Specific Problems
p581-EBCDIC Platforms
IBM z/OS and other EBCDIC platforms continue to be problematic regarding Unicode support. Many Unicode tests are skipped when they really should be fixed.
p581-Cygwin 1.5 problems
In Cygwin 1.5 the io/tell and op/sysio tests have failures for some yet unknown reason. In 1.5.5 the threads tests stress_cv, stress_re, and stress_string are failing unless the environment variable PERLIO is set to "perlio" (which makes also the io/tell failure go away).
Perl 5.8.1 does build and work well with Cygwin 1.3: with (uname -a) CYGWIN_NT-5.0 ... 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 ...
a 100% "make test" was achieved with Configure -des -Duseithreads
.
p581-HP-UX: HP cc warnings about sendfile and sendpath
With certain HP C compiler releases (e.g. B.11.11.02) you will get many warnings like this (lines wrapped for easier reading):
cc: "/usr/include/sys/socket.h", line 504: warning 562:
Redeclaration of "sendfile" with a different storage class specifier:
"sendfile" will have internal linkage.
cc: "/usr/include/sys/socket.h", line 505: warning 562:
Redeclaration of "sendpath" with a different storage class specifier:
"sendpath" will have internal linkage.
The warnings show up both during the build of Perl and during certain lib/ExtUtils tests that invoke the C compiler. The warning, however, is not serious and can be ignored.
p581-IRIX: t/uni/tr_7jis.t falsely failing
The test t/uni/tr_7jis.t is known to report failure under 'make test' or the test harness with certain releases of IRIX (at least IRIX 6.5 and MIPSpro Compilers Version 7.3.1.1m), but if run manually the test fully passes.
p581-Mac OS X: no usemymalloc
The Perl malloc (-Dusemymalloc
) does not work at all in Mac OS X. This is not that serious, though, since the native malloc works just fine.
p581-Tru64: No threaded builds with GNU cc (gcc)
In the latest Tru64 releases (e.g. v5.1B or later) gcc cannot be used to compile a threaded Perl (-Duseithreads) because the system
file doesn't know about gcc.
p581-Win32: sysopen, sysread, syswrite
As of the 5.8.0 release, sysopen()/sysread()/syswrite() do not behave like they used to in 5.6.1 and earlier with respect to "text" mode. These built-ins now always operate in "binary" mode (even if sysopen() was passed the O_TEXT flag, or if binmode() was used on the file handle). Note that this issue should only make a difference for disk files, as sockets and pipes have always been in "binary" mode in the Windows port. As this behavior is currently considered a bug, compatible behavior may be re-introduced in a future release. Until then, the use of sysopen(), sysread() and syswrite() is not supported for "text" mode operations.
p581-Future Directions
The following things might happen in future. The first publicly available releases having these characteristics will be the developer releases Perl 5.9.x, culminating in the Perl 5.10.0 release. These are our best guesses at the moment: we reserve the right to rethink.
- PerlIO will become The Default. Currently (in Perl 5.8.x) the stdio library is still used if Perl thinks it can use certain tricks to make stdio go really fast. For future releases our goal is to make PerlIO go even faster.
- A new feature called assertions will be available. This means that one can have code called assertions sprinkled in the code: usually they are optimised away, but they can be enabled with the
-A
option.
- A new operator
//
(defined-or) will be available. This means that one will be able to say
$a // $b
instead of
defined $a ? $a : $b
and
$c //= $d;
instead of
$c = $d unless defined $c;
The operator will have the same precedence and associativity as ||
. A source code patch against the Perl 5.8.1 sources will be available in CPAN as authors/id/H/HM/HMBRAND/dor-5.8.1.diff.
unpack()
will default to unpacking the $_
.
- Various Copy-On-Write techniques will be investigated in hopes of speeding up Perl.
- CPANPLUS, Inline, and Module::Build will become core modules.
- The ability to write true lexically scoped pragmas will be introduced.
- Work will continue on the bytecompiler and byteloader.
- v-strings as they currently exist are scheduled to be deprecated. The v-less form (1.2.3) will become a "version object" when used with
use
, require
, and $VERSION
. $^V will also be a "version object" so the printf("%vd",...) construct will no longer be needed. The v-ful version (v1.2.3) will become obsolete. The equivalence of strings and v-strings (e.g. that currently 5.8.0 is equal to "\5\8\0") will go away. There may be no deprecation warning for v-strings, though: it is quite hard to detect when v-strings are being used safely, and when they are not.
- 5.005 Threads Will Be Removed
- The
$*
Variable Will Be Removed (it was deprecated a long time ago)
- Pseudohashes Will Be Removed
p581-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ . There may also be information at http://www.perl.com/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. You can browse and search the Perl 5 bugs at http://bugs.perl.org/
p581-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p58-NAME
perl58delta - what is new for perl v5.8.0
p58-DESCRIPTION
This document describes differences between the 5.6.0 release and the 5.8.0 release.
Many of the bug fixes in 5.8.0 were already seen in the 5.6.1 maintenance release since the two releases were kept closely coordinated (while 5.8.0 was still called 5.7.something).
Changes that were integrated into the 5.6.1 release are marked [561]
. Many of these changes have been further developed since 5.6.1 was released, those are marked [561+]
.
You can see the list of changes in the 5.6.1 release (both from the 5.005_03 release and the 5.6.0 release) by reading "p561-NAME".
p58-Highlights In 5.8.0
- Better Unicode support
- New IO Implementation
- New Thread Implementation
- Better Numeric Accuracy
- Safe Signals
- Many New Modules
- More Extensive Regression Testing
p58-Incompatible Changes
p58-Binary Incompatibility
Perl 5.8 is not binary compatible with earlier releases of Perl.
You have to recompile your XS modules.
(Pure Perl modules should continue to work.)
The major reason for the discontinuity is the new IO architecture called PerlIO. PerlIO is the default configuration because without it many new features of Perl 5.8 cannot be used. In other words: you just have to recompile your modules containing XS code, sorry about that.
In future releases of Perl, non-PerlIO aware XS modules may become completely unsupported. This shouldn't be too difficult for module authors, however: PerlIO has been designed as a drop-in replacement (at the source code level) for the stdio interface.
Depending on your platform, there are also other reasons why we decided to break binary compatibility, please read on.
p58-64-bit platforms and malloc
If your pointers are 64 bits wide, the Perl malloc is no longer being used because it does not work well with 8-byte pointers. Also, usually the system mallocs on such platforms are much better optimized for such large memory models than the Perl malloc. Some memory-hungry Perl applications like the PDL don't work well with Perl's malloc. Finally, other applications than Perl (such as mod_perl) tend to prefer the system malloc. Such platforms include Alpha and 64-bit HPPA, MIPS, PPC, and Sparc.
p58-AIX Dynaloading
The AIX dynaloading now uses in AIX releases 4.3 and newer the native dlopen interface of AIX instead of the old emulated interface. This change will probably break backward compatibility with compiled modules. The change was made to make Perl more compliant with other applications like mod_perl which are using the AIX native interface.
p58-Attributes for my
variables now handled at run-time
The my EXPR : ATTRS
syntax now applies variable attributes at run-time. (Subroutine and our
variables still get attributes applied at compile-time.) See attributes for additional details. In particular, however, this allows variable attributes to be useful for tie
interfaces, which was a deficiency of earlier releases. Note that the new semantics doesn't work with the Attribute::Handlers module (as of version 0.76).
p58-Socket Extension Dynamic in VMS
The Socket extension is now dynamically loaded instead of being statically built in. This may or may not be a problem with ancient TCP/IP stacks of VMS: we do not know since we weren't able to test Perl in such configurations.
p58-IEEE-format Floating Point Default on OpenVMS Alpha
Perl now uses IEEE format (T_FLOAT) as the default internal floating point format on OpenVMS Alpha, potentially breaking binary compatibility with external libraries or existing data. G_FLOAT is still available as a configuration option. The default on VAX (D_FLOAT) has not changed.
p58-New Unicode Semantics (no more use utf8
, almost)
Previously in Perl 5.6 to use Unicode one would say "use utf8" and then the operations (like string concatenation) were Unicode-aware in that lexical scope.
This was found to be an inconvenient interface, and in Perl 5.8 the Unicode model has completely changed: now the "Unicodeness" is bound to the data itself, and for most of the time "use utf8" is not needed at all. The only remaining use of "use utf8" is when the Perl script itself has been written in the UTF-8 encoding of Unicode. (UTF-8 has not been made the default since there are many Perl scripts out there that are using various national eight-bit character sets, which would be illegal in UTF-8.)
See perluniintro for the explanation of the current model, and utf8 for the current use of the utf8 pragma.
p58-New Unicode Properties
Unicode scripts are now supported. Scripts are similar to (and superior to) Unicode blocks. The difference between scripts and blocks is that scripts are the glyphs used by a language or a group of languages, while the blocks are more artificial groupings of (mostly) 256 characters based on the Unicode numbering.
In general, scripts are more inclusive, but not universally so. For example, while the script Latin
includes all the Latin characters and their various diacritic-adorned versions, it does not include the various punctuation or digits (since they are not solely Latin
).
A number of other properties are now supported, including \p{L&}
, \p{Any}
\p{Assigned}
, \p{Unassigned}
, \p{Blank}
[561] and \p{SpacePerl}
[561] (along with their \P{...}
versions, of course). See perlunicode for details, and more additions.
The In
or Is
prefix to names used with the \p{...}
and \P{...}
are now almost always optional. The only exception is that a In
prefix is required to signify a Unicode block when a block name conflicts with a script name. For example, \p{Tibetan}
refers to the script, while \p{InTibetan}
refers to the block. When there is no name conflict, you can omit the In
from the block name (e.g. \p{BraillePatterns}
), but to be safe, it's probably best to always use the In
).
p58-REF(...) Instead Of SCALAR(...)
A reference to a reference now stringifies as "REF(0x81485ec)" instead of "SCALAR(0x81485ec)" in order to be more consistent with the return value of ref().
p58-pack/unpack D/F recycled
The undocumented pack/unpack template letters D/F have been recycled for better use: now they stand for long double (if supported by the platform) and NV (Perl internal floating point type). (They used to be aliases for d/f, but you never knew that.)
p58-glob() now returns filenames in alphabetical order
The list of filenames from glob() (or <...>) is now by default sorted alphabetically to be csh-compliant (which is what happened before in most Unix platforms). (bsd_glob() does still sort platform natively, ASCII or EBCDIC, unless GLOB_ALPHASORT is specified.) [561]
p58-Deprecations
- The semantics of bless(REF, REF) were unclear and until someone proves it to make some sense, it is forbidden.
- The obsolete chat2 library that should never have been allowed to escape the laboratory has been decommissioned.
- Using chdir("") or chdir(undef) instead of explicit chdir() is doubtful. A failure (think chdir(some_function()) can lead into unintended chdir() to the home directory, therefore this behaviour is deprecated.
- The builtin dump() function has probably outlived most of its usefulness. The core-dumping functionality will remain in future available as an explicit call to
CORE::dump()
, but in future releases the behaviour of an unqualified dump()
call may change.
- The very dusty examples in the eg/ directory have been removed. Suggestions for new shiny examples welcome but the main issue is that the examples need to be documented, tested and (most importantly) maintained.
- The (bogus) escape sequences \8 and \9 now give an optional warning ("Unrecognized escape passed through"). There is no need to \-escape any
\w
character.
- The *glob{FILEHANDLE} is deprecated, use *glob{IO} instead.
- The
package;
syntax (package
without an argument) has been deprecated. Its semantics were never that clear and its implementation even less so. If you have used that feature to disallow all but fully qualified variables, use strict;
instead.
- The unimplemented POSIX regex features [[.cc.]] and [[=c=]] are still recognised but now cause fatal errors. The previous behaviour of ignoring them by default and warning if requested was unacceptable since it, in a way, falsely promised that the features could be used.
- In future releases, non-PerlIO aware XS modules may become completely unsupported. Since PerlIO is a drop-in replacement for stdio at the source code level, this shouldn't be that drastic a change.
- Previous versions of perl and some readings of some sections of Camel III implied that the
:raw
"discipline" was the inverse of :crlf
. Turning off "clrfness" is no longer enough to make a stream truly binary. So the PerlIO :raw
layer (or "discipline", to use the Camel book's older terminology) is now formally defined as being equivalent to binmode(FH) - which is in turn defined as doing whatever is necessary to pass each byte as-is without any translation. In particular binmode(FH) - and hence :raw
- will now turn off both CRLF and UTF-8 translation and remove other layers (e.g. :encoding()) which would modify byte stream.
- The current user-visible implementation of pseudo-hashes (the weird use of the first array element) is deprecated starting from Perl 5.8.0 and will be removed in Perl 5.10.0, and the feature will be implemented differently. Not only is the current interface rather ugly, but the current implementation slows down normal array and hash use quite noticeably. The
fields
pragma interface will remain available. The restricted hashes interface is expected to be the replacement interface (see Hash::Util). If your existing programs depends on the underlying implementation, consider using Class::PseudoHash from CPAN.
- The syntaxes
@a->[...]
and %h->{...}
have now been deprecated.
- After years of trying, suidperl is considered to be too complex to ever be considered truly secure. The suidperl functionality is likely to be removed in a future release.
- The 5.005 threads model (module
Thread
) is deprecated and expected to be removed in Perl 5.10. Multithreaded code should be migrated to the new ithreads model (see threads, threads::shared and perlthrtut).
- The long deprecated uppercase aliases for the string comparison operators (EQ, NE, LT, LE, GE, GT) have now been removed.
- The tr///C and tr///U features have been removed and will not return; the interface was a mistake. Sorry about that. For similar functionality, see pack('U0', ...) and pack('C0', ...). [561]
- Earlier Perls treated "sub foo (@bar)" as equivalent to "sub foo (@)". The prototypes are now checked better at compile-time for invalid syntax. An optional warning is generated ("Illegal character in prototype...") but this may be upgraded to a fatal error in a future release.
- The
exec LIST
and system LIST
operations now produce warnings on tainted data and in some future release they will produce fatal errors.
- The existing behaviour when localising tied arrays and hashes is wrong, and will be changed in a future release, so do not rely on the existing behaviour. See "p58-Localising Tied Arrays and Hashes Is Broken".
p58-Core Enhancements
p58-Unicode Overhaul
Unicode in general should be now much more usable than in Perl 5.6.0 (or even in 5.6.1). Unicode can be used in hash keys, Unicode in regular expressions should work now, Unicode in tr/// should work now, Unicode in I/O should work now. See perluniintro for introduction and perlunicode for details.
- The Unicode Character Database coming with Perl has been upgraded to Unicode 3.2.0. For more information, see http://www.unicode.org/ . [561+] (5.6.1 has UCD 3.0.1.)
- For developers interested in enhancing Perl's Unicode capabilities: almost all the UCD files are included with the Perl distribution in the lib/unicore subdirectory. The most notable omission, for space considerations, is the Unihan database.
- The properties \p{Blank} and \p{SpacePerl} have been added. "Blank" is like C isblank(), that is, it contains only "horizontal whitespace" (the space character is, the newline isn't), and the "SpacePerl" is the Unicode equivalent of
\s
(\p{Space} isn't, since that includes the vertical tabulator character, whereas \s
doesn't.)
See "New Unicode Properties" earlier in this document for additional information on changes with Unicode properties.
p58-PerlIO is Now The Default
- IO is now by default done via PerlIO rather than system's "stdio". PerlIO allows "layers" to be "pushed" onto a file handle to alter the handle's behaviour. Layers can be specified at open time via 3-arg form of open:
open($fh,'>:crlf :utf8', $path) || ...
or on already opened handles via extended binmode
:
binmode($fh,':encoding(iso-8859-7)');
The built-in layers are: unix (low level read/write), stdio (as in previous Perls), perlio (re-implementation of stdio buffering in a portable manner), crlf (does CRLF <=> "\n" translation as on Win32, but available on any platform). A mmap layer may be available if platform supports it (mostly Unixes).
Layers to be applied by default may be specified via the 'open' pragma.
See "p58-Installation and Configuration Improvements" for the effects of PerlIO on your architecture name.
- If your platform supports fork(), you can use the list form of
open
for pipes. For example:
open KID_PS, "-|", "ps", "aux" or die $!;
forks the ps(1) command (without spawning a shell, as there are more than three arguments to open()), and reads its standard output via the KID_PS
filehandle. See perlipc.
- File handles can be marked as accepting Perl's internal encoding of Unicode (UTF-8 or UTF-EBCDIC depending on platform) by a pseudo layer ":utf8" :
open($fh,">:utf8","Uni.txt");
Note for EBCDIC users: the pseudo layer ":utf8" is erroneously named for you since it's not UTF-8 what you will be getting but instead UTF-EBCDIC. See perlunicode, utf8, and http://www.unicode.org/unicode/reports/tr16/ for more information. In future releases this naming may change. See perluniintro for more information about UTF-8.
- If your environment variables (LC_ALL, LC_CTYPE, LANG) look like you want to use UTF-8 (any of the variables match
/utf-?8/i
), your STDIN, STDOUT, STDERR handles and the default open layer (see open) are marked as UTF-8. (This feature, like other new features that combine Unicode and I/O, work only if you are using PerlIO, but that's the default.)
Note that after this Perl really does assume that everything is UTF-8: for example if some input handle is not, Perl will probably very soon complain about the input data like this "Malformed UTF-8 ..." since any old eight-bit data is not legal UTF-8.
Note for code authors: if you want to enable your users to use UTF-8 as their default encoding but in your code still have eight-bit I/O streams (such as images or zip files), you need to explicitly open() or binmode() with :bytes
(see "open" in perlfunc and "binmode" in perlfunc), or you can just use binmode(FH)
(nice for pre-5.8.0 backward compatibility).
- File handles can translate character encodings from/to Perl's internal Unicode form on read/write via the ":encoding()" layer.
- File handles can be opened to "in memory" files held in Perl scalars via:
open($fh,'>', \$variable) || ...
- Anonymous temporary files are available without need to 'use FileHandle' or other module via
open($fh,"+>", undef) || ...
That is a literal undef, not an undefined value.
p58-ithreads
The new interpreter threads ("ithreads" for short) implementation of multithreading, by Arthur Bergman, replaces the old "5.005 threads" implementation. In the ithreads model any data sharing between threads must be explicit, as opposed to the model where data sharing was implicit. See threads and threads::shared, and perlthrtut.
As a part of the ithreads implementation Perl will also use any necessary and detectable reentrant libc interfaces.
p58-Restricted Hashes
A restricted hash is restricted to a certain set of keys, no keys outside the set can be added. Also individual keys can be restricted so that the key cannot be deleted and the value cannot be changed. No new syntax is involved: the Hash::Util module is the interface.
p58-Safe Signals
Perl used to be fragile in that signals arriving at inopportune moments could corrupt Perl's internal state. Now Perl postpones handling of signals until it's safe (between opcodes).
This change may have surprising side effects because signals no longer interrupt Perl instantly. Perl will now first finish whatever it was doing, like finishing an internal operation (like sort()) or an external operation (like an I/O operation), and only then look at any arrived signals (and before starting the next operation). No more corrupt internal state since the current operation is always finished first, but the signal may take more time to get heard. Note that breaking out from potentially blocking operations should still work, though.
p58-Understanding of Numbers
In general a lot of fixing has happened in the area of Perl's understanding of numbers, both integer and floating point. Since in many systems the standard number parsing functions like strtoul()
and atof()
seem to have bugs, Perl tries to work around their deficiencies. This results hopefully in more accurate numbers.
Perl now tries internally to use integer values in numeric conversions and basic arithmetics (+ - * /) if the arguments are integers, and tries also to keep the results stored internally as integers. This change leads to often slightly faster and always less lossy arithmetics. (Previously Perl always preferred floating point numbers in its math.)
p58-Arrays now always interpolate into double-quoted strings [561]
In double-quoted strings, arrays now interpolate, no matter what. The behavior in earlier versions of perl 5 was that arrays would interpolate into strings if the array had been mentioned before the string was compiled, and otherwise Perl would raise a fatal compile-time error. In versions 5.000 through 5.003, the error was
Literal @example now requires backslash
In versions 5.004_01 through 5.6.0, the error was
In string, @example now must be written as \@example
The idea here was to get people into the habit of writing "fred\@example.com"
when they wanted a literal @
sign, just as they have always written "Give me back my \$5"
when they wanted a literal $
sign.
Starting with 5.6.1, when Perl now sees an @
sign in a double-quoted string, it always attempts to interpolate an array, regardless of whether or not the array has been used or declared already. The fatal error has been downgraded to an optional warning:
Possible unintended interpolation of @example in string
This warns you that "fred@example.com"
is going to turn into fred.com
if you don't backslash the @
. See http://perl.plover.com/at-error.html for more details about the history here.
p58-Miscellaneous Changes
- AUTOLOAD is now lvaluable, meaning that you can add the :lvalue attribute to AUTOLOAD subroutines and you can assign to the AUTOLOAD return value.
- The $Config{byteorder} (and corresponding BYTEORDER in config.h) was previously wrong in platforms if sizeof(long) was 4, but sizeof(IV) was 8. The byteorder was only sizeof(long) bytes long (1234 or 4321), but now it is correctly sizeof(IV) bytes long, (12345678 or 87654321). (This problem didn't affect Windows platforms.)
Also, $Config{byteorder} is now computed dynamically--this is more robust with "fat binaries" where an executable image contains binaries for more than one binary platform, and when cross-compiling.
perl -d:Module=arg,arg,arg
now works (previously one couldn't pass in multiple arguments.)
do
followed by a bareword now ensures that this bareword isn't a keyword (to avoid a bug where do q(foo.pl)
tried to call a subroutine called q
). This means that for example instead of do format()
you must write do &format()
.
- The builtin dump() now gives an optional warning
dump() better written as CORE::dump()
, meaning that by default dump(...)
is resolved as the builtin dump() which dumps core and aborts, not as (possibly) user-defined sub dump
. To call the latter, qualify the call as &dump(...)
. (The whole dump() feature is to considered deprecated, and possibly removed/changed in future releases.)
- chomp() and chop() are now overridable. Note, however, that their prototype (as given by
prototype("CORE::chomp")
is undefined, because it cannot be expressed and therefore one cannot really write replacements to override these builtins.
- END blocks are now run even if you exit/die in a BEGIN block. Internally, the execution of END blocks is now controlled by PL_exit_flags & PERL_EXIT_DESTRUCT_END. This enables the new behaviour for Perl embedders. This will default in 5.10. See perlembed.
- Formats now support zero-padded decimal fields.
- Although "you shouldn't do that", it was possible to write code that depends on Perl's hashed key order (Data::Dumper does this). The new algorithm "One-at-a-Time" produces a different hashed key order. More details are in "p58-Performance Enhancements".
- lstat(FILEHANDLE) now gives a warning because the operation makes no sense. In future releases this may become a fatal error.
- Spurious syntax errors generated in certain situations, when glob() caused File::Glob to be loaded for the first time, have been fixed. [561]
- Lvalue subroutines can now return
undef
in list context. However, the lvalue subroutine feature still remains experimental. [561+]
- A lost warning "Can't declare ... dereference in my" has been restored (Perl had it earlier but it became lost in later releases.)
- A new special regular expression variable has been introduced:
$^N
, which contains the most-recently closed group (submatch).
no Module;
does not produce an error even if Module does not have an unimport() method. This parallels the behavior of use
vis-a-vis import
. [561]
- The numerical comparison operators return
undef
if either operand is a NaN. Previously the behaviour was unspecified.
our
can now have an experimental optional attribute unique
that affects how global variables are shared among multiple interpreters, see "our" in perlfunc.
- The following builtin functions are now overridable: each(), keys(), pop(), push(), shift(), splice(), unshift(). [561]
pack() / unpack()
can now group template letters with ()
and then apply repetition/count modifiers on the groups.
pack() / unpack()
can now process the Perl internal numeric types: IVs, UVs, NVs-- and also long doubles, if supported by the platform. The template letters are j
, J
, F
, and D
.
pack('U0a*', ...)
can now be used to force a string to UTF-8.
- my __PACKAGE__ $obj now works. [561]
- POSIX::sleep() now returns the number of unslept seconds (as the POSIX standard says), as opposed to CORE::sleep() which returns the number of slept seconds.
- printf() and sprintf() now support parameter reordering using the
%\d+\$
and *\d+\$
syntaxes. For example
printf "%2\$s %1\$s\n", "foo", "bar";
will print "bar foo\n". This feature helps in writing internationalised software, and in general when the order of the parameters can vary.
- The (\&) prototype now works properly. [561]
- prototype(\[$@%&]) is now available to implicitly create references (useful for example if you want to emulate the tie() interface).
- A new command-line option,
-t
is available. It is the little brother of -T
: instead of dying on taint violations, lexical warnings are given. This is only meant as a temporary debugging aid while securing the code of old legacy applications. This is not a substitute for -T.
- In other taint news, the
exec LIST
and system LIST
have now been considered too risky (think exec @ARGV
: it can start any program with any arguments), and now the said forms cause a warning under lexical warnings. You should carefully launder the arguments to guarantee their validity. In future releases of Perl the forms will become fatal errors so consider starting laundering now.
- Tied hash interfaces are now required to have the EXISTS and DELETE methods (either own or inherited).
- If tr/// is just counting characters, it doesn't attempt to modify its target.
- untie() will now call an UNTIE() hook if it exists. See perltie for details. [561]
- utime now supports
utime undef, undef, @files
to change the file timestamps to the current time.
- The rules for allowing underscores (underbars) in numeric constants have been relaxed and simplified: now you can have an underscore simply between digits.
- Rather than relying on C's argv[0] (which may not contain a full pathname) where possible $^X is now set by asking the operating system. (eg by reading /proc/self/exe on Linux, /proc/curproc/file on FreeBSD)
- A new variable,
${^TAINT}
, indicates whether taint mode is enabled.
- You can now override the readline() builtin, and this overrides also the
angle bracket operator.
- The command-line options -s and -F are now recognized on the shebang (#!) line.
- Use of the
/c
match modifier without an accompanying /g
modifier elicits a new warning: Use of /c modifier is meaningless without /g
.
Use of /c
in substitutions, even with /g
, elicits Use of /c modifier is meaningless in s///
.
Use of /g
with split
elicits Use of /g modifier is meaningless in split
.
- Support for the
CLONE
special subroutine had been added. With ithreads, when a new thread is created, all Perl data is cloned, however non-Perl data cannot be cloned automatically. In CLONE
you can do whatever you need to do, like for example handle the cloning of non-Perl data, if necessary. CLONE
will be executed once for every package that has it defined or inherited. It will be called in the context of the new thread, so all modifications are made in the new area.
See perlmod
p58-Modules and Pragmata
p58-New Modules and Pragmata
Attribute::Handlers
, originally by Damian Conway and now maintained by Arthur Bergman, allows a class to define attribute handlers.
package MyPack;
use Attribute::Handlers;
sub Wolf :ATTR(SCALAR) { print "howl!\n" }
# later, in some package using or inheriting from MyPack...
my MyPack $Fluffy : Wolf; # the attribute handler Wolf will be called
Both variables and routines can have attribute handlers. Handlers can be specific to type (SCALAR, ARRAY, HASH, or CODE), or specific to the exact compilation phase (BEGIN, CHECK, INIT, or END). See Attribute::Handlers.
B::Concise
, by Stephen McCamant, is a new compiler backend for walking the Perl syntax tree, printing concise info about ops. The output is highly customisable. See B::Concise. [561+]
- The new bignum, bigint, and bigrat pragmas, by Tels, implement transparent bignum support (using the Math::BigInt, Math::BigFloat, and Math::BigRat backends).
Class::ISA
, by Sean Burke, is a module for reporting the search path for a class's ISA tree. See Class::ISA.
Cwd
now has a split personality: if possible, an XS extension is used, (this will hopefully be faster, more secure, and more robust) but if not possible, the familiar Perl implementation is used.
Devel::PPPort
, originally by Kenneth Albanowski and now maintained by Paul Marquess, has been added. It is primarily used by h2xs
to enhance portability of XS modules between different versions of Perl. See Devel::PPPort.
Digest
, frontend module for calculating digests (checksums), from Gisle Aas, has been added. See Digest.
Digest::MD5
for calculating MD5 digests (checksums) as defined in RFC 1321, from Gisle Aas, has been added. See Digest::MD5.
use Digest::MD5 'md5_hex';
$digest = md5_hex("Thirsty Camel");
print $digest, "\n"; # 01d19d9d2045e005c3f1b80e8b164de1
NOTE: the MD5
backward compatibility module is deliberately not included since its further use is discouraged.
See also PerlIO::via::QuotedPrint.
Encode
, originally by Nick Ing-Simmons and now maintained by Dan Kogai, provides a mechanism to translate between different character encodings. Support for Unicode, ISO-8859-1, and ASCII are compiled in to the module. Several other encodings (like the rest of the ISO-8859, CP*/Win*, Mac, KOI8-R, three variants EBCDIC, Chinese, Japanese, and Korean encodings) are included and can be loaded at runtime. (For space considerations, the largest Chinese encodings have been separated into their own CPAN module, Encode::HanExtra, which Encode will use if available). See Encode.
Any encoding supported by Encode module is also available to the ":encoding()" layer if PerlIO is used.
Hash::Util
is the interface to the new restricted hashes feature. (Implemented by Jeffrey Friedl, Nick Ing-Simmons, and Michael Schwern.) See Hash::Util.
I18N::Langinfo
can be used to query locale information. See I18N::Langinfo.
I18N::LangTags
, by Sean Burke, has functions for dealing with RFC3066-style language tags. See I18N::LangTags.
ExtUtils::Constant
, by Nicholas Clark, is a new tool for extension writers for generating XS code to import C header constants. See ExtUtils::Constant.
Filter::Simple
, by Damian Conway, is an easy-to-use frontend to Filter::Util::Call. See Filter::Simple.
# in MyFilter.pm:
package MyFilter;
use Filter::Simple sub {
while (my ($from, $to) = splice @_, 0, 2) {
s/$from/$to/g;
}
};
1;
# in user's code:
use MyFilter qr/red/ => 'green';
print "red\n"; # this code is filtered, will print "green\n"
print "bored\n"; # this code is filtered, will print "bogreen\n"
no MyFilter;
print "red\n"; # this code is not filtered, will print "red\n"
File::Temp
, by Tim Jenness, allows one to create temporary files and directories in an easy, portable, and secure way. See File::Temp. [561+]
Filter::Util::Call
, by Paul Marquess, provides you with the framework to write source filters in Perl. For most uses, the frontend Filter::Simple is to be preferred. See Filter::Util::Call.
if
, by Ilya Zakharevich, is a new pragma for conditional inclusion of modules.
- libnet, by Graham Barr, is a collection of perl5 modules related to network programming. See Net::FTP, Net::NNTP, Net::Ping (not part of libnet, but related), Net::POP3, Net::SMTP, and Net::Time.
Perl installation leaves libnet unconfigured; use libnetcfg to configure it.
List::Util
, by Graham Barr, is a selection of general-utility list subroutines, such as sum(), min(), first(), and shuffle(). See List::Util.
Locale::Constants
, Locale::Country
, Locale::Currency
Locale::Language
, and Locale::Script, by Neil Bowers, have been added. They provide the codes for various locale standards, such as "fr" for France, "usd" for US Dollar, and "ja" for Japanese.
use Locale::Country;
$country = code2country('jp'); # $country gets 'Japan'
$code = country2code('Norway'); # $code gets 'no'
See Locale::Constants, Locale::Country, Locale::Currency, and Locale::Language.
Locale::Maketext
, by Sean Burke, is a localization framework. See Locale::Maketext, and Locale::Maketext::TPJ13. The latter is an article about software localization, originally published in The Perl Journal #13, and republished here with kind permission.
Math::BigRat
for big rational numbers, to accompany Math::BigInt and Math::BigFloat, from Tels. See Math::BigRat.
Memoize
can make your functions faster by trading space for time, from Mark-Jason Dominus. See Memoize.
MIME::Base64
, by Gisle Aas, allows you to encode data in base64, as defined in RFC 2045 - MIME (Multipurpose Internet Mail Extensions).
use MIME::Base64;
$encoded = encode_base64('Aladdin:open sesame');
$decoded = decode_base64($encoded);
print $encoded, "\n"; # "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
See MIME::Base64.
MIME::QuotedPrint
, by Gisle Aas, allows you to encode data in quoted-printable encoding, as defined in RFC 2045 - MIME (Multipurpose Internet Mail Extensions).
use MIME::QuotedPrint;
$encoded = encode_qp("\xDE\xAD\xBE\xEF");
$decoded = decode_qp($encoded);
print $encoded, "\n"; # "=DE=AD=BE=EF\n"
print $decoded, "\n"; # "\xDE\xAD\xBE\xEF\n"
See also PerlIO::via::QuotedPrint.
NEXT
, by Damian Conway, is a pseudo-class for method redispatch. See NEXT.
open
is a new pragma for setting the default I/O layers for open().
PerlIO::scalar
, by Nick Ing-Simmons, provides the implementation of IO to "in memory" Perl scalars as discussed above. It also serves as an example of a loadable PerlIO layer. Other future possibilities include PerlIO::Array and PerlIO::Code. See PerlIO::scalar.
PerlIO::via
, by Nick Ing-Simmons, acts as a PerlIO layer and wraps PerlIO layer functionality provided by a class (typically implemented in Perl code).
PerlIO::via::QuotedPrint
, by Elizabeth Mattijsen, is an example of a PerlIO::via
class:
use PerlIO::via::QuotedPrint;
open($fh,">:via(QuotedPrint)",$path);
This will automatically convert everything output to $fh
to Quoted-Printable. See PerlIO::via and PerlIO::via::QuotedPrint.
Pod::ParseLink
, by Russ Allbery, has been added, to parse L<> links in pods as described in the new perlpodspec.
Pod::Text::Overstrike
, by Joe Smith, has been added. It converts POD data to formatted overstrike text. See Pod::Text::Overstrike. [561+]
Scalar::Util
is a selection of general-utility scalar subroutines, such as blessed(), reftype(), and tainted(). See Scalar::Util.
sort
is a new pragma for controlling the behaviour of sort().
Storable
gives persistence to Perl data structures by allowing the storage and retrieval of Perl data to and from files in a fast and compact binary format. Because in effect Storable does serialisation of Perl data structures, with it you can also clone deep, hierarchical datastructures. Storable was originally created by Raphael Manfredi, but it is now maintained by Abhijit Menon-Sen. Storable has been enhanced to understand the two new hash features, Unicode keys and restricted hashes. See Storable.
Switch
, by Damian Conway, has been added. Just by saying
use Switch;
you have switch
and case
available in Perl.
use Switch;
switch ($val) {
case 1 { print "number 1" }
case "a" { print "string a" }
case [1..10,42] { print "number in list" }
case (@array) { print "number in list" }
case /\w+/ { print "pattern" }
case qr/\w+/ { print "pattern" }
case (%hash) { print "entry in hash" }
case (\%hash) { print "entry in hash" }
case (\&sub) { print "arg to subroutine" }
else { print "previous case not true" }
}
See Switch.
Test::More
, by Michael Schwern, is yet another framework for writing test scripts, more extensive than Test::Simple. See Test::More.
Test::Simple
, by Michael Schwern, has basic utilities for writing tests. See Test::Simple.
Text::Balanced
, by Damian Conway, has been added, for extracting delimited text sequences from strings.
use Text::Balanced 'extract_delimited';
($a, $b) = extract_delimited("'never say never', he never said", "'", '');
$a will be "'never say never'", $b will be ', he never said'.
In addition to extract_delimited(), there are also extract_bracketed(), extract_quotelike(), extract_codeblock(), extract_variable(), extract_tagged(), extract_multiple(), gen_delimited_pat(), and gen_extract_tagged(). With these, you can implement rather advanced parsing algorithms. See Text::Balanced.
threads
, by Arthur Bergman, is an interface to interpreter threads. Interpreter threads (ithreads) is the new thread model introduced in Perl 5.6 but only available as an internal interface for extension writers (and for Win32 Perl for fork()
emulation). See threads, threads::shared, and perlthrtut.
threads::shared
, by Arthur Bergman, allows data sharing for interpreter threads. See threads::shared.
Tie::File
, by Mark-Jason Dominus, associates a Perl array with the lines of a file. See Tie::File.
Tie::Memoize
, by Ilya Zakharevich, provides on-demand loaded hashes. See Tie::Memoize.
Tie::RefHash::Nestable
, by Edward Avis, allows storing hash references (unlike the standard Tie::RefHash) The module is contained within Tie::RefHash. See Tie::RefHash.
Time::HiRes
, by Douglas E. Wegscheid, provides high resolution timing (ualarm, usleep, and gettimeofday). See Time::HiRes.
Unicode::UCD
offers a querying interface to the Unicode Character Database. See Unicode::UCD.
Unicode::Collate
, by SADAHIRO Tomoyuki, implements the UCA (Unicode Collation Algorithm) for sorting Unicode strings. See Unicode::Collate.
Unicode::Normalize
, by SADAHIRO Tomoyuki, implements the various Unicode normalization forms. See Unicode::Normalize.
XS::APItest
, by Tim Jenness, is a test extension that exercises XS APIs. Currently only printf()
is tested: how to output various basic data types from XS.
XS::Typemap
, by Tim Jenness, is a test extension that exercises XS typemaps. Nothing gets installed, but the code is worth studying for extension writers.
p58-Updated And Improved Modules and Pragmata
- The following independently supported modules have been updated to the newest versions from CPAN: CGI, CPAN, DB_File, File::Spec, File::Temp, Getopt::Long, Math::BigFloat, Math::BigInt, the podlators bundle (Pod::Man, Pod::Text), Pod::LaTeX [561+], Pod::Parser, Storable, Term::ANSIColor, Test, Text-Tabs+Wrap.
- attributes::reftype() now works on tied arguments.
- AutoLoader can now be disabled with
no AutoLoader;
.
- B::Deparse has been significantly enhanced by Robin Houston. It can now deparse almost all of the standard test suite (so that the tests still succeed). There is a make target "test.deparse" for trying this out.
- Carp now has better interface documentation, and the @CARP_NOT interface has been added to get optional control over where errors are reported independently of @ISA, by Ben Tilly.
- Class::Struct can now define the classes in compile time.
- Class::Struct now assigns the array/hash element if the accessor is called with an array/hash element as the sole argument.
- The return value of Cwd::fastcwd() is now tainted.
- Data::Dumper now has an option to sort hashes.
- Data::Dumper now has an option to dump code references using B::Deparse.
- DB_File now supports newer Berkeley DB versions, among other improvements.
- Devel::Peek now has an interface for the Perl memory statistics (this works only if you are using perl's malloc, and if you have compiled with debugging).
- The English module can now be used without the infamous performance hit by saying
use English '-no_match_vars';
(Assuming, of course, that you don't need the troublesome variables $`
, $&
, or $'
.) Also, introduced @LAST_MATCH_START
and @LAST_MATCH_END
English aliases for @-
and @+
.
- ExtUtils::MakeMaker has been significantly cleaned up and fixed. The enhanced version has also been backported to earlier releases of Perl and submitted to CPAN so that the earlier releases can enjoy the fixes.
- The arguments of WriteMakefile() in Makefile.PL are now checked for sanity much more carefully than before. This may cause new warnings when modules are being installed. See ExtUtils::MakeMaker for more details.
- ExtUtils::MakeMaker now uses File::Spec internally, which hopefully leads to better portability.
- Fcntl, Socket, and Sys::Syslog have been rewritten by Nicholas Clark to use the new-style constant dispatch section (see ExtUtils::Constant). This means that they will be more robust and hopefully faster.
- File::Find now chdir()s correctly when chasing symbolic links. [561]
- File::Find now has pre- and post-processing callbacks. It also correctly changes directories when chasing symbolic links. Callbacks (naughtily) exiting with "next;" instead of "return;" now work.
- File::Find is now (again) reentrant. It also has been made more portable.
- The warnings issued by File::Find now belong to their own category. You can enable/disable them with
use/no warnings 'File::Find';
.
- File::Glob::glob() has been renamed to File::Glob::bsd_glob() because the name clashes with the builtin glob(). The older name is still available for compatibility, but is deprecated. [561]
- File::Glob now supports
GLOB_LIMIT
constant to limit the size of the returned list of filenames.
- IPC::Open3 now allows the use of numeric file descriptors.
- IO::Socket now has an atmark() method, which returns true if the socket is positioned at the out-of-band mark. The method is also exportable as a sockatmark() function.
- IO::Socket::INET failed to open the specified port if the service name was not known. It now correctly uses the supplied port number as is. [561]
- IO::Socket::INET has support for the ReusePort option (if your platform supports it). The Reuse option now has an alias, ReuseAddr. For clarity, you may want to prefer ReuseAddr.
- IO::Socket::INET now supports a value of zero for
LocalPort
(usually meaning that the operating system will make one up.)
- 'use lib' now works identically to @INC. Removing directories with 'no lib' now works.
- Math::BigFloat and Math::BigInt have undergone a full rewrite by Tels. They are now magnitudes faster, and they support various bignum libraries such as GMP and PARI as their backends.
- Math::Complex handles inf, NaN etc., better.
- Net::Ping has been considerably enhanced by Rob Brown: multihoming is now supported, Win32 functionality is better, there is now time measuring functionality (optionally high-resolution using Time::HiRes), and there is now "external" protocol which uses Net::Ping::External module which runs your external ping utility and parses the output. A version of Net::Ping::External is available in CPAN.
Note that some of the Net::Ping tests are disabled when running under the Perl distribution since one cannot assume one or more of the following: enabled echo port at localhost, full Internet connectivity, or sympathetic firewalls. You can set the environment variable PERL_TEST_Net_Ping to "1" (one) before running the Perl test suite to enable all the Net::Ping tests.
- POSIX::sigaction() is now much more flexible and robust. You can now install coderef handlers, 'DEFAULT', and 'IGNORE' handlers, installing new handlers was not atomic.
- In Safe,
%INC
is now localised in a Safe compartment so that use/require work.
- In SDBM_File on dosish platforms, some keys went missing because of lack of support for files with "holes". A workaround for the problem has been added.
- In Search::Dict one can now have a pre-processing hook for the lines being searched.
- The Shell module now has an OO interface.
- In Sys::Syslog there is now a failover mechanism that will go through alternative connection mechanisms until the message is successfully logged.
- The Test module has been significantly enhanced.
- Time::Local::timelocal() does not handle fractional seconds anymore. The rationale is that neither does localtime(), and timelocal() and localtime() are supposed to be inverses of each other.
- The vars pragma now supports declaring fully qualified variables. (Something that
our()
does not and will not support.)
- The
utf8::
name space (as in the pragma) provides various Perl-callable functions to provide low level access to Perl's internal Unicode representation. At the moment only length() has been implemented.
p58-Utility Changes
- Emacs perl mode (emacs/cperl-mode.el) has been updated to version 4.31.
- emacs/e2ctags.pl is now much faster.
enc2xs
is a tool for people adding their own encodings to the Encode module.
h2ph
now supports C trigraphs.
h2xs
now produces a template README.
h2xs
now uses Devel::PPPort
for better portability between different versions of Perl.
h2xs
uses the new ExtUtils::Constant module which will affect newly created extensions that define constants. Since the new code is more correct (if you have two constants where the first one is a prefix of the second one, the first constant never got defined), less lossy (it uses integers for integer constant, as opposed to the old code that used floating point numbers even for integer constants), and slightly faster, you might want to consider regenerating your extension code (the new scheme makes regenerating easy). h2xs now also supports C trigraphs.
libnetcfg
has been added to configure libnet.
perlbug
is now much more robust. It also sends the bug report to perl.org, not perl.com.
perlcc
has been rewritten and its user interface (that is, command line) is much more like that of the Unix C compiler, cc. (The perlbc tools has been removed. Use perlcc -B
instead.) Note that perlcc is still considered very experimental and unsupported. [561]
perlivp
is a new Installation Verification Procedure utility for running any time after installing Perl.
piconv
is an implementation of the character conversion utility iconv
, demonstrating the new Encode module.
pod2html
now allows specifying a cache directory.
pod2html
now produces XHTML 1.0.
pod2html
now understands POD written using different line endings (PC-like CRLF versus Unix-like LF versus MacClassic-like CR).
s2p
has been completely rewritten in Perl. (It is in fact a full implementation of sed in Perl: you can use the sed functionality by using the psed
utility.)
xsubpp
now understands POD documentation embedded in the *.xs files. [561]
xsubpp
now supports the OUT keyword.
p58-New Documentation
- perl56delta details the changes between the 5.005 release and the 5.6.0 release.
- perlclib documents the internal replacements for standard C library functions. (Interesting only for extension writers and Perl core hackers.) [561+]
- perldebtut is a Perl debugging tutorial. [561+]
- perlebcdic contains considerations for running Perl on EBCDIC platforms. [561+]
- perlintro is a gentle introduction to Perl.
- perliol documents the internals of PerlIO with layers.
- perlmodstyle is a style guide for writing modules.
- perlnewmod tells about writing and submitting a new module. [561+]
- perlpacktut is a pack() tutorial.
- perlpod has been rewritten to be clearer and to record the best practices gathered over the years.
- perlpodspec is a more formal specification of the pod format, mainly of interest for writers of pod applications, not to people writing in pod.
- perlretut is a regular expression tutorial. [561+]
- perlrequick is a regular expressions quick-start guide. Yes, much quicker than perlretut. [561]
- perltodo has been updated.
- perltootc has been renamed as perltooc (to not to conflict with perltoot in filesystems restricted to "8.3" names).
- perluniintro is an introduction to using Unicode in Perl. (perlunicode is more of a detailed reference and background information)
- perlutil explains the command line utilities packaged with the Perl distribution. [561+]
The following platform-specific documents are available before the installation as README.platform, and after the installation as perlplatform:
perlaix perlamiga perlapollo perlbeos perlbs2000
perlce perlcygwin perldgux perldos perlepoc perlfreebsd perlhpux
perlhurd perlirix perlmachten perlmacos perlmint perlmpeix
perlnetware perlos2 perlos390 perlplan9 perlqnx perlsolaris
perltru64 perluts perlvmesa perlvms perlvos perlwin32
These documents usually detail one or more of the following subjects: configuring, building, testing, installing, and sometimes also using Perl on the said platform.
Eastern Asian Perl users are now welcomed in their own languages: README.jp (Japanese), README.ko (Korean), README.cn (simplified Chinese) and README.tw (traditional Chinese), which are written in normal pod but encoded in EUC-JP, EUC-KR, EUC-CN and Big5. These will get installed as
perljp perlko perlcn perltw
- The documentation for the POSIX-BC platform is called "BS2000", to avoid confusion with the Perl POSIX module.
- The documentation for the WinCE platform is called perlce (README.ce in the source code kit), to avoid confusion with the perlwin32 documentation on 8.3-restricted filesystems.
p58-Performance Enhancements
- map() could get pathologically slow when the result list it generates is larger than the source list. The performance has been improved for common scenarios. [561]
- sort() is also fully reentrant, in the sense that the sort function can itself call sort(). This did not work reliably in previous releases. [561]
- sort() has been changed to use primarily mergesort internally as opposed to the earlier quicksort. For very small lists this may result in slightly slower sorting times, but in general the speedup should be at least 20%. Additional bonuses are that the worst case behaviour of sort() is now better (in computer science terms it now runs in time O(N log N), as opposed to quicksort's Theta(N**2) worst-case run time behaviour), and that sort() is now stable (meaning that elements with identical keys will stay ordered as they were before the sort). See the
sort
pragma for information.
The story in more detail: suppose you want to serve yourself a little slice of Pi.
@digits = ( 3,1,4,1,5,9 );
A numerical sort of the digits will yield (1,1,3,4,5,9), as expected. Which 1
comes first is hard to know, since one 1
looks pretty much like any other. You can regard this as totally trivial, or somewhat profound. However, if you just want to sort the even digits ahead of the odd ones, then what will
sort { ($a % 2) <=> ($b % 2) } @digits;
yield? The only even digit, 4
, will come first. But how about the odd numbers, which all compare equal? With the quicksort algorithm used to implement Perl 5.6 and earlier, the order of ties is left up to the sort. So, as you add more and more digits of Pi, the order in which the sorted even and odd digits appear will change. and, for sufficiently large slices of Pi, the quicksort algorithm in Perl 5.8 won't return the same results even if reinvoked with the same input. The justification for this rests with quicksort's worst case behavior. If you run
sort { $a <=> $b } ( 1 .. $N , 1 .. $N );
(something you might approximate if you wanted to merge two sorted arrays using sort), doubling $N doesn't just double the quicksort time, it quadruples it. Quicksort has a worst case run time that can grow like N**2, so-called quadratic behaviour, and it can happen on patterns that may well arise in normal use. You won't notice this for small arrays, but you will notice it with larger arrays, and you may not live long enough for the sort to complete on arrays of a million elements. So the 5.8 quicksort scrambles large arrays before sorting them, as a statistical defence against quadratic behaviour. But that means if you sort the same large array twice, ties may be broken in different ways.
Because of the unpredictability of tie-breaking order, and the quadratic worst-case behaviour, quicksort was almost replaced completely with a stable mergesort. Stable means that ties are broken to preserve the original order of appearance in the input array. So
sort { ($a % 2) <=> ($b % 2) } (3,1,4,1,5,9);
will yield (4,3,1,1,5,9), guaranteed. The even and odd numbers appear in the output in the same order they appeared in the input. Mergesort has worst case O(N log N) behaviour, the best value attainable. And, ironically, this mergesort does particularly well where quicksort goes quadratic: mergesort sorts (1..$N, 1..$N) in O(N) time. But quicksort was rescued at the last moment because it is faster than mergesort on certain inputs and platforms. For example, if you really don't care about the order of even and odd digits, quicksort will run in O(N) time; it's very good at sorting many repetitions of a small number of distinct elements. The quicksort divide and conquer strategy works well on platforms with relatively small, very fast, caches. Eventually, the problem gets whittled down to one that fits in the cache, from which point it benefits from the increased memory speed.
Quicksort was rescued by implementing a sort pragma to control aspects of the sort. The stable subpragma forces stable behaviour, regardless of algorithm. The _quicksort and _mergesort subpragmas are heavy-handed ways to select the underlying implementation. The leading _
is a reminder that these subpragmas may not survive beyond 5.8. More appropriate mechanisms for selecting the implementation exist, but they wouldn't have arrived in time to save quicksort.
- Hashes now use Bob Jenkins "One-at-a-Time" hashing key algorithm ( http://burtleburtle.net/bob/hash/doobs.html ). This algorithm is reasonably fast while producing a much better spread of values than the old hashing algorithm (originally by Chris Torek, later tweaked by Ilya Zakharevich). Hash values output from the algorithm on a hash of all 3-char printable ASCII keys comes much closer to passing the DIEHARD random number generation tests. According to perlbench, this change has not affected the overall speed of Perl.
- unshift() should now be noticeably faster.
p58-Installation and Configuration Improvements
p58-Generic Improvements
- INSTALL now explains how you can configure Perl to use 64-bit integers even on non-64-bit platforms.
- Policy.sh policy change: if you are reusing a Policy.sh file (see INSTALL) and you use Configure -Dprefix=/foo/bar and in the old Policy $prefix eq $siteprefix and $prefix eq $vendorprefix, all of them will now be changed to the new prefix, /foo/bar. (Previously only $prefix changed.) If you do not like this new behaviour, specify prefix, siteprefix, and vendorprefix explicitly.
- A new optional location for Perl libraries, otherlibdirs, is available. It can be used for example for vendor add-ons without disturbing Perl's own library directories.
- In many platforms, the vendor-supplied 'cc' is too stripped-down to build Perl (basically, 'cc' doesn't do ANSI C). If this seems to be the case and 'cc' does not seem to be the GNU C compiler 'gcc', an automatic attempt is made to find and use 'gcc' instead.
- gcc needs to closely track the operating system release to avoid build problems. If Configure finds that gcc was built for a different operating system release than is running, it now gives a clearly visible warning that there may be trouble ahead.
- Since Perl 5.8 is not binary-compatible with previous releases of Perl, Configure no longer suggests including the 5.005 modules in @INC.
- Configure
-S
can now run non-interactively. [561]
- Configure support for pdp11-style memory models has been removed due to obsolescence. [561]
- configure.gnu now works with options with whitespace in them.
- installperl now outputs everything to STDERR.
- Because PerlIO is now the default on most platforms, "-perlio" doesn't get appended to the $Config{archname} (also known as $^O) anymore. Instead, if you explicitly choose not to use perlio (Configure command line option -Uuseperlio), you will get "-stdio" appended.
- Another change related to the architecture name is that "-64all" (-Duse64bitall, or "maximally 64-bit") is appended only if your pointers are 64 bits wide. (To be exact, the use64bitall is ignored.)
- In AFS installations, one can configure the root of the AFS to be somewhere else than the default /afs by using the Configure parameter
-Dafsroot=/some/where/else
.
- APPLLIB_EXP, a lesser-known configuration-time definition, has been documented. It can be used to prepend site-specific directories to Perl's default search path (@INC); see INSTALL for information.
- The version of Berkeley DB used when the Perl (and, presumably, the DB_File extension) was built is now available as
@Config{qw(db_version_major db_version_minor db_version_patch)}
from Perl and as DB_VERSION_MAJOR_CFG DB_VERSION_MINOR_CFG DB_VERSION_PATCH_CFG
from C.
- Building Berkeley DB3 for compatibility modes for DB, NDBM, and ODBM has been documented in INSTALL.
- If you have CPAN access (either network or a local copy such as a CD-ROM) you can during specify extra modules to Configure to build and install with Perl using the -Dextras=... option. See INSTALL for more details.
- In addition to config.over, a new override file, config.arch, is available. This file is supposed to be used by hints file writers for architecture-wide changes (as opposed to config.over which is for site-wide changes).
- If your file system supports symbolic links, you can build Perl outside of the source directory by
mkdir perl/build/directory
cd perl/build/directory
sh /path/to/perl/source/Configure -Dmksymlinks ...
This will create in perl/build/directory a tree of symbolic links pointing to files in /path/to/perl/source. The original files are left unaffected. After Configure has finished, you can just say
make all test
and Perl will be built and tested, all in perl/build/directory. [561]
- For Perl developers, several new make targets for profiling and debugging have been added; see perlhack.
- Use of the gprof tool to profile Perl has been documented in perlhack. There is a make target called "perl.gprof" for generating a gprofiled Perl executable.
- If you have GCC 3, there is a make target called "perl.gcov" for creating a gcoved Perl executable for coverage analysis. See perlhack.
- If you are on IRIX or Tru64 platforms, new profiling/debugging options have been added; see perlhack for more information about pixie and Third Degree.
- Guidelines of how to construct minimal Perl installations have been added to INSTALL.
- The Thread extension is now not built at all under ithreads (
Configure -Duseithreads
) because it wouldn't work anyway (the Thread extension requires being Configured with -Duse5005threads
).
Note that the 5.005 threads are unsupported and deprecated: if you have code written for the old threads you should migrate it to the new ithreads model.
- The Gconvert macro ($Config{d_Gconvert}) used by perl for stringifying floating-point numbers is now more picky about using sprintf %.*g rules for the conversion. Some platforms that used to use gcvt may now resort to the slower sprintf.
- The obsolete method of making a special (e.g., debugging) flavor of perl by saying
make LIBPERL=libperld.a
has been removed. Use -DDEBUGGING instead.
p58-New Or Improved Platforms
For the list of platforms known to support Perl, see "Supported Platforms" in perlport.
- AIX dynamic loading should be now better supported.
- AIX should now work better with gcc, threads, and 64-bitness. Also the long doubles support in AIX should be better now. See perlaix.
- AtheOS ( http://www.atheos.cx/ ) is a new platform.
- BeOS has been reclaimed.
- The DG/UX platform now supports 5.005-style threads. See perldgux.
- The DYNIX/ptx platform (also known as dynixptx) is supported at or near osvers 4.5.2.
- EBCDIC platforms (z/OS (also known as OS/390), POSIX-BC, and VM/ESA) have been regained. Many test suite tests still fail and the co-existence of Unicode and EBCDIC isn't quite settled, but the situation is much better than with Perl 5.6. See perlos390, perlbs2000 (for POSIX-BC), and perlvmesa for more information.
- Building perl with -Duseithreads or -Duse5005threads now works under HP-UX 10.20 (previously it only worked under 10.30 or later). You will need a thread library package installed. See README.hpux. [561]
- Mac OS Classic is now supported in the mainstream source package (MacPerl has of course been available since perl 5.004 but now the source code bases of standard Perl and MacPerl have been synchronised) [561]
- Mac OS X (or Darwin) should now be able to build Perl even on HFS+ filesystems. (The case-insensitivity used to confuse the Perl build process.)
- NCR MP-RAS is now supported. [561]
- All the NetBSD specific patches (except for the installation specific ones) have been merged back to the main distribution.
- NetWare from Novell is now supported. See perlnetware.
- NonStop-UX is now supported. [561]
- NEC SUPER-UX is now supported.
- All the OpenBSD specific patches (except for the installation specific ones) have been merged back to the main distribution.
- Perl has been tested with the GNU pth userlevel thread package ( http://www.gnu.org/software/pth/pth.html ). All thread tests of Perl now work, but not without adding some yield()s to the tests, so while pth (and other userlevel thread implementations) can be considered to be "working" with Perl ithreads, keep in mind the possible non-preemptability of the underlying thread implementation.
- Stratus VOS is now supported using Perl's native build method (Configure). This is the recommended method to build Perl on VOS. The older methods, which build miniperl, are still available. See perlvos. [561+]
- The Amdahl UTS Unix mainframe platform is now supported. [561]
- WinCE is now supported. See perlce.
- z/OS (formerly known as OS/390, formerly known as MVS OE) now has support for dynamic loading. This is not selected by default, however, you must specify -Dusedl in the arguments of Configure. [561]
p58-Selected Bug Fixes
Numerous memory leaks and uninitialized memory accesses have been hunted down. Most importantly, anonymous subs used to leak quite a bit. [561]
- The autouse pragma didn't work for Multi::Part::Function::Names.
- caller() could cause core dumps in certain situations. Carp was sometimes affected by this problem. In particular, caller() now returns a subroutine name of
(unknown)
for subroutines that have been removed from the symbol table.
- chop(@list) in list context returned the characters chopped in reverse order. This has been reversed to be in the right order. [561]
- Configure no longer includes the DBM libraries (dbm, gdbm, db, ndbm) when building the Perl binary. The only exception to this is SunOS 4.x, which needs them. [561]
- The behaviour of non-decimal but numeric string constants such as "0x23" was platform-dependent: in some platforms that was seen as 35, in some as 0, in some as a floating point number (don't ask). This was caused by Perl's using the operating system libraries in a situation where the result of the string to number conversion is undefined: now Perl consistently handles such strings as zero in numeric contexts.
- Several debugger fixes: exit code now reflects the script exit code, condition
"0"
now treated correctly, the d
command now checks line number, $.
no longer gets corrupted, and all debugger output now goes correctly to the socket if RemotePort is set. [561]
- The debugger (perl5db.pl) has been modified to present a more consistent commands interface, via (CommandSet=580). perl5db.t was also added to test the changes, and as a placeholder for further tests.
See perldebug.
- The debugger has a new
dumpDepth
option to control the maximum depth to which nested structures are dumped. The x
command has been extended so that x N EXPR
dumps out the value of EXPR to a depth of at most N levels.
- The debugger can now show lexical variables if you have the CPAN module PadWalker installed.
- The order of DESTROYs has been made more predictable.
- Perl 5.6.0 could emit spurious warnings about redefinition of dl_error() when statically building extensions into perl. This has been corrected. [561]
- dprofpp -R didn't work.
*foo{FORMAT}
now works.
- Infinity is now recognized as a number.
- UNIVERSAL::isa no longer caches methods incorrectly. (This broke the Tk extension with 5.6.0.) [561]
- Lexicals I: lexicals outside an eval "" weren't resolved correctly inside a subroutine definition inside the eval "" if they were not already referenced in the top level of the eval""ed code.
- Lexicals II: lexicals leaked at file scope into subroutines that were declared before the lexicals.
- Lexical warnings now propagating correctly between scopes and into
eval "..."
.
use warnings qw(FATAL all)
did not work as intended. This has been corrected. [561]
- warnings::enabled() now reports the state of $^W correctly if the caller isn't using lexical warnings. [561]
- Line renumbering with eval and
#line
now works. [561]
- Fixed numerous memory leaks, especially in eval "".
- Localised tied variables no longer leak memory
use Tie::Hash;
tie my %tied_hash => 'Tie::StdHash';
...
# Used to leak memory every time local() was called;
# in a loop, this added up.
local($tied_hash{Foo}) = 1;
- Localised hash elements (and %ENV) are correctly unlocalised to not exist, if they didn't before they were localised.
use Tie::Hash;
tie my %tied_hash => 'Tie::StdHash';
...
# Nothing has set the FOO element so far
{ local $tied_hash{FOO} = 'Bar' }
# This used to print, but not now.
print "exists!\n" if exists $tied_hash{FOO};
As a side effect of this fix, tied hash interfaces must define the EXISTS and DELETE methods.
- mkdir() now ignores trailing slashes in the directory name, as mandated by POSIX.
- Some versions of glibc have a broken modfl(). This affects builds with
-Duselongdouble
. This version of Perl detects this brokenness and has a workaround for it. The glibc release 2.2.2 is known to have fixed the modfl() bug.
- Modulus of unsigned numbers now works (4063328477 % 65535 used to return 27406, instead of 27047). [561]
- Some "not a number" warnings introduced in 5.6.0 eliminated to be more compatible with 5.005. Infinity is now recognised as a number. [561]
- Numeric conversions did not recognize changes in the string value properly in certain circumstances. [561]
- Attributes (such as :shared) didn't work with our().
- our() variables will not cause bogus "Variable will not stay shared" warnings. [561]
- "our" variables of the same name declared in two sibling blocks resulted in bogus warnings about "redeclaration" of the variables. The problem has been corrected. [561]
- pack "Z" now correctly terminates the string with "\0".
- Fix password routines which in some shadow password platforms (e.g. HP-UX) caused getpwent() to return every other entry.
- The PERL5OPT environment variable (for passing command line arguments to Perl) didn't work for more than a single group of options. [561]
- PERL5OPT with embedded spaces didn't work.
- printf() no longer resets the numeric locale to "C".
qw(a\\b)
now parses correctly as 'a\\b'
: that is, as three characters, not four. [561]
- pos() did not return the correct value within s///ge in earlier versions. This is now handled correctly. [561]
- Printing quads (64-bit integers) with printf/sprintf now works without the q L ll prefixes (assuming you are on a quad-capable platform).
- Regular expressions on references and overloaded scalars now work. [561+]
- Right-hand side magic (GMAGIC) could in many cases such as string concatenation be invoked too many times.
- scalar() now forces scalar context even when used in void context.
- SOCKS support is now much more robust.
- sort() arguments are now compiled in the right wantarray context (they were accidentally using the context of the sort() itself). The comparison block is now run in scalar context, and the arguments to be sorted are always provided list context. [561]
- Changed the POSIX character class
[[:space:]]
to include the (very rarely used) vertical tab character. Added a new POSIX-ish character class [[:blank:]]
which stands for horizontal whitespace (currently, the space and the tab).
- The tainting behaviour of sprintf() has been rationalized. It does not taint the result of floating point formats anymore, making the behaviour consistent with that of string interpolation. [561]
- Some cases of inconsistent taint propagation (such as within hash values) have been fixed.
- The RE engine found in Perl 5.6.0 accidentally pessimised certain kinds of simple pattern matches. These are now handled better. [561]
- Regular expression debug output (whether through
use re 'debug'
or via -Dr
) now looks better. [561]
- Multi-line matches like
"a\nxb\n" =~ /(?!\A)x/m
were flawed. The bug has been fixed. [561]
- Use of $& could trigger a core dump under some situations. This is now avoided. [561]
- The regular expression captured submatches ($1, $2, ...) are now more consistently unset if the match fails, instead of leaving false data lying around in them. [561]
- readline() on files opened in "slurp" mode could return an extra "" (blank line) at the end in certain situations. This has been corrected. [561]
- Autovivification of symbolic references of special variables described in perlvar (as in
${$num}
) was accidentally disabled. This works again now. [561]
- Sys::Syslog ignored the
LOG_AUTH
constant.
- $AUTOLOAD, sort(), lock(), and spawning subprocesses in multiple threads simultaneously are now thread-safe.
- Tie::Array's SPLICE method was broken.
- Allow a read-only string on the left-hand side of a non-modifying tr///.
- If
STDERR
is tied, warnings caused by warn
and die
now correctly pass to it.
- Several Unicode fixes.
- BOMs (byte order marks) at the beginning of Perl files (scripts, modules) should now be transparently skipped. UTF-16 and UCS-2 encoded Perl files should now be read correctly.
- The character tables have been updated to Unicode 3.2.0.
- Comparing with utf8 data does not magically upgrade non-utf8 data into utf8. (This was a problem for example if you were mixing data from I/O and Unicode data: your output might have got magically encoded as UTF-8.)
- Generating illegal Unicode code points such as U+FFFE, or the UTF-16 surrogates, now also generates an optional warning.
IsAlnum
, IsAlpha
, and IsWord
now match titlecase.
- Concatenation with the
.
operator or via variable interpolation, eq
, substr
, reverse
, quotemeta
, the x
operator, substitution with s///
, single-quoted UTF-8, should now work.
- The
tr///
operator now works. Note that the tr///CU
functionality has been removed (but see pack('U0', ...)).
eval "v200"
now works.
- Perl 5.6.0 parsed m/\x{ab}/ incorrectly, leading to spurious warnings. This has been corrected. [561]
- Zero entries were missing from the Unicode classes such as
IsDigit
.
- Large unsigned numbers (those above 2**31) could sometimes lose their unsignedness, causing bogus results in arithmetic operations. [561]
- The Perl parser has been stress tested using both random input and Markov chain input and the few found crashes and lockups have been fixed.
p58-Platform Specific Changes and Fixes
- BSDI 4.*
Perl now works on post-4.0 BSD/OSes.
- All BSDs
Setting $0
now works (as much as possible; see perlvar for details).
- Cygwin
Numerous updates; currently synchronised with Cygwin 1.3.10.
- Previously DYNIX/ptx had problems in its Configure probe for non-blocking I/O.
- EPOC
EPOC now better supported. See README.epoc. [561]
- FreeBSD 3.*
Perl now works on post-3.0 FreeBSDs.
- HP-UX
README.hpux updated; Configure -Duse64bitall
now works; now uses HP-UX malloc instead of Perl malloc.
- IRIX
Numerous compilation flag and hint enhancements; accidental mixing of 32-bit and 64-bit libraries (a doomed attempt) made much harder.
- Linux
- Long doubles should now work (see INSTALL). [561]
- Linux previously had problems related to sockaddrlen when using accept(), recvfrom() (in Perl: recv()), getpeername(), and getsockname().
- Mac OS Classic
Compilation of the standard Perl distribution in Mac OS Classic should now work if you have the Metrowerks development environment and the missing Mac-specific toolkit bits. Contact the macperl mailing list for details.
- MPE/iX
MPE/iX update after Perl 5.6.0. See README.mpeix. [561]
- NetBSD/threads: try installing the GNU pth (should be in the packages collection, or http://www.gnu.org/software/pth/), and Configure with -Duseithreads.
- NetBSD/sparc
Perl now works on NetBSD/sparc.
- OS/2
Now works with usethreads (see INSTALL). [561]
- Solaris
64-bitness using the Sun Workshop compiler now works.
- Stratus VOS
The native build method requires at least VOS Release 14.5.0 and GNU C++/GNU Tools 2.0.1 or later. The Perl pack function now maps overflowed values to +infinity and underflowed values to -infinity.
- Tru64 (aka Digital UNIX, aka DEC OSF/1)
The operating system version letter now recorded in $Config{osvers}. Allow compiling with gcc (previously explicitly forbidden). Compiling with gcc still not recommended because buggy code results, even with gcc 2.95.2.
- Unicos
Fixed various alignment problems that lead into core dumps either during build or later; no longer dies on math errors at runtime; now using full quad integers (64 bits), previously was using only 46 bit integers for speed.
- VMS
See "p58-Socket Extension Dynamic in VMS" and "p58-IEEE-format Floating Point Default on OpenVMS Alpha" for important changes not otherwise listed here.
chdir() now works better despite a CRT bug; now works with MULTIPLICITY (see INSTALL); now works with Perl's malloc.
The tainting of %ENV
elements via keys
or values
was previously unimplemented. It now works as documented.
The waitpid
emulation has been improved. The worst bug (now fixed) was that a pid of -1 would cause a wildcard search of all processes on the system.
POSIX-style signals are now emulated much better on VMS versions prior to 7.0.
The system
function and backticks operator have improved functionality and better error handling. [561]
File access tests now use current process privileges rather than the user's default privileges, which could sometimes result in a mismatch between reported access and actual access. This improvement is only available on VMS v6.0 and later.
There is a new kill
implementation based on sys$sigprc
that allows older VMS systems (pre-7.0) to use kill
to send signals rather than simply force exit. This implementation also allows later systems to call kill
from within a signal handler.
Iterative logical name translations are now limited to 10 iterations in imitation of SHOW LOGICAL and other OpenVMS facilities.
- Windows
- Signal handling now works better than it used to. It is now implemented using a Windows message loop, and is therefore less prone to random crashes.
- fork() emulation is now more robust, but still continues to have a few esoteric bugs and caveats. See perlfork for details. [561+]
- A failed (pseudo)fork now returns undef and sets errno to EAGAIN. [561]
- The following modules now work on Windows:
ExtUtils::Embed [561]
IO::Pipe
IO::Poll
Net::Ping
- IO::File::new_tmpfile() is no longer limited to 32767 invocations per-process.
- Better chdir() return value for a non-existent directory.
- Compiling perl using the 64-bit Platform SDK tools is now supported.
- The Win32::SetChildShowWindow() builtin can be used to control the visibility of windows created by child processes. See Win32 for details.
- Non-blocking waits for child processes (or pseudo-processes) are supported via
waitpid($pid, &POSIX::WNOHANG)
.
- The behavior of system() with multiple arguments has been rationalized. Each unquoted argument will be automatically quoted to protect whitespace, and any existing whitespace in the arguments will be preserved. This improves the portability of system(@args) by avoiding the need for Windows
cmd
shell specific quoting in perl programs.
Note that this means that some scripts that may have relied on earlier buggy behavior may no longer work correctly. For example, system("nmake /nologo", @args)
will now attempt to run the file nmake /nologo
and will fail when such a file isn't found. On the other hand, perl will now execute code such as system("c:/Program Files/MyApp/foo.exe", @args)
correctly.
- The perl header files no longer suppress common warnings from the Microsoft Visual C++ compiler. This means that additional warnings may now show up when compiling XS code.
- Borland C++ v5.5 is now a supported compiler that can build Perl. However, the generated binaries continue to be incompatible with those generated by the other supported compilers (GCC and Visual C++). [561]
- Duping socket handles with open(F, ">&MYSOCK") now works under Windows 9x. [561]
- Current directory entries in %ENV are now correctly propagated to child processes. [561]
- New %ENV entries now propagate to subprocesses. [561]
- Win32::GetCwd() correctly returns C:\ instead of C: when at the drive root. Other bugs in chdir() and Cwd::cwd() have also been fixed. [561]
- The makefiles now default to the features enabled in ActiveState ActivePerl (a popular Win32 binary distribution). [561]
- HTML files will now be installed in c:\perl\html instead of c:\perl\lib\pod\html
- REG_EXPAND_SZ keys are now allowed in registry settings used by perl. [561]
- Can now send() from all threads, not just the first one. [561]
- ExtUtils::MakeMaker now uses $ENV{LIB} to search for libraries. [561]
- Less stack reserved per thread so that more threads can run concurrently. (Still 16M per thread.) [561]
File::Spec->tmpdir()
now prefers C:/temp over /tmp (works better when perl is running as service).
- Better UNC path handling under ithreads. [561]
- wait(), waitpid(), and backticks now return the correct exit status under Windows 9x. [561]
- A socket handle leak in accept() has been fixed. [561]
p58-New or Changed Diagnostics
Please see perldiag for more details.
- Ambiguous range in the transliteration operator (like a-z-9) now gives a warning.
- chdir("") and chdir(undef) now give a deprecation warning because they cause a possible unintentional chdir to the home directory. Say chdir() if you really mean that.
- Two new debugging options have been added: if you have compiled your Perl with debugging, you can use the -DT [561] and -DR options to trace tokenising and to add reference counts to displaying variables, respectively.
- The lexical warnings category "deprecated" is no longer a sub-category of the "syntax" category. It is now a top-level category in its own right.
- Unadorned dump() will now give a warning suggesting to use explicit CORE::dump() if that's what really is meant.
- The "Unrecognized escape" warning has been extended to include
\8
, \9
, and \_
. There is no need to escape any of the \w
characters.
- All regular expression compilation error messages are now hopefully easier to understand both because the error message now comes before the failed regex and because the point of failure is now clearly marked by a
<-- HERE
marker.
- Various I/O (and socket) functions like binmode(), close(), and so forth now more consistently warn if they are used illogically either on a yet unopened or on an already closed filehandle (or socket).
- Using lstat() on a filehandle now gives a warning. (It's a non-sensical thing to do.)
- The
-M
and -m
options now warn if you didn't supply the module name.
- If you in
use
specify a required minimum version, modules matching the name and but not defining a $VERSION will cause a fatal failure.
- Using negative offset for vec() in lvalue context is now a warnable offense.
- Odd number of arguments to overload::constant now elicits a warning.
- Odd number of elements in anonymous hash now elicits a warning.
- The various "opened only for", "on closed", "never opened" warnings drop the
main::
prefix for filehandles in the main
package, for example STDIN
instead of main::STDIN
.
- Subroutine prototypes are now checked more carefully, you may get warnings for example if you have used non-prototype characters.
- If an attempt to use a (non-blessed) reference as an array index is made, a warning is given.
push @a;
and unshift @a;
(with no values to push or unshift) now give a warning. This may be a problem for generated and eval'ed code.
- If you try to "pack" in perlfunc a number less than 0 or larger than 255 using the
"C"
format you will get an optional warning. Similarly for the "c"
format and a number less than -128 or more than 127.
- pack
P
format now demands an explicit size.
- unpack
w
now warns of unterminated compressed integers.
- Warnings relating to the use of PerlIO have been added.
- Certain regex modifiers such as
(?o)
make sense only if applied to the entire regex. You will get an optional warning if you try to do otherwise.
- Variable length lookbehind has not yet been implemented, trying to use it will tell that.
- Using arrays or hashes as references (e.g.
%foo->{bar}
has been deprecated for a while. Now you will get an optional warning.
- Warnings relating to the use of the new restricted hashes feature have been added.
- Self-ties of arrays and hashes are not supported and fatal errors will happen even at an attempt to do so.
- Using
sort
in scalar context now issues an optional warning. This didn't do anything useful, as the sort was not performed.
- Using the /g modifier in split() is meaningless and will cause a warning.
- Using splice() past the end of an array now causes a warning.
- Malformed Unicode encodings (UTF-8 and UTF-16) cause a lot of warnings, as does trying to use UTF-16 surrogates (which are unimplemented).
- Trying to use Unicode characters on an I/O stream without marking the stream's encoding (using open() or binmode()) will cause "Wide character" warnings.
- Use of v-strings in use/require causes a (backward) portability warning.
- Warnings relating to the use interpreter threads and their shared data have been added.
p58-Changed Internals
- PerlIO is now the default.
- perlapi.pod (a companion to perlguts) now attempts to document the internal API.
- You can now build a really minimal perl called microperl. Building microperl does not require even running Configure;
make -f Makefile.micro
should be enough. Beware: microperl makes many assumptions, some of which may be too bold; the resulting executable may crash or otherwise misbehave in wondrous ways. For careful hackers only.
- Added rsignal(), whichsig(), do_join(), op_clear, op_null, ptr_table_clear(), ptr_table_free(), sv_setref_uv(), and several UTF-8 interfaces to the publicised API. For the full list of the available APIs see perlapi.
- Made possible to propagate customised exceptions via croak()ing.
- Now xsubs can have attributes just like subs. (Well, at least the built-in attributes.)
- dTHR and djSP have been obsoleted; the former removed (because it's a no-op) and the latter replaced with dSP.
- PERL_OBJECT has been completely removed.
- The MAGIC constants (e.g.
'P'
) have been macrofied (e.g. PERL_MAGIC_TIED
) for better source code readability and maintainability.
- The regex compiler now maintains a structure that identifies nodes in the compiled bytecode with the corresponding syntactic features of the original regex expression. The information is attached to the new
offsets
member of the struct regexp
. See perldebguts for more complete information.
- The C code has been made much more
gcc -Wall
clean. Some warning messages still remain in some platforms, so if you are compiling with gcc you may see some warnings about dubious practices. The warnings are being worked on.
- perly.c, sv.c, and sv.h have now been extensively commented.
- Documentation on how to use the Perl source repository has been added to Porting/repository.pod.
- There are now several profiling make targets.
p58-Security Vulnerability Closed [561]
(This change was already made in 5.7.0 but bears repeating here.) (5.7.0 came out before 5.6.1: the development branch 5.7 released earlier than the maintenance branch 5.6)
A potential security vulnerability in the optional suidperl component of Perl was identified in August 2000. suidperl is neither built nor installed by default. As of November 2001 the only known vulnerable platform is Linux, most likely all Linux distributions. CERT and various vendors and distributors have been alerted about the vulnerability. See http://www.cpan.org/src/5.0/sperl-2000-08-05/sperl-2000-08-05.txt for more information.
The problem was caused by Perl trying to report a suspected security exploit attempt using an external program, /bin/mail. On Linux platforms the /bin/mail program had an undocumented feature which when combined with suidperl gave access to a root shell, resulting in a serious compromise instead of reporting the exploit attempt. If you don't have /bin/mail, or if you have 'safe setuid scripts', or if suidperl is not installed, you are safe.
The exploit attempt reporting feature has been completely removed from Perl 5.8.0 (and the maintenance release 5.6.1, and it was removed also from all the Perl 5.7 releases), so that particular vulnerability isn't there anymore. However, further security vulnerabilities are, unfortunately, always possible. The suidperl functionality is most probably going to be removed in Perl 5.10. In any case, suidperl should only be used by security experts who know exactly what they are doing and why they are using suidperl instead of some other solution such as sudo ( see http://www.courtesan.com/sudo/ ).
p58-New Tests
Several new tests have been added, especially for the lib and ext subsections. There are now about 69 000 individual tests (spread over about 700 test scripts), in the regression suite (5.6.1 has about 11 700 tests, in 258 test scripts) The exact numbers depend on the platform and Perl configuration used. Many of the new tests are of course introduced by the new modules, but still in general Perl is now more thoroughly tested.
Because of the large number of tests, running the regression suite will take considerably longer time than it used to: expect the suite to take up to 4-5 times longer to run than in perl 5.6. On a really fast machine you can hope to finish the suite in about 6-8 minutes (wallclock time).
The tests are now reported in a different order than in earlier Perls. (This happens because the test scripts from under t/lib have been moved to be closer to the library/extension they are testing.)
p58-Known Problems
p58-The Compiler Suite Is Still Very Experimental
The compiler suite is slowly getting better but it continues to be highly experimental. Use in production environments is discouraged.
p58-Localising Tied Arrays and Hashes Is Broken
local %tied_array;
doesn't work as one would expect: the old value is restored incorrectly. This will be changed in a future release, but we don't know yet what the new semantics will exactly be. In any case, the change will break existing code that relies on the current (ill-defined) semantics, so just avoid doing this in general.
p58-Building Extensions Can Fail Because Of Largefiles
Some extensions like mod_perl are known to have issues with `largefiles', a change brought by Perl 5.6.0 in which file offsets default to 64 bits wide, where supported. Modules may fail to compile at all, or they may compile and work incorrectly. Currently, there is no good solution for the problem, but Configure now provides appropriate non-largefile ccflags, ldflags, libswanted, and libs in the %Config hash (e.g., $Config{ccflags_nolargefiles}) so the extensions that are having problems can try configuring themselves without the largefileness. This is admittedly not a clean solution, and the solution may not even work at all. One potential failure is whether one can (or, if one can, whether it's a good idea to) link together at all binaries with different ideas about file offsets; all this is platform-dependent.
p58-Modifying $_ Inside for(..)
for (1..5) { $_++ }
works without complaint. It shouldn't. (You should be able to modify only lvalue elements inside the loops.) You can see the correct behaviour by replacing the 1..5 with 1, 2, 3, 4, 5.
p58-mod_perl 1.26 Doesn't Build With Threaded Perl
Use mod_perl 1.27 or higher.
p58-lib/ftmp-security tests warn 'system possibly insecure'
Don't panic. Read the 'make test' section of INSTALL instead.
p58-libwww-perl (LWP) fails base/date #51
Use libwww-perl 5.65 or later.
p58-PDL failing some tests
Use PDL 2.3.4 or later.
p58-Perl_get_sv
You may get errors like 'Undefined symbol "Perl_get_sv"' or "can't resolve symbol 'Perl_get_sv'", or the symbol may be "Perl_sv_2pv". This probably means that you are trying to use an older shared Perl library (or extensions linked with such) with Perl 5.8.0 executable. Perl used to have such a subroutine, but that is no more the case. Check your shared library path, and any shared Perl libraries in those directories.
Sometimes this problem may also indicate a partial Perl 5.8.0 installation, see "p58-Mac OS X dyld undefined symbols" for an example and how to deal with it.
p58-Self-tying Problems
Self-tying of arrays and hashes is broken in rather deep and hard-to-fix ways. As a stop-gap measure to avoid people from getting frustrated at the mysterious results (core dumps, most often), it is forbidden for now (you will get a fatal error even from an attempt).
A change to self-tying of globs has caused them to be recursively referenced (see: "Two-Phased Garbage Collection" in perlobj). You will now need an explicit untie to destroy a self-tied glob. This behaviour may be fixed at a later date.
Self-tying of scalars and IO thingies works.
p58-ext/threads/t/libc
If this test fails, it indicates that your libc (C library) is not threadsafe. This particular test stress tests the localtime() call to find out whether it is threadsafe. See perlthrtut for more information.
p58-Failure of Thread (5.005-style) tests
Note that support for 5.005-style threading is deprecated, experimental and practically unsupported. In 5.10, it is expected to be removed. You should migrate your code to ithreads.
The following tests are known to fail due to fundamental problems in the 5.005 threading implementation. These are not new failures--Perl 5.005_0x has the same bugs, but didn't have these tests.
../ext/B/t/xref.t 255 65280 14 12 85.71% 3-14
../ext/List/Util/t/first.t 255 65280 7 4 57.14% 2 5-7
../lib/English.t 2 512 54 2 3.70% 2-3
../lib/FileCache.t 5 1 20.00% 5
../lib/Filter/Simple/t/data.t 6 3 50.00% 1-3
../lib/Filter/Simple/t/filter_only. 9 3 33.33% 1-2 5
../lib/Math/BigInt/t/bare_mbf.t 1627 4 0.25% 8 11 1626-1627
../lib/Math/BigInt/t/bigfltpm.t 1629 4 0.25% 10 13 1628-
1629
../lib/Math/BigInt/t/sub_mbf.t 1633 4 0.24% 8 11 1632-1633
../lib/Math/BigInt/t/with_sub.t 1628 4 0.25% 9 12 1627-1628
../lib/Tie/File/t/31_autodefer.t 255 65280 65 32 49.23% 34-65
../lib/autouse.t 10 1 10.00% 4
op/flip.t 15 1 6.67% 15
These failures are unlikely to get fixed as 5.005-style threads are considered fundamentally broken. (Basically what happens is that competing threads can corrupt shared global state, one good example being regular expression engine's state.)
p58-Timing problems
The following tests may fail intermittently because of timing problems, for example if the system is heavily loaded.
t/op/alarm.t
ext/Time/HiRes/HiRes.t
lib/Benchmark.t
lib/Memoize/t/expmod_t.t
lib/Memoize/t/speed.t
In case of failure please try running them manually, for example
./perl -Ilib ext/Time/HiRes/HiRes.t
p58-Tied/Magical Array/Hash Elements Do Not Autovivify
For normal arrays $foo = \$bar[1]
will assign undef
to $bar[1]
(assuming that it didn't exist before), but for tied/magical arrays and hashes such autovivification does not happen because there is currently no way to catch the reference creation. The same problem affects slicing over non-existent indices/keys of a tied/magical array/hash.
p58-Unicode in package/class and subroutine names does not work
One can have Unicode in identifier names, but not in package/class or subroutine names. While some limited functionality towards this does exist as of Perl 5.8.0, that is more accidental than designed; use of Unicode for the said purposes is unsupported.
One reason of this unfinishedness is its (currently) inherent unportability: since both package names and subroutine names may need to be mapped to file and directory names, the Unicode capability of the filesystem becomes important-- and there unfortunately aren't portable answers.
p58-Platform Specific Problems
p58-AIX
- If using the AIX native make command, instead of just "make" issue "make all". In some setups the former has been known to spuriously also try to run "make install". Alternatively, you may want to use GNU make.
- In AIX 4.2, Perl extensions that use C++ functions that use statics may have problems in that the statics are not getting initialized. In newer AIX releases, this has been solved by linking Perl with the libC_r library, but unfortunately in AIX 4.2 the said library has an obscure bug where the various functions related to time (such as time() and gettimeofday()) return broken values, and therefore in AIX 4.2 Perl is not linked against libC_r.
- vac 5.0.0.0 May Produce Buggy Code For Perl
The AIX C compiler vac version 5.0.0.0 may produce buggy code, resulting in a few random tests failing when run as part of "make test", but when the failing tests are run by hand, they succeed. We suggest upgrading to at least vac version 5.0.1.0, that has been known to compile Perl correctly. "lslpp -L|grep vac.C" will tell you the vac version. See README.aix.
- If building threaded Perl, you may get compilation warning from pp_sys.c:
"pp_sys.c", line 4651.39: 1506-280 (W) Function argument assignment between types "unsigned char*" and "const void*" is not allowed.
This is harmless; it is caused by the getnetbyaddr() and getnetbyaddr_r() having slightly different types for their first argument.
p58-Alpha systems with old gccs fail several tests
If you see op/pack, op/pat, op/regexp, or ext/Storable tests failing in a Linux/alpha or *BSD/Alpha, it's probably time to upgrade your gcc. gccs prior to 2.95.3 are definitely not good enough, and gcc 3.1 may be even better. (RedHat Linux/alpha with gcc 3.1 reported no problems, as did Linux 2.4.18 with gcc 2.95.4.) (In Tru64, it is preferable to use the bundled C compiler.)
p58-AmigaOS
Perl 5.8.0 doesn't build in AmigaOS. It broke at some point during the ithreads work and we could not find Amiga experts to unbreak the problems. Perl 5.6.1 still works for AmigaOS (as does the 5.7.2 development release).
p58-BeOS
The following tests fail on 5.8.0 Perl in BeOS Personal 5.03:
t/op/lfs............................FAILED at test 17
t/op/magic..........................FAILED at test 24
ext/Fcntl/t/syslfs..................FAILED at test 17
ext/File/Glob/t/basic...............FAILED at test 3
ext/POSIX/t/sigaction...............FAILED at test 13
ext/POSIX/t/waitpid.................FAILED at test 1
See perlbeos (README.beos) for more details.
p58-Cygwin "unable to remap"
For example when building the Tk extension for Cygwin, you may get an error message saying "unable to remap". This is known problem with Cygwin, and a workaround is detailed in here: http://sources.redhat.com/ml/cygwin/2001-12/msg00894.html
p58-Cygwin ndbm tests fail on FAT
One can build but not install (or test the build of) the NDBM_File on FAT filesystems. Installation (or build) on NTFS works fine. If one attempts the test on a FAT install (or build) the following failures are expected:
../ext/NDBM_File/ndbm.t 13 3328 71 59 83.10% 1-2 4 16-71
../ext/ODBM_File/odbm.t 255 65280 ?? ?? % ??
../lib/AnyDBM_File.t 2 512 12 2 16.67% 1 4
../lib/Memoize/t/errors.t 0 139 11 5 45.45% 7-11
../lib/Memoize/t/tie_ndbm.t 13 3328 4 4 100.00% 1-4
run/fresh_perl.t 97 1 1.03% 91
NDBM_File fails and ODBM_File just coredumps.
If you intend to run only on FAT (or if using AnyDBM_File on FAT), run Configure with the -Ui_ndbm and -Ui_dbm options to prevent NDBM_File and ODBM_File being built.
p58-DJGPP Failures
t/op/stat............................FAILED at test 29
lib/File/Find/t/find.................FAILED at test 1
lib/File/Find/t/taint................FAILED at test 1
lib/h2xs.............................FAILED at test 15
lib/Pod/t/eol........................FAILED at test 1
lib/Test/Harness/t/strap-analyze.....FAILED at test 8
lib/Test/Harness/t/test-harness......FAILED at test 23
lib/Test/Simple/t/exit...............FAILED at test 1
The above failures are known as of 5.8.0 with native builds with long filenames, but there are a few more if running under dosemu because of limitations (and maybe bugs) of dosemu:
t/comp/cpp...........................FAILED at test 3
t/op/inccode.........................(crash)
and a few lib/ExtUtils tests, and several hundred Encode/t/Aliases.t failures that work fine with long filenames. So you really might prefer native builds and long filenames.
p58-FreeBSD built with ithreads coredumps reading large directories
This is a known bug in FreeBSD 4.5's readdir_r(), it has been fixed in FreeBSD 4.6 (see perlfreebsd (README.freebsd)).
p58-FreeBSD Failing locale Test 117 For ISO 8859-15 Locales
The ISO 8859-15 locales may fail the locale test 117 in FreeBSD. This is caused by the characters \xFF (y with diaeresis) and \xBE (Y with diaeresis) not behaving correctly when being matched case-insensitively. Apparently this problem has been fixed in the latest FreeBSD releases. ( http://www.freebsd.org/cgi/query-pr.cgi?pr=34308 )
p58-IRIX fails ext/List/Util/t/shuffle.t or Digest::MD5
IRIX with MIPSpro 7.3.1.2m or 7.3.1.3m compiler may fail the List::Util test ext/List/Util/t/shuffle.t by dumping core. This seems to be a compiler error since if compiled with gcc no core dump ensues, and no failures have been seen on the said test on any other platform.
Similarly, building the Digest::MD5 extension has been known to fail with "*** Termination code 139 (bu21)".
The cure is to drop optimization level (Configure -Doptimize=-O2).
p58-HP-UX lib/posix Subtest 9 Fails When LP64-Configured
If perl is configured with -Duse64bitall, the successful result of the subtest 10 of lib/posix may arrive before the successful result of the subtest 9, which confuses the test harness so much that it thinks the subtest 9 failed.
p58-Linux with glibc 2.2.5 fails t/op/int subtest #6 with -Duse64bitint
This is a known bug in the glibc 2.2.5 with long long integers. ( http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=65612 )
p58-Linux With Sfio Fails op/misc Test 48
No known fix.
p58-Mac OS X
Please remember to set your environment variable LC_ALL to "C" (setenv LC_ALL C) before running "make test" to avoid a lot of warnings about the broken locales of Mac OS X.
The following tests are known to fail in Mac OS X 10.1.5 because of buggy (old) implementations of Berkeley DB included in Mac OS X:
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------
../ext/DB_File/t/db-btree.t 0 11 ?? ?? % ??
../ext/DB_File/t/db-recno.t 149 3 2.01% 61 63 65
If you are building on a UFS partition, you will also probably see t/op/stat.t subtest #9 fail. This is caused by Darwin's UFS not supporting inode change time.
Also the ext/POSIX/t/posix.t subtest #10 fails but it is skipped for now because the failure is Apple's fault, not Perl's (blocked signals are lost).
If you Configure with ithreads, ext/threads/t/libc.t will fail. Again, this is not Perl's fault-- the libc of Mac OS X is not threadsafe (in this particular test, the localtime() call is found to be threadunsafe.)
p58-Mac OS X dyld undefined symbols
If after installing Perl 5.8.0 you are getting warnings about missing symbols, for example
dyld: perl Undefined symbols
_perl_sv_2pv
_perl_get_sv
you probably have an old pre-Perl-5.8.0 installation (or parts of one) in /Library/Perl (the undefined symbols used to exist in pre-5.8.0 Perls). It seems that for some reason "make install" doesn't always completely overwrite the files in /Library/Perl. You can move the old Perl shared library out of the way like this:
cd /Library/Perl/darwin/CORE
mv libperl.dylib libperlold.dylib
and then reissue "make install". Note that the above of course is extremely disruptive for anything using the /usr/local/bin/perl. If that doesn't help, you may have to try removing all the .bundle files from beneath /Library/Perl, and again "make install"-ing.
p58-OS/2 Test Failures
The following tests are known to fail on OS/2 (for clarity only the failures are shown, not the full error messages):
../lib/ExtUtils/t/Mkbootstrap.t 1 256 18 1 5.56% 8
../lib/ExtUtils/t/Packlist.t 1 256 34 1 2.94% 17
../lib/ExtUtils/t/basic.t 1 256 17 1 5.88% 14
lib/os2_process.t 2 512 227 2 0.88% 174 209
lib/os2_process_kid.t 227 2 0.88% 174 209
lib/rx_cmprt.t 255 65280 18 3 16.67% 16-18
p58-op/sprintf tests 91, 129, and 130
The op/sprintf tests 91, 129, and 130 are known to fail on some platforms. Examples include any platform using sfio, and Compaq/Tandem's NonStop-UX.
Test 91 is known to fail on QNX6 (nto), because sprintf '%e',0
incorrectly produces 0.000000e+0
instead of 0.000000e+00
.
For tests 129 and 130, the failing platforms do not comply with the ANSI C Standard: lines 19ff on page 134 of ANSI X3.159 1989, to be exact. (They produce something other than "1" and "-1" when formatting 0.6 and -0.6 using the printf format "%.0f"; most often, they produce "0" and "-0".)
p58-SCO
The socketpair tests are known to be unhappy in SCO 3.2v5.0.4:
ext/Socket/socketpair.t...............FAILED tests 15-45
p58-Solaris 2.5
In case you are still using Solaris 2.5 (aka SunOS 5.5), you may experience failures (the test core dumping) in lib/locale.t. The suggested cure is to upgrade your Solaris.
p58-Solaris x86 Fails Tests With -Duse64bitint
The following tests are known to fail in Solaris x86 with Perl configured to use 64 bit integers:
ext/Data/Dumper/t/dumper.............FAILED at test 268
ext/Devel/Peek/Peek..................FAILED at test 7
p58-SUPER-UX (NEC SX)
The following tests are known to fail on SUPER-UX:
op/64bitint...........................FAILED tests 29-30, 32-33, 35-36
op/arith..............................FAILED tests 128-130
op/pack...............................FAILED tests 25-5625
op/pow................................
op/taint..............................# msgsnd failed
../ext/IO/lib/IO/t/io_poll............FAILED tests 3-4
../ext/IPC/SysV/ipcsysv...............FAILED tests 2, 5-6
../ext/IPC/SysV/t/msg.................FAILED tests 2, 4-6
../ext/Socket/socketpair..............FAILED tests 12
../lib/IPC/SysV.......................FAILED tests 2, 5-6
../lib/warnings.......................FAILED tests 115-116, 118-119
The op/pack failure ("Cannot compress negative numbers at op/pack.t line 126") is serious but as of yet unsolved. It points at some problems with the signedness handling of the C compiler, as do the 64bitint, arith, and pow failures. Most of the rest point at problems with SysV IPC.
p58-Term::ReadKey not working on Win32
Use Term::ReadKey 2.20 or later.
p58-UNICOS/mk
- During Configure, the test
Guessing which symbols your C compiler and preprocessor define...
will probably fail with error messages like
CC-20 cc: ERROR File = try.c, Line = 3
The identifier "bad" is undefined.
bad switch yylook 79bad switch yylook 79bad switch yylook 79bad switch yylook 79#ifdef A29K
^
CC-65 cc: ERROR File = try.c, Line = 3
A semicolon is expected at this point.
This is caused by a bug in the awk utility of UNICOS/mk. You can ignore the error, but it does cause a slight problem: you cannot fully benefit from the h2ph utility (see h2ph) that can be used to convert C headers to Perl libraries, mainly used to be able to access from Perl the constants defined using C preprocessor, cpp. Because of the above error, parts of the converted headers will be invisible. Luckily, these days the need for h2ph is rare.
- If building Perl with interpreter threads (ithreads), the getgrent(), getgrnam(), and getgrgid() functions cannot return the list of the group members due to a bug in the multithreaded support of UNICOS/mk. What this means is that in list context the functions will return only three values, not four.
p58-UTS
There are a few known test failures, see perluts (README.uts).
p58-VOS (Stratus)
When Perl is built using the native build process on VOS Release 14.5.0 and GNU C++/GNU Tools 2.0.1, all attempted tests either pass or result in TODO (ignored) failures.
p58-VMS
There should be no reported test failures with a default configuration, though there are a number of tests marked TODO that point to areas needing further debugging and/or porting work.
p58-Win32
In multi-CPU boxes, there are some problems with the I/O buffering: some output may appear twice.
p58-XML::Parser not working
Use XML::Parser 2.31 or later.
p58-z/OS (OS/390)
z/OS has rather many test failures but the situation is actually much better than it was in 5.6.0; it's just that so many new modules and tests have been added.
Failed Test Stat Wstat Total Fail Failed List of Failed
---------------------------------------------------------------------------
../ext/Data/Dumper/t/dumper.t 357 8 2.24% 311 314 325 327
331 333 337 339
../ext/IO/lib/IO/t/io_unix.t 5 4 80.00% 2-5
../ext/Storable/t/downgrade.t 12 3072 169 12 7.10% 14-15 46-47 78-79
110-111 150 161
../lib/ExtUtils/t/Constant.t 121 30976 48 48 100.00% 1-48
../lib/ExtUtils/t/Embed.t 9 9 100.00% 1-9
op/pat.t 922 7 0.76% 665 776 785 832-
834 845
op/sprintf.t 224 3 1.34% 98 100 136
op/tr.t 97 5 5.15% 63 71-74
uni/fold.t 780 6 0.77% 61 169 196 661
710-711
The failures in dumper.t and downgrade.t are problems in the tests, those in io_unix and sprintf are problems in the USS (UDP sockets and printf formats). The pat, tr, and fold failures are genuine Perl problems caused by EBCDIC (and in the pat and fold cases, combining that with Unicode). The Constant and Embed are probably problems in the tests (since they test Perl's ability to build extensions, and that seems to be working reasonably well.)
p58-Unicode Support on EBCDIC Still Spotty
Though mostly working, Unicode support still has problem spots on EBCDIC platforms. One such known spot are the \p{}
and \P{}
regular expression constructs for code points less than 256: the pP
are testing for Unicode code points, not knowing about EBCDIC.
p58-Seen In Perl 5.7 But Gone Now
Time::Piece
(previously known as Time::Object
) was removed because it was felt that it didn't have enough value in it to be a core module. It is still a useful module, though, and is available from the CPAN.
Perl 5.8 unfortunately does not build anymore on AmigaOS; this broke accidentally at some point. Since there are not that many Amiga developers available, we could not get this fixed and tested in time for 5.8.0. Perl 5.6.1 still works for AmigaOS (as does the 5.7.2 development release).
The PerlIO::Scalar
and PerlIO::Via
(capitalised) were renamed as PerlIO::scalar
and PerlIO::via
(all lowercase) just before 5.8.0. The main rationale was to have all core PerlIO layers to have all lowercase names. The "plugins" are named as usual, for example PerlIO::via::QuotedPrint
.
The threads::shared::queue
and threads::shared::semaphore
were renamed as Thread::Queue
and Thread::Semaphore
just before 5.8.0. The main rationale was to have thread modules to obey normal naming, Thread::
(the threads
and threads::shared
themselves are more pragma-like, they affect compile-time, so they stay lowercase).
p58-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ . There may also be information at http://www.perl.com/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
p58-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p58-HISTORY
Written by Jarkko Hietaniemi <jhi@iki.fi>.
p573-NAME
perl573delta - what's new for perl v5.7.3
p573-DESCRIPTION
This document describes differences between the 5.7.2 release and the 5.7.3 release.
(To view the differences between the 5.6.0 release and the 5.7.0 release, see "p570-NAME". To view the differences between the 5.7.0 release and the 5.7.1 release, see "p571-NAME". To view the differences between the 5.7.1 release and the 5.7.2 release, see "p572-NAME".)
p573-Changes
This is just a selected list of some of the more notable changes. The numbers refer to the Perl repository change numbers; see Changes58 (or Changes in Perl 5.8.1). In addition to these changes, lots of work took place in integrating threads, PerlIO, and Unicode; general code cleanup; and last but not least porting to non-Unix lands such as Win32, VMS, Cygwin, DJGPP, VOS, MacOS Classic, and EBCDIC.
- p573-11362
-
add LC_MESSAGES to POSIX :locale_h export tag
- p573-11371
-
add DEL to [:cntrl:]
- p573-11375
-
make h2ph understand constants like 1234L and 5678LL
- p573-11405
-
Win32: fix bugs in handling of the virtualized environment
- p573-11410
-
fix a bug in the security taint checking of open()
- p573-11423
-
make perl fork() safe even on platforms that don't have pthread_atfork()
- p573-11459
-
make switching optimization and debugging levels during Perl builds easier via the OPTIMIZE environment variable
- p573-11475
-
make split()'s unused captures to be undef, not ''
- p573-11485
-
Search::Dict: allow transforming lines before comparing
- p573-11490
-
allow installing extra modules or bundles when building Perl
- p573-11516
-
add -Wall in cflags when compiling with gcc to weed out dubious C practices
- p573-11541
-
pluggable optimizer
- p573-11549
-
WinCE: integrate the port
- p573-11589
-
Win32: 4-arg select was broken
- p573-11594
-
introduce the perlivp utility for verifying the Perl installation (IVP = Installation Verification Procedure)
- p573-11623
-
rename lib/unicode to lib/unicore to avoid case-insensitivity problems with lib/Unicode
- p573-111631
-
remove Time::Piece
- p573-11643
-
document that use utf8 is not the right way most of the time
- p573-11656
-
allow building perl with -DUSE_UTF8_SCRIPTS which makes UTF-8 the default script encoding (not the default since that would break all scripts having legacy eight-bit data in them)
- p573-11725
-
division preserving 64-bit integers
- p573-11743
-
document the coderef-in-@INC feature
- p573-11794
-
modulo (%) preserving 64-bit integers
- p573-11825
-
update to Unicode 3.1.1
- p573-11865
-
add the \[$@%&*] prototype support
- p573-11874
-
oct() and hex() in glorious 64 bit
- p573-11877
-
Class::Struct: allow recursive classes
- p573-11993
-
fix unpack U to be the reverse of pack U
- p573-12056
-
VMS: waitpid enhancements
- p573-12180
-
unpack("Z*Z*", pack("Z*Z*", ..)) was broken
- p573-12243
-
Devel::Peek: display UTF-8 SVs also as \x{...}
- p573-12288
-
Data::Dumper: option to sort hashes
- p573-12542
-
add perlpodspec
- p573-12652
-
threadsafe DynaLoader, re, Opcode, File::Glob, and B
- p573-12756
-
support BeOS better
- p573-12874
-
read-only hashes (user-level interface is Hash::Util)
- p573-13162
-
add Devel::PPPort
- p573-13179
-
add the sort pragma
- p573-13326
-
VMS: fix perl -P
- p573-13358
-
add perlpacktut
- p573-13452
-
SUPER-UX: add hints file
- p573-13575
-
Win32: non-blocking waitpid(-1,WNOHANG)
- p573-13684
-
introduce the -t option for gentler taint checking
- p573-14694
-
add the if pragma
- p573-14832
-
implement IV/UV/NV/long double un/packing with j/J/F/D
- p573-14854
-
document the new taint behaviour of exec LIST and system LIST
p573-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org. There may also be information at http://www.perl.com/, the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
p573-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p573-HISTORY
Written by Jarkko Hietaniemi <jhi@iki.fi>, with many contributions from The Perl Porters and Perl Users submitting feedback and patches.
Send omissions or corrections to <perlbug@perl.org>.
p572-NAME
perl572delta - what's new for perl v5.7.2
p572-DESCRIPTION
This document describes differences between the 5.7.1 release and the 5.7.2 release.
(To view the differences between the 5.6.0 release and the 5.7.0 release, see "p570-NAME". To view the differences between the 5.7.0 release and the 5.7.1 release, see "p571-NAME".)
p572-Security Vulnerability Closed
(This change was already made in 5.7.0 but bears repeating here.)
A security vulnerability affecting all Perl versions prior to 5.6.1 was found in August 2000. The vulnerability does not affect default installations and as far as is known affects only the Linux platform.
You should upgrade your Perl to 5.6.1 as soon as possible. Patches for earlier releases exist but using the patches require full recompilation from the source code anyway, so 5.6.1 is your best choice.
See http://www.cpan.org/src/5.0/sperl-2000-08-05/sperl-2000-08-05.txt for more information.
p572-Incompatible Changes
p572-64-bit platforms and malloc
If your pointers are 64 bits wide, the Perl malloc is no more being used because it simply does not work with 8-byte pointers. Also, usually the system malloc on such platforms are much better optimized for such large memory models than the Perl malloc.
p572-AIX Dynaloading
The AIX dynaloading now uses in AIX releases 4.3 and newer the native dlopen interface of AIX instead of the old emulated interface. This change will probably break backward compatibility with compiled modules. The change was made to make Perl more compliant with other applications like modperl which are using the AIX native interface.
p572-Socket Extension Dynamic in VMS
The Socket extension is now dynamically loaded instead of being statically built in. This may or may not be a problem with ancient TCP/IP stacks of VMS: we do not know since we weren't able to test Perl in such configurations.
p572-Different Definition of the Unicode Character Classes \p{In...}
As suggested by the Unicode consortium, the Unicode character classes now prefer scripts as opposed to blocks (as defined by Unicode); in Perl, when the \p{In....}
and the \p{In....}
regular expression constructs are used. This has changed the definition of some of those character classes.
The difference between scripts and blocks is that scripts are the glyphs used by a language or a group of languages, while the blocks are more artificial groupings of 256 characters based on the Unicode numbering.
In general this change results in more inclusive Unicode character classes, but changes to the other direction also do take place: for example while the script Latin
includes all the Latin characters and their various diacritic-adorned versions, it does not include the various punctuation or digits (since they are not solely Latin
).
Changes in the character class semantics may have happened if a script and a block happen to have the same name, for example Hebrew
. In such cases the script wins and \p{InHebrew}
now means the script definition of Hebrew. The block definition in still available, though, by appending Block
to the name: \p{InHebrewBlock}
means what \p{InHebrew}
meant in perl 5.6.0. For the full list of affected character classes, see "Blocks" in perlunicode.
p572-Deprecations
The current user-visible implementation of pseudo-hashes (the weird use of the first array element) is deprecated starting from Perl 5.8.0 and will be removed in Perl 5.10.0, and the feature will be implemented differently. Not only is the current interface rather ugly, but the current implementation slows down normal array and hash use quite noticeably. The fields
pragma interface will remain available.
The syntaxes @a->[...]
and @h->{...}
have now been deprecated.
The suidperl is also considered to be too much a risk to continue maintaining and the suidperl code is likely to be removed in a future release.
The package;
syntax (package
without an argument has been deprecated. Its semantics were never that clear and its implementation even less so. If you have used that feature to disallow all but fully qualified variables, use strict;
instead.
The chdir(undef) and chdir('') behaviors to match chdir() has been deprecated. In future versions, chdir(undef) and chdir('') will simply fail.
p572-Core Enhancements
In general a lot of fixing has happened in the area of Perl's understanding of numbers, both integer and floating point. Since in many systems the standard number parsing functions like strtoul()
and atof()
seem to have bugs, Perl tries to work around their deficiencies. This results hopefully in more accurate numbers.
- The rules for allowing underscores (underbars) in numeric constants have been relaxed and simplified: now you can have an underscore between digits.
- GMAGIC (right-hand side magic) could in many cases such as string concatenation be invoked too many times.
- Lexicals I: lexicals outside an eval "" weren't resolved correctly inside a subroutine definition inside the eval "" if they were not already referenced in the top level of the eval""ed code.
- Lexicals II: lexicals leaked at file scope into subroutines that were declared before the lexicals.
- Lvalue subroutines can now return
undef
in list context.
- The
op_clear
and op_null
are now exported.
- A new special regular expression variable has been introduced:
$^N
, which contains the most-recently closed group (submatch).
- utime now supports
utime undef, undef, @files
to change the file timestamps to the current time.
- The Perl parser has been stress tested using both random input and Markov chain input.
eval "v200"
now works.
- VMS now works under PerlIO.
- END blocks are now run even if you exit/die in a BEGIN block. The execution of END blocks is now controlled by PL_exit_flags & PERL_EXIT_DESTRUCT_END. This enables the new behaviour for perl embedders. This will default in 5.10. See perlembed.
p572-Modules and Pragmata
p572-New Modules and Distributions
- Attribute::Handlers - Simpler definition of attribute handlers
- ExtUtils::Constant - generate XS code to import C header constants
- I18N::Langinfo - query locale information
- I18N::LangTags - functions for dealing with RFC3066-style language tags
- libnet - a collection of perl5 modules related to network programming
Perl installation leaves libnet unconfigured, use libnetcfg to configure.
- List::Util - selection of general-utility list subroutines
- Locale::Maketext - framework for localization
- Memoize - Make your functions faster by trading space for time
- NEXT - pseudo-class for method redispatch
- Scalar::Util - selection of general-utility scalar subroutines
- Test::More - yet another framework for writing test scripts
- Test::Simple - Basic utilities for writing tests
- Time::HiRes - high resolution ualarm, usleep, and gettimeofday
- Time::Piece - Object Oriented time objects
(Previously known as Time::Object.)
- Time::Seconds - a simple API to convert seconds to other date values
- UnicodeCD - Unicode Character Database
p572-Updated And Improved Modules and Pragmata
- B::Deparse module has been significantly enhanced. It now can deparse almost all of the standard test suite (so that the tests still succeed). There is a make target "test.deparse" for trying this out.
- Class::Struct now assigns the array/hash element if the accessor is called with an array/hash element as the sole argument.
- Cwd extension is now (even) faster.
- DB_File extension has been updated to version 1.77.
- Fcntl, Socket, and Sys::Syslog have been rewritten to use the new-style constant dispatch section (see ExtUtils::Constant).
- File::Find is now (again) reentrant. It also has been made more portable.
- File::Glob now supports
GLOB_LIMIT
constant to limit the size of the returned list of filenames.
- IO::Socket::INET now supports
LocalPort
of zero (usually meaning that the operating system will make one up.)
- The vars pragma now supports declaring fully qualified variables. (Something that
our()
does not and will not support.)
p572-Utility Changes
- The emacs/e2ctags.pl is now much faster.
- h2ph now supports C trigraphs.
- h2xs uses the new ExtUtils::Constant module which will affect newly created extensions that define constants. Since the new code is more correct (if you have two constants where the first one is a prefix of the second one, the first constant never gets defined), less lossy (it uses integers for integer constant, as opposed to the old code that used floating point numbers even for integer constants), and slightly faster, you might want to consider regenerating your extension code (the new scheme makes regenerating easy). h2xs now also supports C trigraphs.
- libnetcfg has been added to configure the libnet.
- The Pod::Html (and thusly pod2html) now allows specifying a cache directory.
p572-New Documentation
- Locale::Maketext::TPJ13 is an article about software localization, originally published in The Perl Journal #13, republished here with kind permission.
- More README.$PLATFORM files have been converted into pod, which also means that they also be installed as perl$PLATFORM documentation files. The new files are perlapollo, perlbeos, perldgux, perlhurd, perlmint, perlnetware, perlplan9, perlqnx, and perltru64.
- The Todo and Todo-5.6 files have been merged into perltodo.
- Use of the gprof tool to profile Perl has been documented in perlhack. There is a make target "perl.gprof" for generating a gprofiled Perl executable.
p572-Installation and Configuration Improvements
p572-New Or Improved Platforms
- AIX should now work better with gcc, threads, and 64-bitness. Also the long doubles support in AIX should be better now. See perlaix.
- AtheOS ( http://www.atheos.cx/ ) is a new platform.
- DG/UX platform now supports the 5.005-style threads. See perldgux.
- DYNIX/ptx platform (a.k.a. dynixptx) is supported at or near osvers 4.5.2.
- Several Mac OS (Classic) portability patches have been applied. We hope to get a fully working port by 5.8.0. (The remaining problems relate to the changed IO model of Perl.) See perlmacos.
- Mac OS X (or Darwin) should now be able to build Perl even on HFS+ filesystems. (The case-insensitivity confused the Perl build process.)
- NetWare from Novell is now supported. See perlnetware.
- The Amdahl UTS Unix mainframe platform is now supported.
p572-Generic Improvements
- In AFS installations one can configure the root of the AFS to be somewhere else than the default /afs by using the Configure parameter
-Dafsroot=/some/where/else
.
- The version of Berkeley DB used when the Perl (and, presumably, the DB_File extension) was built is now available as
@Config{qw(db_version_major db_version_minor db_version_patch)}
from Perl and as DB_VERSION_MAJOR_CFG DB_VERSION_MINOR_CFG DB_VERSION_PATCH_CFG
from C.
- The Thread extension is now not built at all under ithreads (
Configure -Duseithreads
) because it wouldn't work anyway (the Thread extension requires being Configured with -Duse5005threads
).
- The
B::Deparse
compiler backend has been so significantly improved that almost the whole Perl test suite passes after being deparsed. A make target has been added to help in further testing: make test.deparse
.
p572-Selected Bug Fixes
- The autouse pragma didn't work for Multi::Part::Function::Names.
- The behaviour of non-decimal but numeric string constants such as "0x23" was platform-dependent: in some platforms that was seen as 35, in some as 0, in some as a floating point number (don't ask). This was caused by Perl using the operating system libraries in a situation where the result of the string to number conversion is undefined: now Perl consistently handles such strings as zero in numeric contexts.
- dprofpp -R didn't work.
- PERL5OPT with embedded spaces didn't work.
- Sys::Syslog ignored the
LOG_AUTH
constant.
p572-Platform Specific Changes and Fixes
- Some versions of glibc have a broken modfl(). This affects builds with
-Duselongdouble
. This version of Perl detects this brokenness and has a workaround for it. The glibc release 2.2.2 is known to have fixed the modfl() bug.
p572-New or Changed Diagnostics
- In the regular expression diagnostics the
<< HERE
marker introduced in 5.7.0 has been changed to be <-- HERE
since too many people found the <<
to be too similar to here-document starters.
- If you try to "pack" in perlfunc a number less than 0 or larger than 255 using the
"C"
format you will get an optional warning. Similarly for the "c"
format and a number less than -128 or more than 127.
- Certain regex modifiers such as
(?o)
make sense only if applied to the entire regex. You will an optional warning if you try to do otherwise.
- Using arrays or hashes as references (e.g.
%foo->{bar}
has been deprecated for a while. Now you will get an optional warning.
p572-Source Code Enhancements
p572-MAGIC constants
The MAGIC constants (e.g. 'P'
) have been macrofied (e.g. PERL_MAGIC_TIED
) for better source code readability and maintainability.
p572-Better commented code
perly.c, sv.c, and sv.h have now been extensively commented.
p572-Regex pre-/post-compilation items matched up
The regex compiler now maintains a structure that identifies nodes in the compiled bytecode with the corresponding syntactic features of the original regex expression. The information is attached to the new offsets
member of the struct regexp
. See perldebguts for more complete information.
p572-gcc -Wall
The C code has been made much more gcc -Wall
clean. Some warning messages still remain, though, so if you are compiling with gcc you will see some warnings about dubious practices. The warnings are being worked on.
p572-New Tests
Several new tests have been added, especially for the lib subsection.
The tests are now reported in a different order than in earlier Perls. (This happens because the test scripts from under t/lib have been moved to be closer to the library/extension they are testing.)
p572-Known Problems
Note that unlike other sections in this document (which describe changes since 5.7.0) this section is cumulative containing known problems for all the 5.7 releases.
p572-AIX
- In AIX 4.2 Perl extensions that use C++ functions that use statics may have problems in that the statics are not getting initialized. In newer AIX releases this has been solved by linking Perl with the libC_r library, but unfortunately in AIX 4.2 the said library has an obscure bug where the various functions related to time (such as time() and gettimeofday()) return broken values, and therefore in AIX 4.2 Perl is not linked against the libC_r.
- vac 5.0.0.0 May Produce Buggy Code For Perl
The AIX C compiler vac version 5.0.0.0 may produce buggy code, resulting in few random tests failing, but when the failing tests are run by hand, they succeed. We suggest upgrading to at least vac version 5.0.1.0, that has been known to compile Perl correctly. "lslpp -L|grep vac.C" will tell you the vac version.
p572-Amiga Perl Invoking Mystery
One cannot call Perl using the volume:
syntax, that is, perl -v
works, but for example bin:perl -v
doesn't. The exact reason is known but the current suspect is the ixemul library.
p572-lib/ftmp-security tests warn 'system possibly insecure'
Don't panic. Read INSTALL 'make test' section instead.
p572-Cygwin intermittent failures of lib/Memoize/t/expire_file 11 and 12
The subtests 11 and 12 sometimes fail and sometimes work.
p572-HP-UX lib/io_multihomed Fails When LP64-Configured
The lib/io_multihomed test may hang in HP-UX if Perl has been configured to be 64-bit. Because other 64-bit platforms do not hang in this test, HP-UX is suspect. All other tests pass in 64-bit HP-UX. The test attempts to create and connect to "multihomed" sockets (sockets which have multiple IP addresses).
p572-HP-UX lib/posix Subtest 9 Fails When LP64-Configured
If perl is configured with -Duse64bitall, the successful result of the subtest 10 of lib/posix may arrive before the successful result of the subtest 9, which confuses the test harness so much that it thinks the subtest 9 failed.
p572-Linux With Sfio Fails op/misc Test 48
No known fix.
p572-OS/390
OS/390 has rather many test failures but the situation is actually better than it was in 5.6.0, it's just that so many new modules and tests have been added.
Failed Test Stat Wstat Total Fail Failed List of Failed
-----------------------------------------------------------------------------
../ext/B/Deparse.t 14 1 7.14% 14
../ext/B/Showlex.t 1 1 100.00% 1
../ext/Encode/Encode/Tcl.t 610 13 2.13% 592 594 596 598
600 602 604-610
../ext/IO/lib/IO/t/io_unix.t 113 28928 5 3 60.00% 3-5
../ext/POSIX/POSIX.t 29 1 3.45% 14
../ext/Storable/t/lock.t 255 65280 5 3 60.00% 3-5
../lib/locale.t 129 33024 117 19 16.24% 99-117
../lib/warnings.t 434 1 0.23% 75
../lib/ExtUtils.t 27 1 3.70% 25
../lib/Math/BigInt/t/bigintpm.t 1190 1 0.08% 1145
../lib/Unicode/UCD.t 81 48 59.26% 1-16 49-64 66-81
../lib/User/pwent.t 9 1 11.11% 4
op/pat.t 660 6 0.91% 242-243 424-425
626-627
op/split.t 0 9 ?? ?? % ??
op/taint.t 174 3 1.72% 156 162 168
op/tr.t 70 3 4.29% 50 58-59
Failed 16/422 test scripts, 96.21% okay. 105/23251 subtests failed, 99.55% okay.
p572-op/sprintf tests 129 and 130
The op/sprintf tests 129 and 130 are known to fail on some platforms. Examples include any platform using sfio, and Compaq/Tandem's NonStop-UX. The failing platforms do not comply with the ANSI C Standard, line 19ff on page 134 of ANSI X3.159 1989 to be exact. (They produce something other than "1" and "-1" when formatting 0.6 and -0.6 using the printf format "%.0f", most often they produce "0" and "-0".)
p572-Failure of Thread tests
Note that support for 5.005-style threading remains experimental.
The following tests are known to fail due to fundamental problems in the 5.005 threading implementation. These are not new failures--Perl 5.005_0x has the same bugs, but didn't have these tests.
lib/autouse.t 4
t/lib/thr5005.t 19-20
p572-UNICOS
- ext/POSIX/sigaction subtests 6 and 13 may fail.
- lib/ExtUtils may spuriously claim that subtest 28 failed, which is interesting since the test only has 27 tests.
- Numerous numerical test failures
op/numconvert 209,210,217,218
op/override 7
ext/Time/HiRes/HiRes 9
lib/Math/BigInt/t/bigintpm 1145
lib/Math/Trig 25
These tests fail because of yet unresolved floating point inaccuracies.
p572-UTS
There are a few known test failures, see perluts.
p572-VMS
Rather many tests are failing in VMS but that actually more tests succeed in VMS than they used to, it's just that there are many, many more tests than there used to be.
Here are the known failures from some compiler/platform combinations.
DEC C V5.3-006 on OpenVMS VAX V6.2
[-.ext.list.util.t]tainted..............FAILED on test 3
[-.ext.posix]sigaction..................FAILED on test 7
[-.ext.time.hires]hires.................FAILED on test 14
[-.lib.file.find]taint..................FAILED on test 17
[-.lib.math.bigint.t]bigintpm...........FAILED on test 1183
[-.lib.test.simple.t]exit...............FAILED on test 1
[.lib]vmsish............................FAILED on test 13
[.op]sprintf............................FAILED on test 12
Failed 8/399 tests, 91.23% okay.
DEC C V6.0-001 on OpenVMS Alpha V7.2-1 and Compaq C V6.2-008 on OpenVMS Alpha V7.1
[-.ext.list.util.t]tainted..............FAILED on test 3
[-.lib.file.find]taint..................FAILED on test 17
[-.lib.test.simple.t]exit...............FAILED on test 1
[.lib]vmsish............................FAILED on test 13
Failed 4/399 tests, 92.48% okay.
Compaq C V6.4-005 on OpenVMS Alpha 7.2.1
[-.ext.b]showlex........................FAILED on test 1
[-.ext.list.util.t]tainted..............FAILED on test 3
[-.lib.file.find]taint..................FAILED on test 17
[-.lib.test.simple.t]exit...............FAILED on test 1
[.lib]vmsish............................FAILED on test 13
[.op]misc...............................FAILED on test 49
Failed 6/401 tests, 92.77% okay.
p572-Win32
In multi-CPU boxes there are some problems with the I/O buffering: some output may appear twice.
p572-Localising a Tied Variable Leaks Memory
use Tie::Hash;
tie my %tie_hash => 'Tie::StdHash';
...
local($tie_hash{Foo}) = 1; # leaks
Code like the above is known to leak memory every time the local() is executed.
p572-Self-tying of Arrays and Hashes Is Forbidden
Self-tying of arrays and hashes is broken in rather deep and hard-to-fix ways. As a stop-gap measure to avoid people from getting frustrated at the mysterious results (core dumps, most often) it is for now forbidden (you will get a fatal error even from an attempt).
p572-Variable Attributes are not Currently Usable for Tying
This limitation will hopefully be fixed in future. (Subroutine attributes work fine for tying, see Attribute::Handlers).
p572-Building Extensions Can Fail Because Of Largefiles
Some extensions like mod_perl are known to have issues with `largefiles', a change brought by Perl 5.6.0 in which file offsets default to 64 bits wide, where supported. Modules may fail to compile at all or compile and work incorrectly. Currently there is no good solution for the problem, but Configure now provides appropriate non-largefile ccflags, ldflags, libswanted, and libs in the %Config hash (e.g., $Config{ccflags_nolargefiles}) so the extensions that are having problems can try configuring themselves without the largefileness. This is admittedly not a clean solution, and the solution may not even work at all. One potential failure is whether one can (or, if one can, whether it's a good idea) link together at all binaries with different ideas about file offsets, all this is platform-dependent.
p572-The Compiler Suite Is Still Experimental
The compiler suite is slowly getting better but is nowhere near working order yet.
p572-The Long Double Support is Still Experimental
The ability to configure Perl's numbers to use "long doubles", floating point numbers of hopefully better accuracy, is still experimental. The implementations of long doubles are not yet widespread and the existing implementations are not quite mature or standardised, therefore trying to support them is a rare and moving target. The gain of more precision may also be offset by slowdown in computations (more bits to move around, and the operations are more likely to be executed by less optimised libraries).
p572-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ There may also be information at http://www.perl.com/perl/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
p572-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p572-HISTORY
Written by Jarkko Hietaniemi <jhi@iki.fi>, with many contributions from The Perl Porters and Perl Users submitting feedback and patches.
Send omissions or corrections to <perlbug@perl.org>.
p571-NAME
perl571delta - what's new for perl v5.7.1
p571-DESCRIPTION
This document describes differences between the 5.7.0 release and the 5.7.1 release.
(To view the differences between the 5.6.0 release and the 5.7.0 release, see "p570-NAME".)
p571-Security Vulnerability Closed
(This change was already made in 5.7.0 but bears repeating here.)
A potential security vulnerability in the optional suidperl component of Perl was identified in August 2000. suidperl is neither built nor installed by default. As of April 2001 the only known vulnerable platform is Linux, most likely all Linux distributions. CERT and various vendors and distributors have been alerted about the vulnerability. See http://www.cpan.org/src/5.0/sperl-2000-08-05/sperl-2000-08-05.txt for more information.
The problem was caused by Perl trying to report a suspected security exploit attempt using an external program, /bin/mail. On Linux platforms the /bin/mail program had an undocumented feature which when combined with suidperl gave access to a root shell, resulting in a serious compromise instead of reporting the exploit attempt. If you don't have /bin/mail, or if you have 'safe setuid scripts', or if suidperl is not installed, you are safe.
The exploit attempt reporting feature has been completely removed from all the Perl 5.7 releases (and will be gone also from the maintenance release 5.6.1), so that particular vulnerability isn't there anymore. However, further security vulnerabilities are, unfortunately, always possible. The suidperl code is being reviewed and if deemed too risky to continue to be supported, it may be completely removed from future releases. In any case, suidperl should only be used by security experts who know exactly what they are doing and why they are using suidperl instead of some other solution such as sudo ( see http://www.courtesan.com/sudo/ ).
p571-Incompatible Changes
- Although "you shouldn't do that", it was possible to write code that depends on Perl's hashed key order (Data::Dumper does this). The new algorithm "One-at-a-Time" produces a different hashed key order. More details are in "p571-Performance Enhancements".
- The list of filenames from glob() (or <...>) is now by default sorted alphabetically to be csh-compliant. (bsd_glob() does still sort platform natively, ASCII or EBCDIC, unless GLOB_ALPHASORT is specified.)
p571-Core Enhancements
p571-AUTOLOAD Is Now Lvaluable
AUTOLOAD is now lvaluable, meaning that you can add the :lvalue attribute to AUTOLOAD subroutines and you can assign to the AUTOLOAD return value.
p571-PerlIO is Now The Default
- IO is now by default done via PerlIO rather than system's "stdio". PerlIO allows "layers" to be "pushed" onto a file handle to alter the handle's behaviour. Layers can be specified at open time via 3-arg form of open:
open($fh,'>:crlf :utf8', $path) || ...
or on already opened handles via extended binmode
:
binmode($fh,':encoding(iso-8859-7)');
The built-in layers are: unix (low level read/write), stdio (as in previous Perls), perlio (re-implementation of stdio buffering in a portable manner), crlf (does CRLF <=> "\n" translation as on Win32, but available on any platform). A mmap layer may be available if platform supports it (mostly Unixes).
Layers to be applied by default may be specified via the 'open' pragma.
See "p571-Installation and Configuration Improvements" for the effects of PerlIO on your architecture name.
- File handles can be marked as accepting Perl's internal encoding of Unicode (UTF-8 or UTF-EBCDIC depending on platform) by a pseudo layer ":utf8" :
open($fh,">:utf8","Uni.txt");
Note for EBCDIC users: the pseudo layer ":utf8" is erroneously named for you since it's not UTF-8 what you will be getting but instead UTF-EBCDIC. See perlunicode, utf8, and http://www.unicode.org/unicode/reports/tr16/ for more information. In future releases this naming may change.
- File handles can translate character encodings from/to Perl's internal Unicode form on read/write via the ":encoding()" layer.
- File handles can be opened to "in memory" files held in Perl scalars via:
open($fh,'>', \$variable) || ...
- Anonymous temporary files are available without need to 'use FileHandle' or other module via
open($fh,"+>", undef) || ...
That is a literal undef, not an undefined value.
- The list form of
open
is now implemented for pipes (at least on Unix):
open($fh,"-|", 'cat', '/etc/motd')
creates a pipe, and runs the equivalent of exec('cat', '/etc/motd') in the child process.
- The following builtin functions are now overridable: chop(), chomp(), each(), keys(), pop(), push(), shift(), splice(), unshift().
- Formats now support zero-padded decimal fields.
- Perl now tries internally to use integer values in numeric conversions and basic arithmetics (+ - * /) if the arguments are integers, and tries also to keep the results stored internally as integers. This change leads into often slightly faster and always less lossy arithmetics. (Previously Perl always preferred floating point numbers in its math.)
- The printf() and sprintf() now support parameter reordering using the
%\d+\$
and *\d+\$
syntaxes. For example
print "%2\$s %1\$s\n", "foo", "bar";
will print "bar foo\n"; This feature helps in writing internationalised software.
- Unicode in general should be now much more usable. Unicode can be used in hash keys, Unicode in regular expressions should work now, Unicode in tr/// should work now (though tr/// seems to be a particularly tricky to get right, so you have been warned)
- The Unicode Character Database coming with Perl has been upgraded to Unicode 3.1. For more information, see http://www.unicode.org/ , and http://www.unicode.org/unicode/reports/tr27/
For developers interested in enhancing Perl's Unicode capabilities: almost all the UCD files are included with the Perl distribution in the lib/unicode subdirectory. The most notable omission, for space considerations, is the Unihan database.
- The Unicode character classes \p{Blank} and \p{SpacePerl} have been added. "Blank" is like C isblank(), that is, it contains only "horizontal whitespace" (the space character is, the newline isn't), and the "SpacePerl" is the Unicode equivalent of
\s
(\p{Space} isn't, since that includes the vertical tabulator character, whereas \s
doesn't.)
p571-Signals Are Now Safe
Perl used to be fragile in that signals arriving at inopportune moments could corrupt Perl's internal state.
p571-Modules and Pragmata
p571-New Modules
- B::Concise, by Stephen McCamant, is a new compiler backend for walking the Perl syntax tree, printing concise info about ops. The output is highly customisable.
See B::Concise for more information.
- Class::ISA, by Sean Burke, for reporting the search path for a class's ISA tree, has been added.
See Class::ISA for more information.
- Cwd has now a split personality: if possible, an extension is used, (this will hopefully be both faster and more secure and robust) but if not possible, the familiar Perl library implementation is used.
- Digest, a frontend module for calculating digests (checksums), from Gisle Aas, has been added.
See Digest for more information.
- Digest::MD5 for calculating MD5 digests (checksums), by Gisle Aas, has been added.
use Digest::MD5 'md5_hex';
$digest = md5_hex("Thirsty Camel");
print $digest, "\n"; # 01d19d9d2045e005c3f1b80e8b164de1
NOTE: the MD5 backward compatibility module is deliberately not included since its use is discouraged.
See Digest::MD5 for more information.
- Encode, by Nick Ing-Simmons, provides a mechanism to translate between different character encodings. Support for Unicode, ISO-8859-*, ASCII, CP*, KOI8-R, and three variants of EBCDIC are compiled in to the module. Several other encodings (like Japanese, Chinese, and MacIntosh encodings) are included and will be loaded at runtime.
Any encoding supported by Encode module is also available to the ":encoding()" layer if PerlIO is used.
See Encode for more information.
- Filter::Simple is an easy-to-use frontend to Filter::Util::Call, from Damian Conway.
# in MyFilter.pm:
package MyFilter;
use Filter::Simple sub {
while (my ($from, $to) = splice @_, 0, 2) {
s/$from/$to/g;
}
};
1;
# in user's code:
use MyFilter qr/red/ => 'green';
print "red\n"; # this code is filtered, will print "green\n"
print "bored\n"; # this code is filtered, will print "bogreen\n"
no MyFilter;
print "red\n"; # this code is not filtered, will print "red\n"
See Filter::Simple for more information.
- Filter::Util::Call, by Paul Marquess, provides you with the framework to write Source Filters in Perl. For most uses the frontend Filter::Simple is to be preferred. See Filter::Util::Call for more information.
- Locale::Constants, Locale::Country, Locale::Currency, and Locale::Language, from Neil Bowers, have been added. They provide the codes for various locale standards, such as "fr" for France, "usd" for US Dollar, and "jp" for Japanese.
use Locale::Country;
$country = code2country('jp'); # $country gets 'Japan'
$code = country2code('Norway'); # $code gets 'no'
See Locale::Constants, Locale::Country, Locale::Currency, and Locale::Language for more information.
- MIME::Base64, by Gisle Aas, allows you to encode data in base64.
use MIME::Base64;
$encoded = encode_base64('Aladdin:open sesame');
$decoded = decode_base64($encoded);
print $encoded, "\n"; # "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
See MIME::Base64 for more information.
- MIME::QuotedPrint, by Gisle Aas, allows you to encode data in quoted-printable encoding.
use MIME::QuotedPrint;
$encoded = encode_qp("Smiley in Unicode: \x{263a}");
$decoded = decode_qp($encoded);
print $encoded, "\n"; # "Smiley in Unicode: =263A"
MIME::QuotedPrint has been enhanced to provide the basic methods necessary to use it with PerlIO::Via as in :
use MIME::QuotedPrint;
open($fh,">Via(MIME::QuotedPrint)",$path)
See MIME::QuotedPrint for more information.
- PerlIO::Scalar, by Nick Ing-Simmons, provides the implementation of IO to "in memory" Perl scalars as discussed above. It also serves as an example of a loadable layer. Other future possibilities include PerlIO::Array and PerlIO::Code. See PerlIO::Scalar for more information.
- PerlIO::Via, by Nick Ing-Simmons, acts as a PerlIO layer and wraps PerlIO layer functionality provided by a class (typically implemented in perl code).
use MIME::QuotedPrint;
open($fh,">Via(MIME::QuotedPrint)",$path)
This will automatically convert everything output to $fh
to Quoted-Printable. See PerlIO::Via for more information.
- Pod::Text::Overstrike, by Joe Smith, has been added. It converts POD data to formatted overstrike text. See Pod::Text::Overstrike for more information.
- Switch from Damian Conway has been added. Just by saying
use Switch;
you have switch
and case
available in Perl.
use Switch;
switch ($val) {
case 1 { print "number 1" }
case "a" { print "string a" }
case [1..10,42] { print "number in list" }
case (@array) { print "number in list" }
case /\w+/ { print "pattern" }
case qr/\w+/ { print "pattern" }
case (%hash) { print "entry in hash" }
case (\%hash) { print "entry in hash" }
case (\&sub) { print "arg to subroutine" }
else { print "previous case not true" }
}
See Switch for more information.
- Text::Balanced from Damian Conway has been added, for extracting delimited text sequences from strings.
use Text::Balanced 'extract_delimited';
($a, $b) = extract_delimited("'never say never', he never said", "'", '');
$a will be "'never say never'", $b will be ', he never said'.
In addition to extract_delimited() there are also extract_bracketed(), extract_quotelike(), extract_codeblock(), extract_variable(), extract_tagged(), extract_multiple(), gen_delimited_pat(), and gen_extract_tagged(). With these you can implement rather advanced parsing algorithms. See Text::Balanced for more information.
- Tie::RefHash::Nestable, by Edward Avis, allows storing hash references (unlike the standard Tie::RefHash) The module is contained within Tie::RefHash.
- XS::Typemap, by Tim Jenness, is a test extension that exercises XS typemaps. Nothing gets installed but for extension writers the code is worth studying.
p571-Updated And Improved Modules and Pragmata
- B::Deparse should be now more robust. It still far from providing a full round trip for any random piece of Perl code, though, and is under active development: expect more robustness in 5.7.2.
- Class::Struct can now define the classes in compile time.
- Math::BigFloat has undergone much fixing, and in addition the fmod() function now supports modulus operations.
( The fixed Math::BigFloat module is also available in CPAN for those who can't upgrade their Perl: http://www.cpan.org/authors/id/J/JP/JPEACOCK/ )
- Devel::Peek now has an interface for the Perl memory statistics (this works only if you are using perl's malloc, and if you have compiled with debugging).
- IO::Socket has now atmark() method, which returns true if the socket is positioned at the out-of-band mark. The method is also exportable as a sockatmark() function.
- IO::Socket::INET has support for ReusePort option (if your platform supports it). The Reuse option now has an alias, ReuseAddr. For clarity you may want to prefer ReuseAddr.
- Net::Ping has been enhanced. There is now "external" protocol which uses Net::Ping::External module which runs external ping(1) and parses the output. An alpha version of Net::Ping::External is available in CPAN and in 5.7.2 the Net::Ping::External may be integrated to Perl.
- The
open
pragma allows layers other than ":raw" and ":crlf" when using PerlIO.
- POSIX::sigaction() is now much more flexible and robust. You can now install coderef handlers, 'DEFAULT', and 'IGNORE' handlers, installing new handlers was not atomic.
- The Test module has been significantly enhanced. Its use is greatly recommended for module writers.
- The utf8:: name space (as in the pragma) provides various Perl-callable functions to provide low level access to Perl's internal Unicode representation. At the moment only length() has been implemented.
The following modules have been upgraded from the versions at CPAN: CPAN, CGI, DB_File, File::Temp, Getopt::Long, Pod::Man, Pod::Text, Storable, Text-Tabs+Wrap.
p571-Performance Enhancements
- Hashes now use Bob Jenkins "One-at-a-Time" hashing key algorithm ( http://burtleburtle.net/bob/hash/doobs.html ). This algorithm is reasonably fast while producing a much better spread of values than the old hashing algorithm (originally by Chris Torek, later tweaked by Ilya Zakharevich). Hash values output from the algorithm on a hash of all 3-char printable ASCII keys comes much closer to passing the DIEHARD random number generation tests. According to perlbench, this change has not affected the overall speed of Perl.
- unshift() should now be noticeably faster.
p571-Utility Changes
- h2xs now produces template README.
- s2p has been completely rewritten in Perl. (It is in fact a full implementation of sed in Perl.)
- xsubpp now supports OUT keyword.
p571-New Documentation
p571-perlclib
Internal replacements for standard C library functions. (Interesting only for extension writers and Perl core hackers.)
p571-perliol
Internals of PerlIO with layers.
p571-README.aix
Documentation on compiling Perl on AIX has been added. AIX has several different C compilers and getting the right patch level is essential. On install README.aix will be installed as perlaix.
p571-README.bs2000
Documentation on compiling Perl on the POSIX-BC platform (an EBCDIC mainframe environment) has been added.
This was formerly known as README.posix-bc but the name was considered to be too confusing (it has nothing to do with the POSIX module or the POSIX standard). On install README.bs2000 will be installed as perlbs2000.
p571-README.macos
In perl 5.7.1 (and in the 5.6.1) the MacPerl sources have been synchronised with the standard Perl sources. To compile MacPerl some additional steps are required, and this file documents those steps. On install README.macos will be installed as perlmacos.
p571-README.mpeix
The README.mpeix has been podified, which means that this information about compiling and using Perl on the MPE/iX miniframe platform will be installed as perlmpeix.
p571-README.solaris
README.solaris has been created and Solaris wisdom from elsewhere in the Perl documentation has been collected there. On install README.solaris will be installed as perlsolaris.
p571-README.vos
The README.vos has been podified, which means that this information about compiling and using Perl on the Stratus VOS miniframe platform will be installed as perlvos.
p571-Porting/repository.pod
Documentation on how to use the Perl source repository has been added.
p571-Installation and Configuration Improvements
- Because PerlIO is now the default on most platforms, "-perlio" doesn't get appended to the $Config{archname} (also known as $^O) anymore. Instead, if you explicitly choose not to use perlio (Configure command line option -Uuseperlio), you will get "-stdio" appended.
- Another change related to the architecture name is that "-64all" (-Duse64bitall, or "maximally 64-bit") is appended only if your pointers are 64 bits wide. (To be exact, the use64bitall is ignored.)
- APPLLIB_EXP, a less-know configuration-time definition, has been documented. It can be used to prepend site-specific directories to Perl's default search path (@INC), see INSTALL for information.
- Building Berkeley DB3 for compatibility modes for DB, NDBM, and ODBM has been documented in INSTALL.
- If you are on IRIX or Tru64 platforms, new profiling/debugging options have been added, see perlhack for more information about pixie and Third Degree.
p571-New Or Improved Platforms
For the list of platforms known to support Perl, see "Supported Platforms" in perlport.
- AIX dynamic loading should be now better supported.
- After a long pause, AmigaOS has been verified to be happy with Perl.
- EBCDIC platforms (z/OS, also known as OS/390, POSIX-BC, and VM/ESA) have been regained. Many test suite tests still fail and the co-existence of Unicode and EBCDIC isn't quite settled, but the situation is much better than with Perl 5.6. See perlos390, perlbs2000 (for POSIX-BC), and perlvmesa for more information.
- Building perl with -Duseithreads or -Duse5005threads now works under HP-UX 10.20 (previously it only worked under 10.30 or later). You will need a thread library package installed. See README.hpux.
- Mac OS Classic (MacPerl has of course been available since perl 5.004 but now the source code bases of standard Perl and MacPerl have been synchronised)
- NCR MP-RAS is now supported.
- NonStop-UX is now supported.
- Amdahl UTS is now supported.
- z/OS (formerly known as OS/390, formerly known as MVS OE) has now support for dynamic loading. This is not selected by default, however, you must specify -Dusedl in the arguments of Configure.
p571-Generic Improvements
- Configure no longer includes the DBM libraries (dbm, gdbm, db, ndbm) when building the Perl binary. The only exception to this is SunOS 4.x, which needs them.
- Some new Configure symbols, useful for extension writers:
- p571-d_cmsghdr
-
For struct cmsghdr.
- p571-d_fcntl_can_lock
-
Whether fcntl() can be used for file locking.
- p571-d_fsync
-
- p571-d_getitimer
-
- p571-d_getpagsz
-
For getpagesize(), though you should prefer POSIX::sysconf(_SC_PAGE_SIZE))
- p571-d_msghdr_s
-
For struct msghdr.
- p571-need_va_copy
-
Whether one needs to use Perl_va_copy() to copy varargs.
- p571-d_readv
-
- p571-d_recvmsg
-
- p571-d_sendmsg
-
- p571-sig_size
-
The number of elements in an array needed to hold all the available signals.
- p571-d_sockatmark
-
- p571-d_strtoq
-
- p571-d_u32align
-
Whether one needs to access character data aligned by U32 sized pointers.
- p571-d_ualarm
-
- p571-d_usleep
- Removed Configure symbols: the PDP-11 memory model settings: huge, large, medium, models.
- SOCKS support is now much more robust.
- If your file system supports symbolic links you can build Perl outside of the source directory by
mkdir perl/build/directory
cd perl/build/directory
sh /path/to/perl/source/Configure -Dmksymlinks ...
This will create in perl/build/directory a tree of symbolic links pointing to files in /path/to/perl/source. The original files are left unaffected. After Configure has finished you can just say
make all test
and Perl will be built and tested, all in perl/build/directory.
p571-Selected Bug Fixes
Numerous memory leaks and uninitialized memory accesses have been hunted down. Most importantly anonymous subs used to leak quite a bit.
- chop(@list) in list context returned the characters chopped in reverse order. This has been reversed to be in the right order.
- The order of DESTROYs has been made more predictable.
- mkdir() now ignores trailing slashes in the directory name, as mandated by POSIX.
- Attributes (like :shared) didn't work with our().
- The PERL5OPT environment variable (for passing command line arguments to Perl) didn't work for more than a single group of options.
- The tainting behaviour of sprintf() has been rationalized. It does not taint the result of floating point formats anymore, making the behaviour consistent with that of string interpolation.
- All but the first argument of the IO syswrite() method are now optional.
- Tie::ARRAY SPLICE method was broken.
- vec() now tries to work with characters <= 255 when possible, but it leaves higher character values in place. In that case, if vec() was used to modify the string, it is no longer considered to be utf8-encoded.
p571-Platform Specific Changes and Fixes
- Linux previously had problems related to sockaddrlen when using accept(), revcfrom() (in Perl: recv()), getpeername(), and getsockname().
- Previously DYNIX/ptx had problems in its Configure probe for non-blocking I/O.
- Windows
- Borland C++ v5.5 is now a supported compiler that can build Perl. However, the generated binaries continue to be incompatible with those generated by the other supported compilers (GCC and Visual C++).
- Win32::GetCwd() correctly returns C:\ instead of C: when at the drive root. Other bugs in chdir() and Cwd::cwd() have also been fixed.
- Duping socket handles with open(F, ">&MYSOCK") now works under Windows 9x.
- HTML files will be installed in c:\perl\html instead of c:\perl\lib\pod\html
- The makefiles now provide a single switch to bulk-enable all the features enabled in ActiveState ActivePerl (a popular binary distribution).
p571-New or Changed Diagnostics
Two new debugging options have been added: if you have compiled your Perl with debugging, you can use the -DT and -DR options to trace tokenising and to add reference counts to displaying variables, respectively.
- If an attempt to use a (non-blessed) reference as an array index is made, a warning is given.
push @a;
and unshift @a;
(with no values to push or unshift) now give a warning. This may be a problem for generated and eval'ed code.
p571-Changed Internals
- Some new APIs: ptr_table_clear(), ptr_table_free(), sv_setref_uv(). For the full list of the available APIs see perlapi.
- dTHR and djSP have been obsoleted; the former removed (because it's a no-op) and the latter replaced with dSP.
- Perl now uses system malloc instead of Perl malloc on all 64-bit platforms, and even in some not-always-64-bit platforms like AIX, IRIX, and Solaris. This change breaks backward compatibility but Perl's malloc has problems with large address spaces and also the speed of vendors' malloc is generally better in large address space machines (Perl's malloc is mostly tuned for space).
p571-New Tests
Many new tests have been added. The most notable is probably the lib/1_compile: it is very notable because running it takes quite a long time. It test compiles all the Perl modules in the distribution. Please be patient.
p571-Known Problems
Note that unlike other sections in this document (which describe changes since 5.7.0) this section is cumulative containing known problems for all the 5.7 releases.
p571-AIX vac 5.0.0.0 May Produce Buggy Code For Perl
The AIX C compiler vac version 5.0.0.0 may produce buggy code, resulting in few random tests failing, but when the failing tests are run by hand, they succeed. We suggest upgrading to at least vac version 5.0.1.0, that has been known to compile Perl correctly. "lslpp -L|grep vac.C" will tell you the vac version.
p571-lib/ftmp-security tests warn 'system possibly insecure'
Don't panic. Read INSTALL 'make test' section instead.
p571-lib/io_multihomed Fails In LP64-Configured HP-UX
The lib/io_multihomed test may hang in HP-UX if Perl has been configured to be 64-bit. Because other 64-bit platforms do not hang in this test, HP-UX is suspect. All other tests pass in 64-bit HP-UX. The test attempts to create and connect to "multihomed" sockets (sockets which have multiple IP addresses).
p571-Test lib/posix Subtest 9 Fails In LP64-Configured HP-UX
If perl is configured with -Duse64bitall, the successful result of the subtest 10 of lib/posix may arrive before the successful result of the subtest 9, which confuses the test harness so much that it thinks the subtest 9 failed.
p571-lib/b test 19
The test fails on various platforms (PA64 and IA64 are known), but the exact cause is still being investigated.
p571-Linux With Sfio Fails op/misc Test 48
No known fix.
p571-sigaction test 13 in VMS
The test is known to fail; whether it's because of VMS of because of faulty test is not known.
p571-sprintf tests 129 and 130
The op/sprintf tests 129 and 130 are known to fail on some platforms. Examples include any platform using sfio, and Compaq/Tandem's NonStop-UX. The failing platforms do not comply with the ANSI C Standard, line 19ff on page 134 of ANSI X3.159 1989 to be exact. (They produce something else than "1" and "-1" when formatting 0.6 and -0.6 using the printf format "%.0f", most often they produce "0" and "-0".)
p571-Failure of Thread tests
The subtests 19 and 20 of lib/thr5005.t test are known to fail due to fundamental problems in the 5.005 threading implementation. These are not new failures--Perl 5.005_0x has the same bugs, but didn't have these tests. (Note that support for 5.005-style threading remains experimental.)
p571-Localising a Tied Variable Leaks Memory
use Tie::Hash;
tie my %tie_hash => 'Tie::StdHash';
...
local($tie_hash{Foo}) = 1; # leaks
Code like the above is known to leak memory every time the local() is executed.
p571-Self-tying of Arrays and Hashes Is Forbidden
Self-tying of arrays and hashes is broken in rather deep and hard-to-fix ways. As a stop-gap measure to avoid people from getting frustrated at the mysterious results (core dumps, most often) it is for now forbidden (you will get a fatal error even from an attempt).
p571-Building Extensions Can Fail Because Of Largefiles
Some extensions like mod_perl are known to have issues with `largefiles', a change brought by Perl 5.6.0 in which file offsets default to 64 bits wide, where supported. Modules may fail to compile at all or compile and work incorrectly. Currently there is no good solution for the problem, but Configure now provides appropriate non-largefile ccflags, ldflags, libswanted, and libs in the %Config hash (e.g., $Config{ccflags_nolargefiles}) so the extensions that are having problems can try configuring themselves without the largefileness. This is admittedly not a clean solution, and the solution may not even work at all. One potential failure is whether one can (or, if one can, whether it's a good idea) link together at all binaries with different ideas about file offsets, all this is platform-dependent.
p571-The Compiler Suite Is Still Experimental
The compiler suite is slowly getting better but is nowhere near working order yet.
p571-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ There may also be information at http://www.perl.com/perl/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
p571-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p571-HISTORY
Written by Jarkko Hietaniemi <jhi@iki.fi>, with many contributions from The Perl Porters and Perl Users submitting feedback and patches.
Send omissions or corrections to <perlbug@perl.org>.
p570-NAME
perl570delta - what's new for perl v5.7.0
p570-DESCRIPTION
This document describes differences between the 5.6.0 release and the 5.7.0 release.
p570-Security Vulnerability Closed
A potential security vulnerability in the optional suidperl component of Perl has been identified. suidperl is neither built nor installed by default. As of September the 2nd, 2000, the only known vulnerable platform is Linux, most likely all Linux distributions. CERT and various vendors have been alerted about the vulnerability.
The problem was caused by Perl trying to report a suspected security exploit attempt using an external program, /bin/mail. On Linux platforms the /bin/mail program had an undocumented feature which when combined with suidperl gave access to a root shell, resulting in a serious compromise instead of reporting the exploit attempt. If you don't have /bin/mail, or if you have 'safe setuid scripts', or if suidperl is not installed, you are safe.
The exploit attempt reporting feature has been completely removed from the Perl 5.7.0 release, so that particular vulnerability isn't there anymore. However, further security vulnerabilities are, unfortunately, always possible. The suidperl code is being reviewed and if deemed too risky to continue to be supported, it may be completely removed from future releases. In any case, suidperl should only be used by security experts who know exactly what they are doing and why they are using suidperl instead of some other solution such as sudo ( see http://www.courtesan.com/sudo/ ).
p570-Incompatible Changes
- Arrays now always interpolate into double-quoted strings: constructs like "foo@bar" now always assume
@bar
is an array, whether or not the compiler has seen use of @bar
.
- The semantics of bless(REF, REF) were unclear and until someone proves it to make some sense, it is forbidden.
- A reference to a reference now stringify as "REF(0x81485ec)" instead of "SCALAR(0x81485ec)" in order to be more consistent with the return value of ref().
- The very dusty examples in the eg/ directory have been removed. Suggestions for new shiny examples welcome but the main issue is that the examples need to be documented, tested and (most importantly) maintained.
- The obsolete chat2 library that should never have been allowed to escape the laboratory has been decommissioned.
- The unimplemented POSIX regex features [[.cc.]] and [[=c=]] are still recognised but now cause fatal errors. The previous behaviour of ignoring them by default and warning if requested was unacceptable since it, in a way, falsely promised that the features could be used.
- The (bogus) escape sequences \8 and \9 now give an optional warning ("Unrecognized escape passed through"). There is no need to \-escape any
\w
character.
- lstat(FILEHANDLE) now gives a warning because the operation makes no sense. In future releases this may become a fatal error.
- The long deprecated uppercase aliases for the string comparison operators (EQ, NE, LT, LE, GE, GT) have now been removed.
- The regular expression captured submatches ($1, $2, ...) are now more consistently unset if the match fails, instead of leaving false data lying around in them.
- The tr///C and tr///U features have been removed and will not return; the interface was a mistake. Sorry about that. For similar functionality, see pack('U0', ...) and pack('C0', ...).
p570-Core Enhancements
perl -d:Module=arg,arg,arg
now works (previously one couldn't pass in multiple arguments.)
- my __PACKAGE__ $obj now works.
no Module;
now works even if there is no "sub unimport" in the Module.
- The numerical comparison operators return
undef
if either operand is a NaN. Previously the behaviour was unspecified.
pack('U0a*', ...)
can now be used to force a string to UTF-8.
- prototype(\&) is now available.
- There is now an UNTIE method.
p570-Modules and Pragmata
p570-New Modules
- File::Temp allows one to create temporary files and directories in an easy, portable, and secure way.
- Storable gives persistence to Perl data structures by allowing the storage and retrieval of Perl data to and from files in a fast and compact binary format.
p570-Updated And Improved Modules and Pragmata
- The following independently supported modules have been updated to newer versions from CPAN: CGI, CPAN, DB_File, File::Spec, Getopt::Long, the podlators bundle, Pod::LaTeX, Pod::Parser, Term::ANSIColor, Test.
- Bug fixes and minor enhancements have been applied to B::Deparse, Data::Dumper, IO::Poll, IO::Socket::INET, Math::BigFloat, Math::Complex, Math::Trig, Net::protoent, the re pragma, SelfLoader, Sys::SysLog, Test::Harness, Text::Wrap, UNIVERSAL, and the warnings pragma.
- The attributes::reftype() now works on tied arguments.
- AutoLoader can now be disabled with
no AutoLoader;
,
- The English module can now be used without the infamous performance hit by saying
use English '-no_performance_hit';
(Assuming, of course, that one doesn't need the troublesome variables $`
, $&
, or $'
.) Also, introduced @LAST_MATCH_START
and @LAST_MATCH_END
English aliases for @-
and @+
.
- File::Find now has pre- and post-processing callbacks. It also correctly changes directories when chasing symbolic links. Callbacks (naughtily) exiting with "next;" instead of "return;" now work.
- File::Glob::glob() renamed to File::Glob::bsd_glob() to avoid prototype mismatch with CORE::glob().
- IPC::Open3 now allows the use of numeric file descriptors.
- use lib now works identically to @INC. Removing directories with 'no lib' now works.
%INC
now localised in a Safe compartment so that use/require work.
- The Shell module now has an OO interface.
p570-Utility Changes
- The Emacs perl mode (emacs/cperl-mode.el) has been updated to version 4.31.
- Perlbug is now much more robust. It also sends the bug report to perl.org, not perl.com.
- The perlcc utility has been rewritten and its user interface (that is, command line) is much more like that of the Unix C compiler, cc.
- The xsubpp utility for extension writers now understands POD documentation embedded in the *.xs files.
p570-New Documentation
- perl56delta details the changes between the 5.005 release and the 5.6.0 release.
- perldebtut is a Perl debugging tutorial.
- perlebcdic contains considerations for running Perl on EBCDIC platforms. Note that unfortunately EBCDIC platforms that used to supported back in Perl 5.005 are still unsupported by Perl 5.7.0; the plan, however, is to bring them back to the fold.
- perlnewmod tells about writing and submitting a new module.
- perlposix-bc explains using Perl on the POSIX-BC platform (an EBCDIC mainframe platform).
- perlretut is a regular expression tutorial.
- perlrequick is a regular expressions quick-start guide. Yes, much quicker than perlretut.
- perlutil explains the command line utilities packaged with the Perl distribution.
p570-Performance Enhancements
- map() that changes the size of the list should now work faster.
- sort() has been changed to use mergesort internally as opposed to the earlier quicksort. For very small lists this may result in slightly slower sorting times, but in general the speedup should be at least 20%. Additional bonuses are that the worst case behaviour of sort() is now better (in computer science terms it now runs in time O(N log N), as opposed to quicksort's Theta(N**2) worst-case run time behaviour), and that sort() is now stable (meaning that elements with identical keys will stay ordered as they were before the sort).
p570-Installation and Configuration Improvements
p570-Generic Improvements
- INSTALL now explains how you can configure Perl to use 64-bit integers even on non-64-bit platforms.
- Policy.sh policy change: if you are reusing a Policy.sh file (see INSTALL) and you use Configure -Dprefix=/foo/bar and in the old Policy $prefix eq $siteprefix and $prefix eq $vendorprefix, all of them will now be changed to the new prefix, /foo/bar. (Previously only $prefix changed.) If you do not like this new behaviour, specify prefix, siteprefix, and vendorprefix explicitly.
- A new optional location for Perl libraries, otherlibdirs, is available. It can be used for example for vendor add-ons without disturbing Perl's own library directories.
- In many platforms the vendor-supplied 'cc' is too stripped-down to build Perl (basically, 'cc' doesn't do ANSI C). If this seems to be the case and 'cc' does not seem to be the GNU C compiler 'gcc', an automatic attempt is made to find and use 'gcc' instead.
- gcc needs to closely track the operating system release to avoid build problems. If Configure finds that gcc was built for a different operating system release than is running, it now gives a clearly visible warning that there may be trouble ahead.
- If binary compatibility with the 5.005 release is not wanted, Configure no longer suggests including the 5.005 modules in @INC.
- Configure
-S
can now run non-interactively.
- configure.gnu now works with options with whitespace in them.
- installperl now outputs everything to STDERR.
- $Config{byteorder} is now computed dynamically (this is more robust with "fat binaries" where an executable image contains binaries for more than one binary platform.)
p570-Selected Bug Fixes
- Several debugger fixes: exit code now reflects the script exit code, condition
"0"
now treated correctly, the d
command now checks line number, the $.
no longer gets corrupted, all debugger output now goes correctly to the socket if RemotePort is set.
*foo{FORMAT}
now works.
- Lexical warnings now propagating correctly between scopes.
- Line renumbering with eval and
#line
now works.
- Fixed numerous memory leaks, especially in eval "".
- Modulus of unsigned numbers now works (4063328477 % 65535 used to return 27406, instead of 27047).
- Some "not a number" warnings introduced in 5.6.0 eliminated to be more compatible with 5.005. Infinity is now recognised as a number.
- our() variables will not cause "will not stay shared" warnings.
- pack "Z" now correctly terminates the string with "\0".
- Fix password routines which in some shadow password platforms (e.g. HP-UX) caused getpwent() to return every other entry.
- printf() no longer resets the numeric locale to "C".
q(a\\b)
now parses correctly as 'a\\b'
.
- Printing quads (64-bit integers) with printf/sprintf now works without the q L ll prefixes (assuming you are on a quad-capable platform).
- Regular expressions on references and overloaded scalars now work.
- scalar() now forces scalar context even when used in void context.
- sort() arguments are now compiled in the right wantarray context (they were accidentally using the context of the sort() itself).
- Changed the POSIX character class
[[:space:]]
to include the (very rare) vertical tab character. Added a new POSIX-ish character class [[:blank:]]
which stands for horizontal whitespace (currently, the space and the tab).
- $AUTOLOAD, sort(), lock(), and spawning subprocesses in multiple threads simultaneously are now thread-safe.
- Allow read-only string on left hand side of non-modifying tr///.
- Several Unicode fixes (but still not perfect).
- BOMs (byte order marks) in the beginning of Perl files (scripts, modules) should now be transparently skipped. UTF-16 (UCS-2) encoded Perl files should now be read correctly.
- The character tables have been updated to Unicode 3.0.1.
- chr() for values greater than 127 now create utf8 when under use utf8.
- Comparing with utf8 data does not magically upgrade non-utf8 data into utf8.
IsAlnum
, IsAlpha
, and IsWord
now match titlecase.
- Concatenation with the
.
operator or via variable interpolation, eq
, substr
, reverse
, quotemeta
, the x
operator, substitution with s///
, single-quoted UTF-8, should now work--in theory.
- The
tr///
operator now works slightly better but is still rather broken. Note that the tr///CU
functionality has been removed (but see pack('U0', ...)).
- vec() now refuses to deal with characters >255.
- Zero entries were missing from the Unicode classes like
IsDigit
.
- UNIVERSAL::isa no longer caches methods incorrectly. (This broke the Tk extension with 5.6.0.)
p570-Platform Specific Changes and Fixes
- BSDI 4.*
Perl now works on post-4.0 BSD/OSes.
- All BSDs
Setting $0
now works (as much as possible; see perlvar for details).
- Cygwin
Numerous updates; currently synchronised with Cygwin 1.1.4.
- EPOC
EPOC update after Perl 5.6.0. See README.epoc.
- FreeBSD 3.*
Perl now works on post-3.0 FreeBSDs.
- HP-UX
README.hpux updated; Configure -Duse64bitall
now almost works.
- IRIX
Numerous compilation flag and hint enhancements; accidental mixing of 32-bit and 64-bit libraries (a doomed attempt) made much harder.
- Linux
Long doubles should now work (see INSTALL).
- Mac OS Classic
Compilation of the standard Perl distribution in Mac OS Classic should now work if you have the Metrowerks development environment and the missing Mac-specific toolkit bits. Contact the macperl mailing list for details.
- MPE/iX
MPE/iX update after Perl 5.6.0. See README.mpeix.
- NetBSD/sparc
Perl now works on NetBSD/sparc.
- OS/2
Now works with usethreads (see INSTALL).
- Solaris
64-bitness using the Sun Workshop compiler now works.
- Tru64 (aka Digital UNIX, aka DEC OSF/1)
The operating system version letter now recorded in $Config{osvers}. Allow compiling with gcc (previously explicitly forbidden). Compiling with gcc still not recommended because buggy code results, even with gcc 2.95.2.
- Unicos
Fixed various alignment problems that lead into core dumps either during build or later; no longer dies on math errors at runtime; now using full quad integers (64 bits), previously was using only 46 bit integers for speed.
- VMS
chdir() now works better despite a CRT bug; now works with MULTIPLICITY (see INSTALL); now works with Perl's malloc.
- Windows
- accept() no longer leaks memory.
- Better chdir() return value for a non-existent directory.
- New %ENV entries now propagate to subprocesses.
- $ENV{LIB} now used to search for libs under Visual C.
- A failed (pseudo)fork now returns undef and sets errno to EAGAIN.
- Allow REG_EXPAND_SZ keys in the registry.
- Can now send() from all threads, not just the first one.
- Fake signal handling reenabled, bugs and all.
- Less stack reserved per thread so that more threads can run concurrently. (Still 16M per thread.)
File::Spec->tmpdir()
now prefers C:/temp over /tmp (works better when perl is running as service).
- Better UNC path handling under ithreads.
- wait() and waitpid() now work much better.
- winsock handle leak fixed.
p570-New or Changed Diagnostics
All regular expression compilation error messages are now hopefully easier to understand both because the error message now comes before the failed regex and because the point of failure is now clearly marked.
The various "opened only for", "on closed", "never opened" warnings drop the main::
prefix for filehandles in the main
package, for example STDIN
instead of .
The "Unrecognized escape" warning has been extended to include \8
, \9
, and \_
. There is no need to escape any of the \w
characters.
p570-Changed Internals
- perlapi.pod (a companion to perlguts) now attempts to document the internal API.
- You can now build a really minimal perl called microperl. Building microperl does not require even running Configure;
make -f Makefile.micro
should be enough. Beware: microperl makes many assumptions, some of which may be too bold; the resulting executable may crash or otherwise misbehave in wondrous ways. For careful hackers only.
- Added rsignal(), whichsig(), do_join() to the publicised API.
- Made possible to propagate customised exceptions via croak()ing.
- Added is_utf8_char(), is_utf8_string(), bytes_to_utf8(), and utf8_to_bytes().
- Now xsubs can have attributes just like subs.
p570-Known Problems
p570-Unicode Support Still Far From Perfect
We're working on it. Stay tuned.
p570-EBCDIC Still A Lost Platform
The plan is to bring them back.
p570-Building Extensions Can Fail Because Of Largefiles
Certain extensions like mod_perl and BSD::Resource are known to have issues with `largefiles', a change brought by Perl 5.6.0 in which file offsets default to 64 bits wide, where supported. Modules may fail to compile at all or compile and work incorrectly. Currently there is no good solution for the problem, but Configure now provides appropriate non-largefile ccflags, ldflags, libswanted, and libs in the %Config hash (e.g., $Config{ccflags_nolargefiles}) so the extensions that are having problems can try configuring themselves without the largefileness. This is admittedly not a clean solution, and the solution may not even work at all. One potential failure is whether one can (or, if one can, whether it's a good idea) link together at all binaries with different ideas about file offsets, all this is platform-dependent.
p570-ftmp-security tests warn 'system possibly insecure'
Don't panic. Read INSTALL 'make test' section instead.
p570-Test lib/posix Subtest 9 Fails In LP64-Configured HP-UX
If perl is configured with -Duse64bitall, the successful result of the subtest 10 of lib/posix may arrive before the successful result of the subtest 9, which confuses the test harness so much that it thinks the subtest 9 failed.
p570-Long Doubles Still Don't Work In Solaris
The experimental long double support is still very much so in Solaris. (Other platforms like Linux and Tru64 are beginning to solidify in this area.)
p570-Linux With Sfio Fails op/misc Test 48
No known fix.
p570-Storable tests fail in some platforms
If any Storable tests fail the use of Storable is not advisable.
- Many Storable tests fail on AIX configured with 64 bit integers.
So far unidentified problems break Storable in AIX if Perl is configured to use 64 bit integers. AIX in 32-bit mode works and other 64-bit platforms work with Storable.
- DOS DJGPP may hang when testing Storable.
- st-06compat fails in UNICOS and UNICOS/mk.
This means that you cannot read old (pre-Storable-0.7) Storable images made in other platforms.
- st-store.t and st-retrieve may fail with Compaq C 6.2 on OpenVMS Alpha 7.2.
p570-Threads Are Still Experimental
Multithreading is still an experimental feature. Some platforms emit the following message for lib/thr5005
#
# This is a KNOWN FAILURE, and one of the reasons why threading
# is still an experimental feature. It is here to stop people
# from deploying threads in production. ;-)
#
and another known thread-related warning is
pragma/overload......Unbalanced saves: 3 more saves than restores
panic: magic_mutexfree during global destruction.
ok
lib/selfloader.......Unbalanced saves: 3 more saves than restores
panic: magic_mutexfree during global destruction.
ok
lib/st-dclone........Unbalanced saves: 3 more saves than restores
panic: magic_mutexfree during global destruction.
ok
p570-The Compiler Suite Is Still Experimental
The compiler suite is slowly getting better but is nowhere near working order yet. The backend part that has seen perhaps the most progress is the bytecode compiler.
p570-Reporting Bugs
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://bugs.perl.org/ There may also be information at http://www.perl.com/perl/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
p570-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p570-HISTORY
Written by Jarkko Hietaniemi <jhi@iki.fi>, with many contributions from The Perl Porters and Perl Users submitting feedback and patches.
Send omissions or corrections to <perlbug@perl.org>.
p561-NAME
perl561delta - what's new for perl v5.6.x
p561-DESCRIPTION
This document describes differences between the 5.005 release and the 5.6.1 release.
p561-Summary of changes between 5.6.0 and 5.6.1
This section contains a summary of the changes between the 5.6.0 release and the 5.6.1 release. More details about the changes mentioned here may be found in the Changes files that accompany the Perl source distribution. See perlhack for pointers to online resources where you can inspect the individual patches described by these changes.
p561-Security Issues
suidperl will not run /bin/mail anymore, because some platforms have a /bin/mail that is vulnerable to buffer overflow attacks.
Note that suidperl is neither built nor installed by default in any recent version of perl. Use of suidperl is highly discouraged. If you think you need it, try alternatives such as sudo first. See http://www.courtesan.com/sudo/ .
p561-Core bug fixes
This is not an exhaustive list. It is intended to cover only the significant user-visible changes.
- p561-
UNIVERSAL::isa()
-
A bug in the caching mechanism used by UNIVERSAL::isa()
that affected base.pm has been fixed. The bug has existed since the 5.005 releases, but wasn't tickled by base.pm in those releases.
- p561-Memory leaks
-
Various cases of memory leaks and attempts to access uninitialized memory have been cured. See "p561-Known Problems" below for further issues.
- p561-Numeric conversions
-
Numeric conversions did not recognize changes in the string value properly in certain circumstances.
In other situations, large unsigned numbers (those above 2**31) could sometimes lose their unsignedness, causing bogus results in arithmetic operations.
Integer modulus on large unsigned integers sometimes returned incorrect values.
Perl 5.6.0 generated "not a number" warnings on certain conversions where previous versions didn't.
These problems have all been rectified.
Infinity is now recognized as a number.
- p561-qw(a\\b)
-
In Perl 5.6.0, qw(a\\b) produced a string with two backslashes instead of one, in a departure from the behavior in previous versions. The older behavior has been reinstated.
- p561-caller()
-
caller() could cause core dumps in certain situations. Carp was sometimes affected by this problem.
- p561-Bugs in regular expressions
-
Pattern matches on overloaded values are now handled correctly.
Perl 5.6.0 parsed m/\x{ab}/ incorrectly, leading to spurious warnings. This has been corrected.
The RE engine found in Perl 5.6.0 accidentally pessimised certain kinds of simple pattern matches. These are now handled better.
Regular expression debug output (whether through use re 'debug'
or via -Dr
) now looks better.
Multi-line matches like "a\nxb\n" =~ /(?!\A)x/m
were flawed. The bug has been fixed.
Use of $& could trigger a core dump under some situations. This is now avoided.
Match variables $1 et al., weren't being unset when a pattern match was backtracking, and the anomaly showed up inside /...(?{ ... }).../
etc. These variables are now tracked correctly.
pos() did not return the correct value within s///ge in earlier versions. This is now handled correctly.
- p561-"slurp" mode
-
readline() on files opened in "slurp" mode could return an extra "" at the end in certain situations. This has been corrected.
- p561-Autovivification of symbolic references to special variables
-
Autovivification of symbolic references of special variables described in perlvar (as in ${$num}
) was accidentally disabled. This works again now.
- p561-Lexical warnings
-
Lexical warnings now propagate correctly into eval "..."
.
use warnings qw(FATAL all)
did not work as intended. This has been corrected.
Lexical warnings could leak into other scopes in some situations. This is now fixed.
warnings::enabled() now reports the state of $^W correctly if the caller isn't using lexical warnings.
- p561-Spurious warnings and errors
-
Perl 5.6.0 could emit spurious warnings about redefinition of dl_error() when statically building extensions into perl. This has been corrected.
"our" variables could result in bogus "Variable will not stay shared" warnings. This is now fixed.
"our" variables of the same name declared in two sibling blocks resulted in bogus warnings about "redeclaration" of the variables. The problem has been corrected.
- p561-glob()
-
Compatibility of the builtin glob() with old csh-based glob has been improved with the addition of GLOB_ALPHASORT option. See File::Glob
.
File::Glob::glob() has been renamed to File::Glob::bsd_glob() because the name clashes with the builtin glob(). The older name is still available for compatibility, but is deprecated.
Spurious syntax errors generated in certain situations, when glob() caused File::Glob to be loaded for the first time, have been fixed.
- p561-Tainting
-
Some cases of inconsistent taint propagation (such as within hash values) have been fixed.
The tainting behavior of sprintf() has been rationalized. It does not taint the result of floating point formats anymore, making the behavior consistent with that of string interpolation.
- p561-sort()
-
Arguments to sort() weren't being provided the right wantarray() context. The comparison block is now run in scalar context, and the arguments to be sorted are always provided list context.
sort() is also fully reentrant, in the sense that the sort function can itself call sort(). This did not work reliably in previous releases.
- p561-#line directives
-
#line directives now work correctly when they appear at the very beginning of eval "..."
.
- p561-Subroutine prototypes
-
The (\&) prototype now works properly.
- p561-map()
-
map() could get pathologically slow when the result list it generates is larger than the source list. The performance has been improved for common scenarios.
- p561-Debugger
-
Debugger exit code now reflects the script exit code.
Condition "0"
in breakpoints is now treated correctly.
The d
command now checks the line number.
$.
is no longer corrupted by the debugger.
All debugger output now correctly goes to the socket if RemotePort is set.
- p561-PERL5OPT
-
PERL5OPT can be set to more than one switch group. Previously, it used to be limited to one group of options only.
- p561-chop()
-
chop(@list) in list context returned the characters chopped in reverse order. This has been reversed to be in the right order.
- p561-Unicode support
-
Unicode support has seen a large number of incremental improvements, but continues to be highly experimental. It is not expected to be fully supported in the 5.6.x maintenance releases.
substr(), join(), repeat(), reverse(), quotemeta() and string concatenation were all handling Unicode strings incorrectly in Perl 5.6.0. This has been corrected.
Support for tr///CU
and tr///UC
etc., have been removed since we realized the interface is broken. For similar functionality, see "pack" in perlfunc.
The Unicode Character Database has been updated to version 3.0.1 with additions made available to the public as of August 30, 2000.
The Unicode character classes \p{Blank} and \p{SpacePerl} have been added. "Blank" is like C isblank(), that is, it contains only "horizontal whitespace" (the space character is, the newline isn't), and the "SpacePerl" is the Unicode equivalent of \s
(\p{Space} isn't, since that includes the vertical tabulator character, whereas \s
doesn't.)
If you are experimenting with Unicode support in perl, the development versions of Perl may have more to offer. In particular, I/O layers are now available in the development track, but not in the maintenance track, primarily to do backward compatibility issues. Unicode support is also evolving rapidly on a daily basis in the development track--the maintenance track only reflects the most conservative of these changes.
- p561-64-bit support
-
Support for 64-bit platforms has been improved, but continues to be experimental. The level of support varies greatly among platforms.
- p561-Compiler
-
The B Compiler and its various backends have had many incremental improvements, but they continue to remain highly experimental. Use in production environments is discouraged.
The perlcc tool has been rewritten so that the user interface is much more like that of a C compiler.
The perlbc tools has been removed. Use perlcc -B
instead.
- p561-Lvalue subroutines
-
There have been various bugfixes to support lvalue subroutines better. However, the feature still remains experimental.
- p561-IO::Socket
-
IO::Socket::INET failed to open the specified port if the service name was not known. It now correctly uses the supplied port number as is.
- p561-File::Find
-
File::Find now chdir()s correctly when chasing symbolic links.
- p561-xsubpp
-
xsubpp now tolerates embedded POD sections.
- p561-
no Module;
-
no Module;
does not produce an error even if Module does not have an unimport() method. This parallels the behavior of use
vis-a-vis import
.
- p561-Tests
-
A large number of tests have been added.
p561-Core features
untie() will now call an UNTIE() hook if it exists. See perltie for details.
The -DT
command line switch outputs copious tokenizing information. See perlrun.
Arrays are now always interpolated in double-quotish strings. Previously, "foo@bar.com"
used to be a fatal error at compile time, if an array @bar
was not used or declared. This transitional behavior was intended to help migrate perl4 code, and is deemed to be no longer useful. See "p561-Arrays now always interpolate into double-quoted strings".
keys(), each(), pop(), push(), shift(), splice() and unshift() can all be overridden now.
my __PACKAGE__ $obj
now does the expected thing.
p561-Configuration issues
On some systems (IRIX and Solaris among them) the system malloc is demonstrably better. While the defaults haven't been changed in order to retain binary compatibility with earlier releases, you may be better off building perl with Configure -Uusemymalloc ...
as discussed in the INSTALL file.
Configure
has been enhanced in various ways:
- Minimizes use of temporary files.
- By default, does not link perl with libraries not used by it, such as the various dbm libraries. SunOS 4.x hints preserve behavior on that platform.
- Support for pdp11-style memory models has been removed due to obsolescence.
- Building outside the source tree is supported on systems that have symbolic links. This is done by running
sh /path/to/source/Configure -Dmksymlinks ...
make all test install
in a directory other than the perl source directory. See INSTALL.
Configure -S
can be run non-interactively.
p561-Documentation
README.aix, README.solaris and README.macos have been added. README.posix-bc has been renamed to README.bs2000. These are installed as perlaix, perlsolaris, perlmacos, and perlbs2000 respectively.
The following pod documents are brand new:
perlclib Internal replacements for standard C library functions
perldebtut Perl debugging tutorial
perlebcdic Considerations for running Perl on EBCDIC platforms
perlnewmod Perl modules: preparing a new module for distribution
perlrequick Perl regular expressions quick start
perlretut Perl regular expressions tutorial
perlutil utilities packaged with the Perl distribution
The INSTALL file has been expanded to cover various issues, such as 64-bit support.
A longer list of contributors has been added to the source distribution. See the file AUTHORS
.
Numerous other changes have been made to the included documentation and FAQs.
p561-Bundled modules
The following modules have been added.
- p561-B::Concise
-
Walks Perl syntax tree, printing concise info about ops. See B::Concise.
- p561-File::Temp
-
Returns name and handle of a temporary file safely. See File::Temp.
- p561-Pod::LaTeX
-
Converts Pod data to formatted LaTeX. See Pod::LaTeX.
- p561-Pod::Text::Overstrike
-
Converts POD data to formatted overstrike text. See Pod::Text::Overstrike.
The following modules have been upgraded.
- p561-CGI
-
CGI v2.752 is now included.
- p561-CPAN
-
CPAN v1.59_54 is now included.
- p561-Class::Struct
-
Various bugfixes have been added.
- p561-DB_File
-
DB_File v1.75 supports newer Berkeley DB versions, among other improvements.
- p561-Devel::Peek
-
Devel::Peek has been enhanced to support dumping of memory statistics, when perl is built with the included malloc().
- p561-File::Find
-
File::Find now supports pre and post-processing of the files in order to sort() them, etc.
- p561-Getopt::Long
-
Getopt::Long v2.25 is included.
- p561-IO::Poll
-
Various bug fixes have been included.
- p561-IPC::Open3
-
IPC::Open3 allows use of numeric file descriptors.
- p561-Math::BigFloat
-
The fmod() function supports modulus operations. Various bug fixes have also been included.
- p561-Math::Complex
-
Math::Complex handles inf, NaN etc., better.
- p561-Net::Ping
-
ping() could fail on odd number of data bytes, and when the echo service isn't running. This has been corrected.
- p561-Opcode
-
A memory leak has been fixed.
- p561-Pod::Parser
-
Version 1.13 of the Pod::Parser suite is included.
- p561-Pod::Text
-
Pod::Text and related modules have been upgraded to the versions in podlators suite v2.08.
- p561-SDBM_File
-
On dosish platforms, some keys went missing because of lack of support for files with "holes". A workaround for the problem has been added.
- p561-Sys::Syslog
-
Various bug fixes have been included.
- p561-Tie::RefHash
-
Now supports Tie::RefHash::Nestable to automagically tie hashref values.
- p561-Tie::SubstrHash
-
Various bug fixes have been included.
p561-Platform-specific improvements
The following new ports are now available.
Perl now builds under Amdahl UTS.
Perl has also been verified to build under Amiga OS.
Support for EPOC has been much improved. See README.epoc.
Building perl with -Duseithreads or -Duse5005threads now works under HP-UX 10.20 (previously it only worked under 10.30 or later). You will need a thread library package installed. See README.hpux.
Long doubles should now work under Linux.
Mac OS Classic is now supported in the mainstream source package. See README.macos.
Support for MPE/iX has been updated. See README.mpeix.
Support for OS/2 has been improved. See os2/Changes
and README.os2.
Dynamic loading on z/OS (formerly OS/390) has been improved. See README.os390.
Support for VMS has seen many incremental improvements, including better support for operators like backticks and system(), and better %ENV handling. See README.vms
and perlvms.
Support for Stratus VOS has been improved. See vos/Changes
and README.vos.
Support for Windows has been improved.
- fork() emulation has been improved in various ways, but still continues to be experimental. See perlfork for known bugs and caveats.
- %SIG has been enabled under USE_ITHREADS, but its use is completely unsupported under all configurations.
- Borland C++ v5.5 is now a supported compiler that can build Perl. However, the generated binaries continue to be incompatible with those generated by the other supported compilers (GCC and Visual C++).
- Non-blocking waits for child processes (or pseudo-processes) are supported via
waitpid($pid, &POSIX::WNOHANG)
.
- A memory leak in accept() has been fixed.
- wait(), waitpid() and backticks now return the correct exit status under Windows 9x.
- Trailing new %ENV entries weren't propagated to child processes. This is now fixed.
- Current directory entries in %ENV are now correctly propagated to child processes.
- Duping socket handles with open(F, ">&MYSOCK") now works under Windows 9x.
- The makefiles now provide a single switch to bulk-enable all the features enabled in ActiveState ActivePerl (a popular binary distribution).
- Win32::GetCwd() correctly returns C:\ instead of C: when at the drive root. Other bugs in chdir() and Cwd::cwd() have also been fixed.
- fork() correctly returns undef and sets EAGAIN when it runs out of pseudo-process handles.
- ExtUtils::MakeMaker now uses $ENV{LIB} to search for libraries.
- UNC path handling is better when perl is built to support fork().
- A handle leak in socket handling has been fixed.
- send() works from within a pseudo-process.
Unless specifically qualified otherwise, the remainder of this document covers changes between the 5.005 and 5.6.0 releases.
p561-Core Enhancements
p561-Interpreter cloning, threads, and concurrency
Perl 5.6.0 introduces the beginnings of support for running multiple interpreters concurrently in different threads. In conjunction with the perl_clone() API call, which can be used to selectively duplicate the state of any given interpreter, it is possible to compile a piece of code once in an interpreter, clone that interpreter one or more times, and run all the resulting interpreters in distinct threads.
On the Windows platform, this feature is used to emulate fork() at the interpreter level. See perlfork for details about that.
This feature is still in evolution. It is eventually meant to be used to selectively clone a subroutine and data reachable from that subroutine in a separate interpreter and run the cloned subroutine in a separate thread. Since there is no shared data between the interpreters, little or no locking will be needed (unless parts of the symbol table are explicitly shared). This is obviously intended to be an easy-to-use replacement for the existing threads support.
Support for cloning interpreters and interpreter concurrency can be enabled using the -Dusethreads Configure option (see win32/Makefile for how to enable it on Windows.) The resulting perl executable will be functionally identical to one that was built with -Dmultiplicity, but the perl_clone() API call will only be available in the former.
-Dusethreads enables the cpp macro USE_ITHREADS by default, which in turn enables Perl source code changes that provide a clear separation between the op tree and the data it operates with. The former is immutable, and can therefore be shared between an interpreter and all of its clones, while the latter is considered local to each interpreter, and is therefore copied for each clone.
Note that building Perl with the -Dusemultiplicity Configure option is adequate if you wish to run multiple independent interpreters concurrently in different threads. -Dusethreads only provides the additional functionality of the perl_clone() API call and other support for running cloned interpreters concurrently.
NOTE: This is an experimental feature. Implementation details are
subject to change.
p561-Lexically scoped warning categories
You can now control the granularity of warnings emitted by perl at a finer level using the use warnings
pragma. warnings and perllexwarn have copious documentation on this feature.
p561-Unicode and UTF-8 support
Perl now uses UTF-8 as its internal representation for character strings. The utf8
and bytes
pragmas are used to control this support in the current lexical scope. See perlunicode, utf8 and bytes for more information.
This feature is expected to evolve quickly to support some form of I/O disciplines that can be used to specify the kind of input and output data (bytes or characters). Until that happens, additional modules from CPAN will be needed to complete the toolkit for dealing with Unicode.
NOTE: This should be considered an experimental feature. Implementation
details are subject to change.
p561-Support for interpolating named characters
The new \N
escape interpolates named characters within strings. For example, "Hi! \N{WHITE SMILING FACE}"
evaluates to a string with a Unicode smiley face at the end.
p561-"our" declarations
An "our" declaration introduces a value that can be best understood as a lexically scoped symbolic alias to a global variable in the package that was current where the variable was declared. This is mostly useful as an alternative to the vars
pragma, but also provides the opportunity to introduce typing and other attributes for such variables. See "our" in perlfunc.
p561-Support for strings represented as a vector of ordinals
Literals of the form v1.2.3.4
are now parsed as a string composed of characters with the specified ordinals. This is an alternative, more readable way to construct (possibly Unicode) strings instead of interpolating characters, as in "\x{1}\x{2}\x{3}\x{4}"
. The leading v
may be omitted if there are more than two ordinals, so 1.2.3
is parsed the same as v1.2.3
.
Strings written in this form are also useful to represent version "numbers". It is easy to compare such version "numbers" (which are really just plain strings) using any of the usual string comparison operators eq
, ne
, lt
, gt
, etc., or perform bitwise string operations on them using |
, &
, etc.
In conjunction with the new $^V
magic variable (which contains the perl version as a string), such literals can be used as a readable way to check if you're running a particular version of Perl:
# this will parse in older versions of Perl also
if ($^V and $^V gt v5.6.0) {
# new features supported
}
require
and use
also have some special magic to support such literals. They will be interpreted as a version rather than as a module name:
require v5.6.0; # croak if $^V lt v5.6.0
use v5.6.0; # same, but croaks at compile-time
Alternatively, the v
may be omitted if there is more than one dot:
require 5.6.0;
use 5.6.0;
Also, sprintf
and printf
support the Perl-specific format flag %v
to print ordinals of characters in arbitrary strings:
printf "v%vd", $^V; # prints current version, such as "v5.5.650"
printf "%*vX", ":", $addr; # formats IPv6 address
printf "%*vb", " ", $bits; # displays bitstring
See "Scalar value constructors" in perldata for additional information.
p561-Improved Perl version numbering system
Beginning with Perl version 5.6.0, the version number convention has been changed to a "dotted integer" scheme that is more commonly found in open source projects.
Maintenance versions of v5.6.0 will be released as v5.6.1, v5.6.2 etc. The next development series following v5.6.0 will be numbered v5.7.x, beginning with v5.7.0, and the next major production release following v5.6.0 will be v5.8.0.
The English module now sets $PERL_VERSION to $^V (a string value) rather than $]
(a numeric value). (This is a potential incompatibility. Send us a report via perlbug if you are affected by this.)
The v1.2.3 syntax is also now legal in Perl. See "p561-Support for strings represented as a vector of ordinals" for more on that.
To cope with the new versioning system's use of at least three significant digits for each version component, the method used for incrementing the subversion number has also changed slightly. We assume that versions older than v5.6.0 have been incrementing the subversion component in multiples of 10. Versions after v5.6.0 will increment them by 1. Thus, using the new notation, 5.005_03 is the "same" as v5.5.30, and the first maintenance version following v5.6.0 will be v5.6.1 (which should be read as being equivalent to a floating point value of 5.006_001 in the older format, stored in $]
).
p561-New syntax for declaring subroutine attributes
Formerly, if you wanted to mark a subroutine as being a method call or as requiring an automatic lock() when it is entered, you had to declare that with a use attrs
pragma in the body of the subroutine. That can now be accomplished with declaration syntax, like this:
sub mymethod : locked method;
...
sub mymethod : locked method {
...
}
sub othermethod :locked :method;
...
sub othermethod :locked :method {
...
}
(Note how only the first :
is mandatory, and whitespace surrounding the :
is optional.)
AutoSplit.pm and SelfLoader.pm have been updated to keep the attributes with the stubs they provide. See attributes.
p561-File and directory handles can be autovivified
Similar to how constructs such as $x->[0]
autovivify a reference, handle constructors (open(), opendir(), pipe(), socketpair(), sysopen(), socket(), and accept()) now autovivify a file or directory handle if the handle passed to them is an uninitialized scalar variable. This allows the constructs such as open(my $fh, ...)
and open(local $fh,...)
to be used to create filehandles that will conveniently be closed automatically when the scope ends, provided there are no other references to them. This largely eliminates the need for typeglobs when opening filehandles that must be passed around, as in the following example:
sub myopen {
open my $fh, "@_"
or die "Can't open '@_': $!";
return $fh;
}
{
my $f = myopen(";
# $f implicitly closed here
}
p561-open() with more than two arguments
If open() is passed three arguments instead of two, the second argument is used as the mode and the third argument is taken to be the file name. This is primarily useful for protecting against unintended magic behavior of the traditional two-argument form. See "open" in perlfunc.
p561-64-bit support
Any platform that has 64-bit integers either
(1) natively as longs or ints
(2) via special compiler flags
(3) using long long or int64_t
is able to use "quads" (64-bit integers) as follows:
- constants (decimal, hexadecimal, octal, binary) in the code
- arguments to oct() and hex()
- arguments to print(), printf() and sprintf() (flag prefixes ll, L, q)
- printed as such
- pack() and unpack() "q" and "Q" formats
- in basic arithmetics: + - * / % (NOTE: operating close to the limits of the integer values may produce surprising results)
- in bit arithmetics: & | ^ ~ << >> (NOTE: these used to be forced to be 32 bits wide but now operate on the full native width.)
- vec()
Note that unless you have the case (a) you will have to configure and compile Perl using the -Duse64bitint Configure flag.
NOTE: The Configure flags -Duselonglong and -Duse64bits have been
deprecated. Use -Duse64bitint instead.
There are actually two modes of 64-bitness: the first one is achieved using Configure -Duse64bitint and the second one using Configure -Duse64bitall. The difference is that the first one is minimal and the second one maximal. The first works in more places than the second.
The use64bitint
does only as much as is required to get 64-bit integers into Perl (this may mean, for example, using "long longs") while your memory may still be limited to 2 gigabytes (because your pointers could still be 32-bit). Note that the name 64bitint
does not imply that your C compiler will be using 64-bit int
s (it might, but it doesn't have to): the use64bitint
means that you will be able to have 64 bits wide scalar values.
The use64bitall
goes all the way by attempting to switch also integers (if it can), longs (and pointers) to being 64-bit. This may create an even more binary incompatible Perl than -Duse64bitint: the resulting executable may not run at all in a 32-bit box, or you may have to reboot/reconfigure/rebuild your operating system to be 64-bit aware.
Natively 64-bit systems like Alpha and Cray need neither -Duse64bitint nor -Duse64bitall.
Last but not least: note that due to Perl's habit of always using floating point numbers, the quads are still not true integers. When quads overflow their limits (0...18_446_744_073_709_551_615 unsigned, -9_223_372_036_854_775_808...9_223_372_036_854_775_807 signed), they are silently promoted to floating point numbers, after which they will start losing precision (in their lower digits).
NOTE: 64-bit support is still experimental on most platforms.
Existing support only covers the LP64 data model. In particular, the
LLP64 data model is not yet supported. 64-bit libraries and system
APIs on many platforms have not stabilized--your mileage may vary.
p561-Large file support
If you have filesystems that support "large files" (files larger than 2 gigabytes), you may now also be able to create and access them from Perl.
NOTE: The default action is to enable large file support, if
available on the platform.
If the large file support is on, and you have a Fcntl constant O_LARGEFILE, the O_LARGEFILE is automatically added to the flags of sysopen().
Beware that unless your filesystem also supports "sparse files" seeking to umpteen petabytes may be inadvisable.
Note that in addition to requiring a proper file system to do large files you may also need to adjust your per-process (or your per-system, or per-process-group, or per-user-group) maximum filesize limits before running Perl scripts that try to handle large files, especially if you intend to write such files.
Finally, in addition to your process/process group maximum filesize limits, you may have quota limits on your filesystems that stop you (your user id or your user group id) from using large files.
Adjusting your process/user/group/file system/operating system limits is outside the scope of Perl core language. For process limits, you may try increasing the limits using your shell's limits/limit/ulimit command before running Perl. The BSD::Resource extension (not included with the standard Perl distribution) may also be of use, it offers the getrlimit/setrlimit interface that can be used to adjust process resource usage limits, including the maximum filesize limit.
p561-Long doubles
In some systems you may be able to use long doubles to enhance the range and precision of your double precision floating point numbers (that is, Perl's numbers). Use Configure -Duselongdouble to enable this support (if it is available).
p561-"more bits"
You can "Configure -Dusemorebits" to turn on both the 64-bit support and the long double support.
p561-Enhanced support for sort() subroutines
Perl subroutines with a prototype of ($$)
, and XSUBs in general, can now be used as sort subroutines. In either case, the two elements to be compared are passed as normal parameters in @_. See "sort" in perlfunc.
For unprototyped sort subroutines, the historical behavior of passing the elements to be compared as the global variables $a and $b remains unchanged.
p561-sort $coderef @foo
allowed
sort() did not accept a subroutine reference as the comparison function in earlier versions. This is now permitted.
p561-File globbing implemented internally
Perl now uses the File::Glob implementation of the glob() operator automatically. This avoids using an external csh process and the problems associated with it.
NOTE: This is currently an experimental feature. Interfaces and
implementation are subject to change.
p561-Support for CHECK blocks
In addition to BEGIN
, INIT
, END
, DESTROY
and AUTOLOAD
, subroutines named CHECK
are now special. These are queued up during compilation and behave similar to END blocks, except they are called at the end of compilation rather than at the end of execution. They cannot be called directly.
p561-POSIX character class syntax [: :] supported
For example to match alphabetic characters use /[[:alpha:]]/. See perlre for details.
p561-Better pseudo-random number generator
In 5.005_0x and earlier, perl's rand() function used the C library rand(3) function. As of 5.005_52, Configure tests for drand48(), random(), and rand() (in that order) and picks the first one it finds.
These changes should result in better random numbers from rand().
p561-Improved qw//
operator
The qw//
operator is now evaluated at compile time into a true list instead of being replaced with a run time call to split()
. This removes the confusing misbehaviour of qw//
in scalar context, which had inherited that behaviour from split().
Thus:
$foo = ($bar) = qw(a b c); print "$foo|$bar\n";
now correctly prints "3|a", instead of "2|a".
p561-Better worst-case behavior of hashes
Small changes in the hashing algorithm have been implemented in order to improve the distribution of lower order bits in the hashed value. This is expected to yield better performance on keys that are repeated sequences.
p561-pack() format 'Z' supported
The new format type 'Z' is useful for packing and unpacking null-terminated strings. See "pack" in perlfunc.
p561-pack() format modifier '!' supported
The new format type modifier '!' is useful for packing and unpacking native shorts, ints, and longs. See "pack" in perlfunc.
p561-pack() and unpack() support counted strings
The template character '/' can be used to specify a counted string type to be packed or unpacked. See "pack" in perlfunc.
p561-Comments in pack() templates
The '#' character in a template introduces a comment up to end of the line. This facilitates documentation of pack() templates.
p561-Weak references
In previous versions of Perl, you couldn't cache objects so as to allow them to be deleted if the last reference from outside the cache is deleted. The reference in the cache would hold a reference count on the object and the objects would never be destroyed.
Another familiar problem is with circular references. When an object references itself, its reference count would never go down to zero, and it would not get destroyed until the program is about to exit.
Weak references solve this by allowing you to "weaken" any reference, that is, make it not count towards the reference count. When the last non-weak reference to an object is deleted, the object is destroyed and all the weak references to the object are automatically undef-ed.
To use this feature, you need the Devel::WeakRef package from CPAN, which contains additional documentation.
NOTE: This is an experimental feature. Details are subject to change.
p561-Binary numbers supported
Binary numbers are now supported as literals, in s?printf formats, and oct()
:
$answer = 0b101010;
printf "The answer is: %b\n", oct("0b101010");
p561-Lvalue subroutines
Subroutines can now return modifiable lvalues. See "Lvalue subroutines" in perlsub.
NOTE: This is an experimental feature. Details are subject to change.
p561-Some arrows may be omitted in calls through references
Perl now allows the arrow to be omitted in many constructs involving subroutine calls through references. For example, $foo[10]->('foo')
may now be written $foo[10]('foo')
. This is rather similar to how the arrow may be omitted from $foo[10]->{'foo'}
. Note however, that the arrow is still required for foo(10)->('bar')
.
p561-Boolean assignment operators are legal lvalues
Constructs such as ($a ||= 2) += 1
are now allowed.
p561-exists() is supported on subroutine names
The exists() builtin now works on subroutine names. A subroutine is considered to exist if it has been declared (even if implicitly). See "exists" in perlfunc for examples.
p561-exists() and delete() are supported on array elements
The exists() and delete() builtins now work on simple arrays as well. The behavior is similar to that on hash elements.
exists() can be used to check whether an array element has been initialized. This avoids autovivifying array elements that don't exist. If the array is tied, the EXISTS() method in the corresponding tied package will be invoked.
delete() may be used to remove an element from the array and return it. The array element at that position returns to its uninitialized state, so that testing for the same element with exists() will return false. If the element happens to be the one at the end, the size of the array also shrinks up to the highest element that tests true for exists(), or 0 if none such is found. If the array is tied, the DELETE() method in the corresponding tied package will be invoked.
See "exists" in perlfunc and "delete" in perlfunc for examples.
p561-Pseudo-hashes work better
Dereferencing some types of reference values in a pseudo-hash, such as $ph->{foo}[1]
, was accidentally disallowed. This has been corrected.
When applied to a pseudo-hash element, exists() now reports whether the specified value exists, not merely if the key is valid.
delete() now works on pseudo-hashes. When given a pseudo-hash element or slice it deletes the values corresponding to the keys (but not the keys themselves). See "Pseudo-hashes: Using an array as a hash" in perlref.
Pseudo-hash slices with constant keys are now optimized to array lookups at compile-time.
List assignments to pseudo-hash slices are now supported.
The fields
pragma now provides ways to create pseudo-hashes, via fields::new() and fields::phash(). See fields.
NOTE: The pseudo-hash data type continues to be experimental.
Limiting oneself to the interface elements provided by the
fields pragma will provide protection from any future changes.
p561-Automatic flushing of output buffers
fork(), exec(), system(), qx//, and pipe open()s now flush buffers of all files opened for output when the operation was attempted. This mostly eliminates confusing buffering mishaps suffered by users unaware of how Perl internally handles I/O.
This is not supported on some platforms like Solaris where a suitably correct implementation of fflush(NULL) isn't available.
p561-Better diagnostics on meaningless filehandle operations
Constructs such as open()
and close()
are compile time errors. Attempting to read from filehandles that were opened only for writing will now produce warnings (just as writing to read-only filehandles does).
p561-Where possible, buffered data discarded from duped input filehandle
open(NEW, "<&OLD")
now attempts to discard any data that was previously read and buffered in OLD
before duping the handle. On platforms where doing this is allowed, the next read operation on NEW
will return the same data as the corresponding operation on OLD
. Formerly, it would have returned the data from the start of the following disk block instead.
p561-eof() has the same old magic as <>
eof()
would return true if no attempt to read from <>
had yet been made. eof()
has been changed to have a little magic of its own, it now opens the <>
files.
p561-binmode() can be used to set :crlf and :raw modes
binmode() now accepts a second argument that specifies a discipline for the handle in question. The two pseudo-disciplines ":raw" and ":crlf" are currently supported on DOS-derivative platforms. See "binmode" in perlfunc and open.
p561--T
filetest recognizes UTF-8 encoded files as "text"
The algorithm used for the -T
filetest has been enhanced to correctly identify UTF-8 content as "text".
p561-system(), backticks and pipe open now reflect exec() failure
On Unix and similar platforms, system(), qx() and open(FOO, "cmd |") etc., are implemented via fork() and exec(). When the underlying exec() fails, earlier versions did not report the error properly, since the exec() happened to be in a different process.
The child process now communicates with the parent about the error in launching the external command, which allows these constructs to return with their usual error value and set $!.
p561-Improved diagnostics
Line numbers are no longer suppressed (under most likely circumstances) during the global destruction phase.
Diagnostics emitted from code running in threads other than the main thread are now accompanied by the thread ID.
Embedded null characters in diagnostics now actually show up. They used to truncate the message in prior versions.
$foo::a and $foo::b are now exempt from "possible typo" warnings only if sort() is encountered in package foo
.
Unrecognized alphabetic escapes encountered when parsing quote constructs now generate a warning, since they may take on new semantics in later versions of Perl.
Many diagnostics now report the internal operation in which the warning was provoked, like so:
Use of uninitialized value in concatenation (.) at (eval 1) line 1.
Use of uninitialized value in print at (eval 1) line 1.
Diagnostics that occur within eval may also report the file and line number where the eval is located, in addition to the eval sequence number and the line number within the evaluated text itself. For example:
Not enough arguments for scalar at (eval 4)[newlib/perl5db.pl:1411] line 2, at EOF
p561-Diagnostics follow STDERR
Diagnostic output now goes to whichever file the STDERR
handle is pointing at, instead of always going to the underlying C runtime library's stderr
.
p561-More consistent close-on-exec behavior
On systems that support a close-on-exec flag on filehandles, the flag is now set for any handles created by pipe(), socketpair(), socket(), and accept(), if that is warranted by the value of $^F that may be in effect. Earlier versions neglected to set the flag for handles created with these operators. See "pipe" in perlfunc, "socketpair" in perlfunc, "socket" in perlfunc, "accept" in perlfunc, and "$^F" in perlvar.
p561-syswrite() ease-of-use
The length argument of syswrite()
has become optional.
p561-Better syntax checks on parenthesized unary operators
Expressions such as:
print defined(&foo,&bar,&baz);
print uc("foo","bar","baz");
undef($foo,&bar);
used to be accidentally allowed in earlier versions, and produced unpredictable behaviour. Some produced ancillary warnings when used in this way; others silently did the wrong thing.
The parenthesized forms of most unary operators that expect a single argument now ensure that they are not called with more than one argument, making the cases shown above syntax errors. The usual behaviour of:
print defined &foo, &bar, &baz;
print uc "foo", "bar", "baz";
undef $foo, &bar;
remains unchanged. See perlop.
p561-Bit operators support full native integer width
The bit operators (& | ^ ~ << >>) now operate on the full native integral width (the exact size of which is available in $Config{ivsize}). For example, if your platform is either natively 64-bit or if Perl has been configured to use 64-bit integers, these operations apply to 8 bytes (as opposed to 4 bytes on 32-bit platforms). For portability, be sure to mask off the excess bits in the result of unary ~
, e.g., ~$x & 0xffffffff
.
p561-Improved security features
More potentially unsafe operations taint their results for improved security.
The passwd
and shell
fields returned by the getpwent(), getpwnam(), and getpwuid() are now tainted, because the user can affect their own encrypted password and login shell.
The variable modified by shmread(), and messages returned by msgrcv() (and its object-oriented interface IPC::SysV::Msg::rcv) are also tainted, because other untrusted processes can modify messages and shared memory segments for their own nefarious purposes.
p561-More functional bareword prototype (*)
Bareword prototypes have been rationalized to enable them to be used to override builtins that accept barewords and interpret them in a special way, such as require
or do
.
Arguments prototyped as *
will now be visible within the subroutine as either a simple scalar or as a reference to a typeglob. See "Prototypes" in perlsub.
p561-require
and do
may be overridden
require
and do 'file'
operations may be overridden locally by importing subroutines of the same name into the current package (or globally by importing them into the CORE::GLOBAL:: namespace). Overriding require
will also affect use
, provided the override is visible at compile-time. See "Overriding Built-in Functions" in perlsub.
p561-$^X variables may now have names longer than one character
Formerly, $^X was synonymous with ${"\cX"}, but $^XY was a syntax error. Now variable names that begin with a control character may be arbitrarily long. However, for compatibility reasons, these variables must be written with explicit braces, as ${^XY}
for example. ${^XYZ}
is synonymous with ${"\cXYZ"}. Variable names with more than one control character, such as ${^XY^Z}
, are illegal.
The old syntax has not changed. As before, `^X' may be either a literal control-X character or the two-character sequence `caret' plus `X'. When braces are omitted, the variable name stops after the control character. Thus "$^XYZ"
continues to be synonymous with $^X . "YZ"
as before.
As before, lexical variables may not have names beginning with control characters. As before, variables whose names begin with a control character are always forced to be in package `main'. All such variables are reserved for future extensions, except those that begin with ^_
, which may be used by user programs and are guaranteed not to acquire special meaning in any future version of Perl.
p561-New variable $^C reflects -c
switch
$^C
has a boolean value that reflects whether perl is being run in compile-only mode (i.e. via the -c
switch). Since BEGIN blocks are executed under such conditions, this variable enables perl code to determine whether actions that make sense only during normal running are warranted. See perlvar.
p561-New variable $^V contains Perl version as a string
$^V
contains the Perl version number as a string composed of characters whose ordinals match the version numbers, i.e. v5.6.0. This may be used in string comparisons.
See Support for strings represented as a vector of ordinals
for an example.
p561-Optional Y2K warnings
If Perl is built with the cpp macro PERL_Y2KWARN
defined, it emits optional warnings when concatenating the number 19 with another number.
This behavior must be specifically enabled when running Configure. See INSTALL and README.Y2K.
p561-Arrays now always interpolate into double-quoted strings
In double-quoted strings, arrays now interpolate, no matter what. The behavior in earlier versions of perl 5 was that arrays would interpolate into strings if the array had been mentioned before the string was compiled, and otherwise Perl would raise a fatal compile-time error. In versions 5.000 through 5.003, the error was
Literal @example now requires backslash
In versions 5.004_01 through 5.6.0, the error was
In string, @example now must be written as \@example
The idea here was to get people into the habit of writing "fred\@example.com"
when they wanted a literal @
sign, just as they have always written "Give me back my \$5"
when they wanted a literal $
sign.
Starting with 5.6.1, when Perl now sees an @
sign in a double-quoted string, it always attempts to interpolate an array, regardless of whether or not the array has been used or declared already. The fatal error has been downgraded to an optional warning:
Possible unintended interpolation of @example in string
This warns you that "fred@example.com"
is going to turn into fred.com
if you don't backslash the @
. See http://perl.plover.com/at-error.html for more details about the history here.
p561-@- and @+ provide starting/ending offsets of regex submatches
The new magic variables @- and @+ provide the starting and ending offsets, respectively, of $&, $1, $2, etc. See perlvar for details.
p561-Modules and Pragmata
p561-Modules
- p561-attributes
-
While used internally by Perl as a pragma, this module also provides a way to fetch subroutine and variable attributes. See attributes.
- p561-B
-
The Perl Compiler suite has been extensively reworked for this release. More of the standard Perl test suite passes when run under the Compiler, but there is still a significant way to go to achieve production quality compiled executables.
NOTE: The Compiler suite remains highly experimental. The
generated code may not be correct, even when it manages to execute
without errors.
- p561-Benchmark
-
Overall, Benchmark results exhibit lower average error and better timing accuracy.
You can now run tests for n seconds instead of guessing the right number of tests to run: e.g., timethese(-5, ...) will run each code for at least 5 CPU seconds. Zero as the "number of repetitions" means "for at least 3 CPU seconds". The output format has also changed. For example:
use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
will now output something like this:
Benchmark: running a, b, each for at least 5 CPU seconds...
a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516)
b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686)
New features: "each for at least N CPU seconds...", "wallclock secs", and the "@ operations/CPU second (n=operations)".
timethese() now returns a reference to a hash of Benchmark objects containing the test results, keyed on the names of the tests.
timethis() now returns the iterations field in the Benchmark result object instead of 0.
timethese(), timethis(), and the new cmpthese() (see below) can also take a format specifier of 'none' to suppress output.
A new function countit() is just like timeit() except that it takes a TIME instead of a COUNT.
A new function cmpthese() prints a chart comparing the results of each test returned from a timethese() call. For each possible pair of tests, the percentage speed difference (iters/sec or seconds/iter) is shown.
For other details, see Benchmark.
- p561-ByteLoader
-
The ByteLoader is a dedicated extension to generate and run Perl bytecode. See ByteLoader.
- p561-constant
-
References can now be used.
The new version also allows a leading underscore in constant names, but disallows a double leading underscore (as in "__LINE__"). Some other names are disallowed or warned against, including BEGIN, END, etc. Some names which were forced into main:: used to fail silently in some cases; now they're fatal (outside of main::) and an optional warning (inside of main::). The ability to detect whether a constant had been set with a given name has been added.
See constant.
- p561-charnames
-
This pragma implements the \N
string escape. See charnames.
- p561-Data::Dumper
-
A Maxdepth
setting can be specified to avoid venturing too deeply into deep data structures. See Data::Dumper.
The XSUB implementation of Dump() is now automatically called if the Useqq
setting is not in use.
Dumping qr//
objects works correctly.
- p561-DB
-
DB
is an experimental module that exposes a clean abstraction to Perl's debugging API.
- p561-DB_File
-
DB_File can now be built with Berkeley DB versions 1, 2 or 3. See ext/DB_File/Changes
.
- p561-Devel::DProf
-
Devel::DProf, a Perl source code profiler has been added. See Devel::DProf and dprofpp.
- p561-Devel::Peek
-
The Devel::Peek module provides access to the internal representation of Perl variables and data. It is a data debugging tool for the XS programmer.
- p561-Dumpvalue
-
The Dumpvalue module provides screen dumps of Perl data.
- p561-DynaLoader
-
DynaLoader now supports a dl_unload_file() function on platforms that support unloading shared objects using dlclose().
Perl can also optionally arrange to unload all extension shared objects loaded by Perl. To enable this, build Perl with the Configure option -Accflags=-DDL_UNLOAD_ALL_AT_EXIT
. (This maybe useful if you are using Apache with mod_perl.)
- p561-English
-
$PERL_VERSION now stands for $^V
(a string value) rather than for $]
(a numeric value).
- p561-Env
-
Env now supports accessing environment variables like PATH as array variables.
- p561-Fcntl
-
More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for large file (more than 4GB) access (NOTE: the O_LARGEFILE is automatically added to sysopen() flags if large file support has been configured, as is the default), Free/Net/OpenBSD locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and O_ACCMODE: the combined mask of O_RDONLY, O_WRONLY, and O_RDWR. The seek()/sysseek() constants SEEK_SET, SEEK_CUR, and SEEK_END are available via the :seek
tag. The chmod()/stat() S_IF* constants and S_IS* functions are available via the :mode
tag.
- p561-File::Compare
-
A compare_text() function has been added, which allows custom comparison functions. See File::Compare.
- p561-File::Find
-
File::Find now works correctly when the wanted() function is either autoloaded or is a symbolic reference.
A bug that caused File::Find to lose track of the working directory when pruning top-level directories has been fixed.
File::Find now also supports several other options to control its behavior. It can follow symbolic links if the follow
option is specified. Enabling the no_chdir
option will make File::Find skip changing the current directory when walking directories. The untaint
flag can be useful when running with taint checks enabled.
See File::Find.
- p561-File::Glob
-
This extension implements BSD-style file globbing. By default, it will also be used for the internal implementation of the glob() operator. See File::Glob.
- p561-File::Spec
-
New methods have been added to the File::Spec module: devnull() returns the name of the null device (/dev/null on Unix) and tmpdir() the name of the temp directory (normally /tmp on Unix). There are now also methods to convert between absolute and relative filenames: abs2rel() and rel2abs(). For compatibility with operating systems that specify volume names in file paths, the splitpath(), splitdir(), and catdir() methods have been added.
- p561-File::Spec::Functions
-
The new File::Spec::Functions modules provides a function interface to the File::Spec module. Allows shorthand
$fullname = catfile($dir1, $dir2, $file);
instead of
$fullname = File::Spec->catfile($dir1, $dir2, $file);
- p561-Getopt::Long
-
Getopt::Long licensing has changed to allow the Perl Artistic License as well as the GPL. It used to be GPL only, which got in the way of non-GPL applications that wanted to use Getopt::Long.
Getopt::Long encourages the use of Pod::Usage to produce help messages. For example:
use Getopt::Long;
use Pod::Usage;
my $man = 0;
my $help = 0;
GetOptions('help|?' => \$help, man => \$man) or pod2usage(2);
pod2usage(1) if $help;
pod2usage(-exitstatus => 0, -verbose => 2) if $man;
__END__
=head1 NAME
sample - Using Getopt::Long and Pod::Usage
=head1 SYNOPSIS
sample [options] [file ...]
Options:
-help brief help message
-man full documentation
=head1 OPTIONS
=over 8
=item B<-help>
Print a brief help message and exits.
=item B<-man>
Prints the manual page and exits.
=back
=head1 DESCRIPTION
B will read the given input file(s) and do something
useful with the contents thereof.
=cut
See Pod::Usage for details.
A bug that prevented the non-option call-back <> from being specified as the first argument has been fixed.
To specify the characters < and > as option starters, use ><. Note, however, that changing option starters is strongly deprecated.
- p561-IO
-
write() and syswrite() will now accept a single-argument form of the call, for consistency with Perl's syswrite().
You can now create a TCP-based IO::Socket::INET without forcing a connect attempt. This allows you to configure its options (like making it non-blocking) and then call connect() manually.
A bug that prevented the IO::Socket::protocol() accessor from ever returning the correct value has been corrected.
IO::Socket::connect now uses non-blocking IO instead of alarm() to do connect timeouts.
IO::Socket::accept now uses select() instead of alarm() for doing timeouts.
IO::Socket::INET->new now sets $! correctly on failure. $@ is still set for backwards compatibility.
- p561-JPL
-
Java Perl Lingo is now distributed with Perl. See jpl/README for more information.
- p561-lib
-
use lib
now weeds out any trailing duplicate entries. no lib
removes all named entries.
- p561-Math::BigInt
-
The bitwise operations <<
, >>
, &
, |
, and ~
are now supported on bigints.
- p561-Math::Complex
-
The accessor methods Re, Im, arg, abs, rho, and theta can now also act as mutators (accessor $z->Re(), mutator $z->Re(3)).
The class method display_format
and the corresponding object method display_format
, in addition to accepting just one argument, now can also accept a parameter hash. Recognized keys of a parameter hash are "style"
, which corresponds to the old one parameter case, and two new parameters: "format"
, which is a printf()-style format string (defaults usually to "%.15g"
, you can revert to the default by setting the format string to undef
) used for both parts of a complex number, and "polar_pretty_print"
(defaults to true), which controls whether an attempt is made to try to recognize small multiples and rationals of pi (2pi, pi/2) at the argument (angle) of a polar complex number.
The potentially disruptive change is that in list context both methods now return the parameter hash, instead of only the value of the "style"
parameter.
- p561-Math::Trig
-
A little bit of radial trigonometry (cylindrical and spherical), radial coordinate conversions, and the great circle distance were added.
- p561-Pod::Parser, Pod::InputObjects
-
Pod::Parser is a base class for parsing and selecting sections of pod documentation from an input stream. This module takes care of identifying pod paragraphs and commands in the input and hands off the parsed paragraphs and commands to user-defined methods which are free to interpret or translate them as they see fit.
Pod::InputObjects defines some input objects needed by Pod::Parser, and for advanced users of Pod::Parser that need more about a command besides its name and text.
As of release 5.6.0 of Perl, Pod::Parser is now the officially sanctioned "base parser code" recommended for use by all pod2xxx translators. Pod::Text (pod2text) and Pod::Man (pod2man) have already been converted to use Pod::Parser and efforts to convert Pod::HTML (pod2html) are already underway. For any questions or comments about pod parsing and translating issues and utilities, please use the pod-people@perl.org mailing list.
For further information, please see Pod::Parser and Pod::InputObjects.
- p561-Pod::Checker, podchecker
-
This utility checks pod files for correct syntax, according to perlpod. Obvious errors are flagged as such, while warnings are printed for mistakes that can be handled gracefully. The checklist is not complete yet. See Pod::Checker.
- p561-Pod::ParseUtils, Pod::Find
-
These modules provide a set of gizmos that are useful mainly for pod translators. Pod::Find traverses directory structures and returns found pod files, along with their canonical names (like File::Spec::Unix
). Pod::ParseUtils contains Pod::List (useful for storing pod list information), Pod::Hyperlink (for parsing the contents of L<>
sequences) and Pod::Cache (for caching information about pod files, e.g., link nodes).
- p561-Pod::Select, podselect
-
Pod::Select is a subclass of Pod::Parser which provides a function named "podselect()" to filter out user-specified sections of raw pod documentation from an input stream. podselect is a script that provides access to Pod::Select from other scripts to be used as a filter. See Pod::Select.
- p561-Pod::Usage, pod2usage
-
Pod::Usage provides the function "pod2usage()" to print usage messages for a Perl script based on its embedded pod documentation. The pod2usage() function is generally useful to all script authors since it lets them write and maintain a single source (the pods) for documentation, thus removing the need to create and maintain redundant usage message text consisting of information already in the pods.
There is also a pod2usage script which can be used from other kinds of scripts to print usage messages from pods (even for non-Perl scripts with pods embedded in comments).
For details and examples, please see Pod::Usage.
- p561-Pod::Text and Pod::Man
-
Pod::Text has been rewritten to use Pod::Parser. While pod2text() is still available for backwards compatibility, the module now has a new preferred interface. See Pod::Text for the details. The new Pod::Text module is easily subclassed for tweaks to the output, and two such subclasses (Pod::Text::Termcap for man-page-style bold and underlining using termcap information, and Pod::Text::Color for markup with ANSI color sequences) are now standard.
pod2man has been turned into a module, Pod::Man, which also uses Pod::Parser. In the process, several outstanding bugs related to quotes in section headers, quoting of code escapes, and nested lists have been fixed. pod2man is now a wrapper script around this module.
- p561-SDBM_File
-
An EXISTS method has been added to this module (and sdbm_exists() has been added to the underlying sdbm library), so one can now call exists on an SDBM_File tied hash and get the correct result, rather than a runtime error.
A bug that may have caused data loss when more than one disk block happens to be read from the database in a single FETCH() has been fixed.
- p561-Sys::Syslog
-
Sys::Syslog now uses XSUBs to access facilities from syslog.h so it no longer requires syslog.ph to exist.
- p561-Sys::Hostname
-
Sys::Hostname now uses XSUBs to call the C library's gethostname() or uname() if they exist.
- p561-Term::ANSIColor
-
Term::ANSIColor is a very simple module to provide easy and readable access to the ANSI color and highlighting escape sequences, supported by most ANSI terminal emulators. It is now included standard.
- p561-Time::Local
-
The timelocal() and timegm() functions used to silently return bogus results when the date fell outside the machine's integer range. They now consistently croak() if the date falls in an unsupported range.
- p561-Win32
-
The error return value in list context has been changed for all functions that return a list of values. Previously these functions returned a list with a single element undef
if an error occurred. Now these functions return the empty list in these situations. This applies to the following functions:
Win32::FsType
Win32::GetOSVersion
The remaining functions are unchanged and continue to return undef
on error even in list context.
The Win32::SetLastError(ERROR) function has been added as a complement to the Win32::GetLastError() function.
The new Win32::GetFullPathName(FILENAME) returns the full absolute pathname for FILENAME in scalar context. In list context it returns a two-element list containing the fully qualified directory name and the filename. See Win32.
- p561-XSLoader
-
The XSLoader extension is a simpler alternative to DynaLoader. See XSLoader.
- p561-DBM Filters
-
A new feature called "DBM Filters" has been added to all the DBM modules--DB_File, GDBM_File, NDBM_File, ODBM_File, and SDBM_File. DBM Filters add four new methods to each DBM module:
filter_store_key
filter_store_value
filter_fetch_key
filter_fetch_value
These can be used to filter key-value pairs before the pairs are written to the database or just after they are read from the database. See perldbmfilter for further information.
p561-Pragmata
use attrs
is now obsolete, and is only provided for backward-compatibility. It's been replaced by the sub : attributes
syntax. See "Subroutine Attributes" in perlsub and attributes.
Lexical warnings pragma, use warnings;
, to control optional warnings. See perllexwarn.
use filetest
to control the behaviour of filetests (-r
-w
...). Currently only one subpragma implemented, "use filetest 'access';", that uses access(2) or equivalent to check permissions instead of using stat(2) as usual. This matters in filesystems where there are ACLs (access control lists): the stat(2) might lie, but access(2) knows better.
The open
pragma can be used to specify default disciplines for handle constructors (e.g. open()) and for qx//. The two pseudo-disciplines :raw
and :crlf
are currently supported on DOS-derivative platforms (i.e. where binmode is not a no-op). See also "p561-binmode() can be used to set :crlf and :raw modes".
p561-Utility Changes
p561-dprofpp
dprofpp
is used to display profile data generated using Devel::DProf
. See dprofpp.
p561-find2perl
The find2perl
utility now uses the enhanced features of the File::Find module. The -depth and -follow options are supported. Pod documentation is also included in the script.
p561-h2xs
The h2xs
tool can now work in conjunction with C::Scan
(available from CPAN) to automatically parse real-life header files. The -M
, -a
, -k
, and -o
options are new.
p561-perlcc
perlcc
now supports the C and Bytecode backends. By default, it generates output from the simple C backend rather than the optimized C backend.
Support for non-Unix platforms has been improved.
p561-perldoc
perldoc
has been reworked to avoid possible security holes. It will not by default let itself be run as the superuser, but you may still use the -U switch to try to make it drop privileges first.
p561-The Perl Debugger
Many bug fixes and enhancements were added to perl5db.pl, the Perl debugger. The help documentation was rearranged. New commands include < ?
, > ?
, and { ?
to list out current actions, man docpage
to run your doc viewer on some perl docset, and support for quoted options. The help information was rearranged, and should be viewable once again if you're using less as your pager. A serious security hole was plugged--you should immediately remove all older versions of the Perl debugger as installed in previous releases, all the way back to perl3, from your system to avoid being bitten by this.
p561-Improved Documentation
Many of the platform-specific README files are now part of the perl installation. See perl for the complete list.
- p561-perlapi.pod
-
The official list of public Perl API functions.
- p561-perlboot.pod
-
A tutorial for beginners on object-oriented Perl.
- p561-perlcompile.pod
-
An introduction to using the Perl Compiler suite.
- p561-perldbmfilter.pod
-
A howto document on using the DBM filter facility.
- p561-perldebug.pod
-
All material unrelated to running the Perl debugger, plus all low-level guts-like details that risked crushing the casual user of the debugger, have been relocated from the old manpage to the next entry below.
- p561-perldebguts.pod
-
This new manpage contains excessively low-level material not related to the Perl debugger, but slightly related to debugging Perl itself. It also contains some arcane internal details of how the debugging process works that may only be of interest to developers of Perl debuggers.
- p561-perlfork.pod
-
Notes on the fork() emulation currently available for the Windows platform.
- p561-perlfilter.pod
-
An introduction to writing Perl source filters.
- p561-perlhack.pod
-
Some guidelines for hacking the Perl source code.
- p561-perlintern.pod
-
A list of internal functions in the Perl source code. (List is currently empty.)
- p561-perllexwarn.pod
-
Introduction and reference information about lexically scoped warning categories.
- p561-perlnumber.pod
-
Detailed information about numbers as they are represented in Perl.
- p561-perlopentut.pod
-
A tutorial on using open() effectively.
- p561-perlreftut.pod
-
A tutorial that introduces the essentials of references.
- p561-perltootc.pod
-
A tutorial on managing class data for object modules.
- p561-perltodo.pod
-
Discussion of the most often wanted features that may someday be supported in Perl.
- p561-perlunicode.pod
-
An introduction to Unicode support features in Perl.
p561-Performance enhancements
p561-Simple sort() using { $a <=> $b } and the like are optimized
Many common sort() operations using a simple inlined block are now optimized for faster performance.
p561-Optimized assignments to lexical variables
Certain operations in the RHS of assignment statements have been optimized to directly set the lexical variable on the LHS, eliminating redundant copying overheads.
p561-Faster subroutine calls
Minor changes in how subroutine calls are handled internally provide marginal improvements in performance.
p561-delete(), each(), values() and hash iteration are faster
The hash values returned by delete(), each(), values() and hashes in a list context are the actual values in the hash, instead of copies. This results in significantly better performance, because it eliminates needless copying in most situations.
p561-Installation and Configuration Improvements
p561--Dusethreads means something different
The -Dusethreads flag now enables the experimental interpreter-based thread support by default. To get the flavor of experimental threads that was in 5.005 instead, you need to run Configure with "-Dusethreads -Duse5005threads".
As of v5.6.0, interpreter-threads support is still lacking a way to create new threads from Perl (i.e., use Thread;
will not work with interpreter threads). use Thread;
continues to be available when you specify the -Duse5005threads option to Configure, bugs and all.
NOTE: Support for threads continues to be an experimental feature.
Interfaces and implementation are subject to sudden and drastic changes.
p561-New Configure flags
The following new flags may be enabled on the Configure command line by running Configure with -Dflag
.
usemultiplicity
usethreads useithreads (new interpreter threads: no Perl API yet)
usethreads use5005threads (threads as they were in 5.005)
use64bitint (equal to now deprecated 'use64bits')
use64bitall
uselongdouble
usemorebits
uselargefiles
usesocks (only SOCKS v5 supported)
p561-Threadedness and 64-bitness now more daring
The Configure options enabling the use of threads and the use of 64-bitness are now more daring in the sense that they no more have an explicit list of operating systems of known threads/64-bit capabilities. In other words: if your operating system has the necessary APIs and datatypes, you should be able just to go ahead and use them, for threads by Configure -Dusethreads, and for 64 bits either explicitly by Configure -Duse64bitint or implicitly if your system has 64-bit wide datatypes. See also "p561-64-bit support".
p561-Long Doubles
Some platforms have "long doubles", floating point numbers of even larger range than ordinary "doubles". To enable using long doubles for Perl's scalars, use -Duselongdouble.
p561--Dusemorebits
You can enable both -Duse64bitint and -Duselongdouble with -Dusemorebits. See also "p561-64-bit support".
p561--Duselargefiles
Some platforms support system APIs that are capable of handling large files (typically, files larger than two gigabytes). Perl will try to use these APIs if you ask for -Duselargefiles.
See "p561-Large file support" for more information.
p561-installusrbinperl
You can use "Configure -Uinstallusrbinperl" which causes installperl to skip installing perl also as /usr/bin/perl. This is useful if you prefer not to modify /usr/bin for some reason or another but harmful because many scripts assume to find Perl in /usr/bin/perl.
p561-SOCKS support
You can use "Configure -Dusesocks" which causes Perl to probe for the SOCKS proxy protocol library (v5, not v4). For more information on SOCKS, see:
http://www.socks.nec.com/
p561--A
flag
You can "post-edit" the Configure variables using the Configure -A
switch. The editing happens immediately after the platform specific hints files have been processed but before the actual configuration process starts. Run Configure -h
to find out the full -A
syntax.
p561-Enhanced Installation Directories
The installation structure has been enriched to improve the support for maintaining multiple versions of perl, to provide locations for vendor-supplied modules, scripts, and manpages, and to ease maintenance of locally-added modules, scripts, and manpages. See the section on Installation Directories in the INSTALL file for complete details. For most users building and installing from source, the defaults should be fine.
If you previously used Configure -Dsitelib
or -Dsitearch
to set special values for library directories, you might wish to consider using the new -Dsiteprefix
setting instead. Also, if you wish to re-use a config.sh file from an earlier version of perl, you should be sure to check that Configure makes sensible choices for the new directories. See INSTALL for complete details.
p561-gcc automatically tried if 'cc' does not seem to be working
In many platforms the vendor-supplied 'cc' is too stripped-down to build Perl (basically, the 'cc' doesn't do ANSI C). If this seems to be the case and the 'cc' does not seem to be the GNU C compiler 'gcc', an automatic attempt is made to find and use 'gcc' instead.
p561-Platform specific changes
p561-Supported platforms
- The Mach CThreads (NEXTSTEP, OPENSTEP) are now supported by the Thread extension.
- GNU/Hurd is now supported.
- Rhapsody/Darwin is now supported.
- EPOC is now supported (on Psion 5).
- The cygwin port (formerly cygwin32) has been greatly improved.
p561-DOS
- Perl now works with djgpp 2.02 (and 2.03 alpha).
- Environment variable names are not converted to uppercase any more.
- Incorrect exit codes from backticks have been fixed.
- This port continues to use its own builtin globbing (not File::Glob).
p561-OS390 (OpenEdition MVS)
Support for this EBCDIC platform has not been renewed in this release. There are difficulties in reconciling Perl's standardization on UTF-8 as its internal representation for characters with the EBCDIC character set, because the two are incompatible.
It is unclear whether future versions will renew support for this platform, but the possibility exists.
p561-VMS
Numerous revisions and extensions to configuration, build, testing, and installation process to accommodate core changes and VMS-specific options.
Expand %ENV-handling code to allow runtime mapping to logical names, CLI symbols, and CRTL environ array.
Extension of subprocess invocation code to accept filespecs as command "verbs".
Add to Perl command line processing the ability to use default file types and to recognize Unix-style 2>&1
.
Expansion of File::Spec::VMS routines, and integration into ExtUtils::MM_VMS.
Extension of ExtUtils::MM_VMS to handle complex extensions more flexibly.
Barewords at start of Unix-syntax paths may be treated as text rather than only as logical names.
Optional secure translation of several logical names used internally by Perl.
Miscellaneous bugfixing and porting of new core code to VMS.
Thanks are gladly extended to the many people who have contributed VMS patches, testing, and ideas.
p561-Win32
Perl can now emulate fork() internally, using multiple interpreters running in different concurrent threads. This support must be enabled at build time. See perlfork for detailed information.
When given a pathname that consists only of a drivename, such as A:
, opendir() and stat() now use the current working directory for the drive rather than the drive root.
The builtin XSUB functions in the Win32:: namespace are documented. See Win32.
$^X now contains the full path name of the running executable.
A Win32::GetLongPathName() function is provided to complement Win32::GetFullPathName() and Win32::GetShortPathName(). See Win32.
POSIX::uname() is supported.
system(1,...) now returns true process IDs rather than process handles. kill() accepts any real process id, rather than strictly return values from system(1,...).
For better compatibility with Unix, kill(0, $pid)
can now be used to test whether a process exists.
The Shell
module is supported.
Better support for building Perl under command.com in Windows 95 has been added.
Scripts are read in binary mode by default to allow ByteLoader (and the filter mechanism in general) to work properly. For compatibility, the DATA filehandle will be set to text mode if a carriage return is detected at the end of the line containing the __END__ or __DATA__ token; if not, the DATA filehandle will be left open in binary mode. Earlier versions always opened the DATA filehandle in text mode.
The glob() operator is implemented via the File::Glob
extension, which supports glob syntax of the C shell. This increases the flexibility of the glob() operator, but there may be compatibility issues for programs that relied on the older globbing syntax. If you want to preserve compatibility with the older syntax, you might want to run perl with -MFile::DosGlob
. For details and compatibility information, see File::Glob.
p561-Significant bug fixes
p561- on empty files
With $/
set to undef
, "slurping" an empty file returns a string of zero length (instead of undef
, as it used to) the first time the HANDLE is read after $/
is set to undef
. Further reads yield undef
.
This means that the following will append "foo" to an empty file (it used to do nothing):
perl -0777 -pi -e 's/^/foo/' empty_file
The behaviour of:
perl -pi -e 's/^/foo/' empty_file
is unchanged (it continues to leave the file empty).
p561-eval '...'
improvements
Line numbers (as reflected by caller() and most diagnostics) within eval '...'
were often incorrect where here documents were involved. This has been corrected.
Lexical lookups for variables appearing in eval '...'
within functions that were themselves called within an eval '...'
were searching the wrong place for lexicals. The lexical search now correctly ends at the subroutine's block boundary.
The use of return
within eval {...}
caused $@ not to be reset correctly when no exception occurred within the eval. This has been fixed.
Parsing of here documents used to be flawed when they appeared as the replacement expression in eval 's/.../.../e'
. This has been fixed.
p561-All compilation errors are true errors
Some "errors" encountered at compile time were by necessity generated as warnings followed by eventual termination of the program. This enabled more such errors to be reported in a single run, rather than causing a hard stop at the first error that was encountered.
The mechanism for reporting such errors has been reimplemented to queue compile-time errors and report them at the end of the compilation as true errors rather than as warnings. This fixes cases where error messages leaked through in the form of warnings when code was compiled at run time using eval STRING
, and also allows such errors to be reliably trapped using eval "..."
.
p561-Implicitly closed filehandles are safer
Sometimes implicitly closed filehandles (as when they are localized, and Perl automatically closes them on exiting the scope) could inadvertently set $? or $!. This has been corrected.
p561-Behavior of list slices is more consistent
When taking a slice of a literal list (as opposed to a slice of an array or hash), Perl used to return an empty list if the result happened to be composed of all undef values.
The new behavior is to produce an empty list if (and only if) the original list was empty. Consider the following example:
@a = (1,undef,undef,2)[2,1,2];
The old behavior would have resulted in @a having no elements. The new behavior ensures it has three undefined elements.
Note in particular that the behavior of slices of the following cases remains unchanged:
@a = ()[1,2];
@a = (getpwent)[7,0];
@a = (anything_returning_empty_list())[2,1,2];
@a = @b[2,1,2];
@a = @c{'a','b','c'};
See perldata.
p561-(\$)
prototype and $foo{a}
A scalar reference prototype now correctly allows a hash or array element in that slot.
p561-goto &sub
and AUTOLOAD
The goto &sub
construct works correctly when &sub
happens to be autoloaded.
p561--bareword
allowed under use integer
The autoquoting of barewords preceded by -
did not work in prior versions when the integer
pragma was enabled. This has been fixed.
p561-Failures in DESTROY()
When code in a destructor threw an exception, it went unnoticed in earlier versions of Perl, unless someone happened to be looking in $@ just after the point the destructor happened to run. Such failures are now visible as warnings when warnings are enabled.
p561-Locale bugs fixed
printf() and sprintf() previously reset the numeric locale back to the default "C" locale. This has been fixed.
Numbers formatted according to the local numeric locale (such as using a decimal comma instead of a decimal dot) caused "isn't numeric" warnings, even while the operations accessing those numbers produced correct results. These warnings have been discontinued.
p561-Memory leaks
The eval 'return sub {...}'
construct could sometimes leak memory. This has been fixed.
Operations that aren't filehandle constructors used to leak memory when used on invalid filehandles. This has been fixed.
Constructs that modified @_
could fail to deallocate values in @_
and thus leak memory. This has been corrected.
p561-Spurious subroutine stubs after failed subroutine calls
Perl could sometimes create empty subroutine stubs when a subroutine was not found in the package. Such cases stopped later method lookups from progressing into base packages. This has been corrected.
p561-Taint failures under -U
When running in unsafe mode, taint violations could sometimes cause silent failures. This has been fixed.
p561-END blocks and the -c
switch
Prior versions used to run BEGIN and END blocks when Perl was run in compile-only mode. Since this is typically not the expected behavior, END blocks are not executed anymore when the -c
switch is used, or if compilation fails.
See "p561-Support for CHECK blocks" for how to run things when the compile phase ends.
p561-Potential to leak DATA filehandles
Using the __DATA__
token creates an implicit filehandle to the file that contains the token. It is the program's responsibility to close it when it is done reading from it.
This caveat is now better explained in the documentation. See perldata.
p561-New or Changed Diagnostics
- p561-"%s" variable %s masks earlier declaration in same %s
-
(W misc) A "my" or "our" variable has been redeclared in the current scope or statement, effectively eliminating all access to the previous instance. This is almost always a typographical error. Note that the earlier variable will still exist until the end of the scope or until all closure referents to it are destroyed.
- p561-"my sub" not yet implemented
-
(F) Lexically scoped subroutines are not yet implemented. Don't try that yet.
- p561-"our" variable %s redeclared
-
(W misc) You seem to have already declared the same global once before in the current lexical scope.
- p561-'!' allowed only after types %s
-
(F) The '!' is allowed in pack() and unpack() only after certain types. See "pack" in perlfunc.
- p561-/ cannot take a count
-
(F) You had an unpack template indicating a counted-length string, but you have also specified an explicit size for the string. See "pack" in perlfunc.
- p561-/ must be followed by a, A or Z
-
(F) You had an unpack template indicating a counted-length string, which must be followed by one of the letters a, A or Z to indicate what sort of string is to be unpacked. See "pack" in perlfunc.
- p561-/ must be followed by a*, A* or Z*
-
(F) You had a pack template indicating a counted-length string, Currently the only things that can have their length counted are a*, A* or Z*. See "pack" in perlfunc.
- p561-/ must follow a numeric type
-
(F) You had an unpack template that contained a '#', but this did not follow some numeric unpack specification. See "pack" in perlfunc.
- p561-/%s/: Unrecognized escape \\%c passed through
-
(W regexp) You used a backslash-character combination which is not recognized by Perl. This combination appears in an interpolated variable or a '
-delimited regular expression. The character was understood literally.
- p561-/%s/: Unrecognized escape \\%c in character class passed through
-
(W regexp) You used a backslash-character combination which is not recognized by Perl inside character classes. The character was understood literally.
- p561-/%s/ should probably be written as "%s"
-
(W syntax) You have used a pattern where Perl expected to find a string, as in the first argument to join
. Perl will treat the true or false result of matching the pattern against $_ as the string, which is probably not what you had in mind.
- p561-%s() called too early to check prototype
-
(W prototype) You've called a function that has a prototype before the parser saw a definition or declaration for it, and Perl could not check that the call conforms to the prototype. You need to either add an early prototype declaration for the subroutine in question, or move the subroutine definition ahead of the call to get proper prototype checking. Alternatively, if you are certain that you're calling the function correctly, you may put an ampersand before the name to avoid the warning. See perlsub.
- p561-%s argument is not a HASH or ARRAY element
-
(F) The argument to exists() must be a hash or array element, such as:
$foo{$bar}
$ref->{"susie"}[12]
- p561-%s argument is not a HASH or ARRAY element or slice
-
(F) The argument to delete() must be either a hash or array element, such as:
$foo{$bar}
$ref->{"susie"}[12]
or a hash or array slice, such as:
@foo[$bar, $baz, $xyzzy]
@{$ref->[12]}{"susie", "queue"}
- p561-%s argument is not a subroutine name
-
(F) The argument to exists() for exists &sub
must be a subroutine name, and not a subroutine call. exists &sub()
will generate this error.
- p561-%s package attribute may clash with future reserved word: %s
-
(W reserved) A lowercase attribute name was used that had a package-specific handler. That name might have a meaning to Perl itself some day, even though it doesn't yet. Perhaps you should use a mixed-case attribute name, instead. See attributes.
- p561-(in cleanup) %s
-
(W misc) This prefix usually indicates that a DESTROY() method raised the indicated exception. Since destructors are usually called by the system at arbitrary points during execution, and often a vast number of times, the warning is issued only once for any number of failures that would otherwise result in the same message being repeated.
Failure of user callbacks dispatched using the G_KEEPERR
flag could also result in this warning. See "G_KEEPERR" in perlcall.
- p561-<> should be quotes
-
(F) You wrote require
when you should have written require 'file'
.
- p561-Attempt to join self
-
(F) You tried to join a thread from within itself, which is an impossible task. You may be joining the wrong thread, or you may need to move the join() to some other thread.
- p561-Bad evalled substitution pattern
-
(F) You've used the /e switch to evaluate the replacement for a substitution, but perl found a syntax error in the code to evaluate, most likely an unexpected right brace '}'.
- p561-Bad realloc() ignored
-
(S) An internal routine called realloc() on something that had never been malloc()ed in the first place. Mandatory, but can be disabled by setting environment variable PERL_BADFREE
to 1.
- p561-Bareword found in conditional
-
(W bareword) The compiler found a bareword where it expected a conditional, which often indicates that an || or && was parsed as part of the last argument of the previous construct, for example:
open FOO || die;
It may also indicate a misspelled constant that has been interpreted as a bareword:
use constant TYPO => 1;
if (TYOP) { print "foo" }
The strict
pragma is useful in avoiding such errors.
- p561-Binary number > 0b11111111111111111111111111111111 non-portable
-
(W portable) The binary number you specified is larger than 2**32-1 (4294967295) and therefore non-portable between systems. See perlport for more on portability concerns.
- p561-Bit vector size > 32 non-portable
-
(W portable) Using bit vector sizes larger than 32 is non-portable.
- p561-Buffer overflow in prime_env_iter: %s
-
(W internal) A warning peculiar to VMS. While Perl was preparing to iterate over %ENV, it encountered a logical name or symbol definition which was too long, so it was truncated to the string shown.
- p561-Can't check filesystem of script "%s"
-
(P) For some reason you can't check the filesystem of the script for nosuid.
- p561-Can't declare class for non-scalar %s in "%s"
-
(S) Currently, only scalar variables can declared with a specific class qualifier in a "my" or "our" declaration. The semantics may be extended for other types of variables in future.
- p561-Can't declare %s in "%s"
-
(F) Only scalar, array, and hash variables may be declared as "my" or "our" variables. They must have ordinary identifiers as names.
- p561-Can't ignore signal CHLD, forcing to default
-
(W signal) Perl has detected that it is being run with the SIGCHLD signal (sometimes known as SIGCLD) disabled. Since disabling this signal will interfere with proper determination of exit status of child processes, Perl has reset the signal to its default value. This situation typically indicates that the parent program under which Perl may be running (e.g., cron) is being very careless.
- p561-Can't modify non-lvalue subroutine call
-
(F) Subroutines meant to be used in lvalue context should be declared as such, see "Lvalue subroutines" in perlsub.
- p561-Can't read CRTL environ
-
(S) A warning peculiar to VMS. Perl tried to read an element of %ENV from the CRTL's internal environment array and discovered the array was missing. You need to figure out where your CRTL misplaced its environ or define PERL_ENV_TABLES (see perlvms) so that environ is not searched.
- p561-Can't remove %s: %s, skipping file
-
(S) You requested an inplace edit without creating a backup file. Perl was unable to remove the original file to replace it with the modified file. The file was left unmodified.
- p561-Can't return %s from lvalue subroutine
-
(F) Perl detected an attempt to return illegal lvalues (such as temporary or readonly values) from a subroutine used as an lvalue. This is not allowed.
- p561-Can't weaken a nonreference
-
(F) You attempted to weaken something that was not a reference. Only references can be weakened.
- p561-Character class [:%s:] unknown
-
(F) The class in the character class [: :] syntax is unknown. See perlre.
- p561-Character class syntax [%s] belongs inside character classes
-
(W unsafe) The character class constructs [: :], [= =], and [. .] go inside character classes, the [] are part of the construct, for example: /[012[:alpha:]345]/. Note that [= =] and [. .] are not currently implemented; they are simply placeholders for future extensions.
- p561-Constant is not %s reference
-
(F) A constant value (perhaps declared using the use constant
pragma) is being dereferenced, but it amounts to the wrong type of reference. The message indicates the type of reference that was expected. This usually indicates a syntax error in dereferencing the constant value. See "Constant Functions" in perlsub and constant.
- p561-constant(%s): %s
-
(F) The parser found inconsistencies either while attempting to define an overloaded constant, or when trying to find the character name specified in the \N{...}
escape. Perhaps you forgot to load the corresponding overload
or charnames
pragma? See charnames and overload.
- p561-CORE::%s is not a keyword
-
(F) The CORE:: namespace is reserved for Perl keywords.
- p561-defined(@array) is deprecated
-
(D) defined() is not usually useful on arrays because it checks for an undefined scalar value. If you want to see if the array is empty, just use if (@array) { # not empty }
for example.
- p561-defined(%hash) is deprecated
-
(D) defined() is not usually useful on hashes because it checks for an undefined scalar value. If you want to see if the hash is empty, just use if (%hash) { # not empty }
for example.
- p561-Did not produce a valid header
-
See Server error.
- p561-(Did you mean "local" instead of "our"?)
-
(W misc) Remember that "our" does not localize the declared global variable. You have declared it again in the same lexical scope, which seems superfluous.
- p561-Document contains no data
-
See Server error.
- p561-entering effective %s failed
-
(F) While under the use filetest
pragma, switching the real and effective uids or gids failed.
- p561-false [] range "%s" in regexp
-
(W regexp) A character class range must start and end at a literal character, not another character class like \d
or [:alpha:]
. The "-" in your false range is interpreted as a literal "-". Consider quoting the "-", "\-". See perlre.
- p561-Filehandle %s opened only for output
-
(W io) You tried to read from a filehandle opened only for writing. If you intended it to be a read/write filehandle, you needed to open it with "+<" or "+>" or "+>>" instead of with "<" or nothing. If you intended only to read from the file, use "<". See "open" in perlfunc.
- p561-flock() on closed filehandle %s
-
(W closed) The filehandle you're attempting to flock() got itself closed some time before now. Check your logic flow. flock() operates on filehandles. Are you attempting to call flock() on a dirhandle by the same name?
- p561-Global symbol "%s" requires explicit package name
-
(F) You've said "use strict vars", which indicates that all variables must either be lexically scoped (using "my"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::").
- p561-Hexadecimal number > 0xffffffff non-portable
-
(W portable) The hexadecimal number you specified is larger than 2**32-1 (4294967295) and therefore non-portable between systems. See perlport for more on portability concerns.
- p561-Ill-formed CRTL environ value "%s"
-
(W internal) A warning peculiar to VMS. Perl tried to read the CRTL's internal environ array, and encountered an element without the =
delimiter used to separate keys from values. The element is ignored.
- p561-Ill-formed message in prime_env_iter: |%s|
-
(W internal) A warning peculiar to VMS. Perl tried to read a logical name or CLI symbol definition when preparing to iterate over %ENV, and didn't see the expected delimiter between key and value, so the line was ignored.
- p561-Illegal binary digit %s
-
(F) You used a digit other than 0 or 1 in a binary number.
- p561-Illegal binary digit %s ignored
-
(W digit) You may have tried to use a digit other than 0 or 1 in a binary number. Interpretation of the binary number stopped before the offending digit.
- p561-Illegal number of bits in vec
-
(F) The number of bits in vec() (the third argument) must be a power of two from 1 to 32 (or 64, if your platform supports that).
- p561-Integer overflow in %s number
-
(W overflow) The hexadecimal, octal or binary number you have specified either as a literal or as an argument to hex() or oct() is too big for your architecture, and has been converted to a floating point number. On a 32-bit architecture the largest hexadecimal, octal or binary number representable without overflow is 0xFFFFFFFF, 037777777777, or 0b11111111111111111111111111111111 respectively. Note that Perl transparently promotes all numbers to a floating point representation internally--subject to loss of precision errors in subsequent operations.
- p561-Invalid %s attribute: %s
-
The indicated attribute for a subroutine or variable was not recognized by Perl or by a user-supplied handler. See attributes.
- p561-Invalid %s attributes: %s
-
The indicated attributes for a subroutine or variable were not recognized by Perl or by a user-supplied handler. See attributes.
- p561-invalid [] range "%s" in regexp
-
The offending range is now explicitly displayed.
- p561-Invalid separator character %s in attribute list
-
(F) Something other than a colon or whitespace was seen between the elements of an attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon. See attributes.
- p561-Invalid separator character %s in subroutine attribute list
-
(F) Something other than a colon or whitespace was seen between the elements of a subroutine attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon.
- p561-leaving effective %s failed
-
(F) While under the use filetest
pragma, switching the real and effective uids or gids failed.
- p561-Lvalue subs returning %s not implemented yet
-
(F) Due to limitations in the current implementation, array and hash values cannot be returned in subroutines used in lvalue context. See "Lvalue subroutines" in perlsub.
- p561-Method %s not permitted
-
See Server error.
- p561-Missing %sbrace%s on \N{}
-
(F) Wrong syntax of character name literal \N{charname}
within double-quotish context.
- p561-Missing command in piped open
-
(W pipe) You used the open(FH, "| command")
or open(FH, "command |")
construction, but the command was missing or blank.
- p561-Missing name in "my sub"
-
(F) The reserved syntax for lexically scoped subroutines requires that they have a name with which they can be found.
- p561-No %s specified for -%c
-
(F) The indicated command line switch needs a mandatory argument, but you haven't specified one.
- p561-No package name allowed for variable %s in "our"
-
(F) Fully qualified variable names are not allowed in "our" declarations, because that doesn't make much sense under existing semantics. Such syntax is reserved for future extensions.
- p561-No space allowed after -%c
-
(F) The argument to the indicated command line switch must follow immediately after the switch, without intervening spaces.
- p561-no UTC offset information; assuming local time is UTC
-
(S) A warning peculiar to VMS. Perl was unable to find the local timezone offset, so it's assuming that local system time is equivalent to UTC. If it's not, define the logical name SYS$TIMEZONE_DIFFERENTIAL to translate to the number of seconds which need to be added to UTC to get local time.
- p561-Octal number > 037777777777 non-portable
-
(W portable) The octal number you specified is larger than 2**32-1 (4294967295) and therefore non-portable between systems. See perlport for more on portability concerns.
See also perlport for writing portable code.
- p561-panic: del_backref
-
(P) Failed an internal consistency check while trying to reset a weak reference.
- p561-panic: kid popen errno read
-
(F) forked child returned an incomprehensible message about its errno.
- p561-panic: magic_killbackrefs
-
(P) Failed an internal consistency check while trying to reset all weak references to an object.
- p561-Parentheses missing around "%s" list
-
(W parenthesis) You said something like
my $foo, $bar = @_;
when you meant
my ($foo, $bar) = @_;
Remember that "my", "our", and "local" bind tighter than comma.
- p561-Possible unintended interpolation of %s in string
-
(W ambiguous) It used to be that Perl would try to guess whether you wanted an array interpolated or a literal @. It no longer does this; arrays are now always interpolated into strings. This means that if you try something like:
print "fred@example.com";
and the array @example
doesn't exist, Perl is going to print fred.com
, which is probably not what you wanted. To get a literal @
sign in a string, put a backslash before it, just as you would to get a literal $
sign.
- p561-Possible Y2K bug: %s
-
(W y2k) You are concatenating the number 19 with another number, which could be a potential Year 2000 problem.
- p561-pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead
-
(W deprecated) You have written something like this:
sub doit
{
use attrs qw(locked);
}
You should use the new declaration syntax instead.
sub doit : locked
{
...
The use attrs
pragma is now obsolete, and is only provided for backward-compatibility. See "Subroutine Attributes" in perlsub.
- p561-Premature end of script headers
-
See Server error.
- p561-Repeat count in pack overflows
-
(F) You can't specify a repeat count so large that it overflows your signed integers. See "pack" in perlfunc.
- p561-Repeat count in unpack overflows
-
(F) You can't specify a repeat count so large that it overflows your signed integers. See "unpack" in perlfunc.
- p561-realloc() of freed memory ignored
-
(S) An internal routine called realloc() on something that had already been freed.
- p561-Reference is already weak
-
(W misc) You have attempted to weaken a reference that is already weak. Doing so has no effect.
- p561-setpgrp can't take arguments
-
(F) Your system has the setpgrp() from BSD 4.2, which takes no arguments, unlike POSIX setpgid(), which takes a process ID and process group ID.
- p561-Strange *+?{} on zero-length expression
-
(W regexp) You applied a regular expression quantifier in a place where it makes no sense, such as on a zero-width assertion. Try putting the quantifier inside the assertion instead. For example, the way to match "abc" provided that it is followed by three repetitions of "xyz" is /abc(?=(?:xyz){3})/
, not /abc(?=xyz){3}/
.
- p561-switching effective %s is not implemented
-
(F) While under the use filetest
pragma, we cannot switch the real and effective uids or gids.
- p561-This Perl can't reset CRTL environ elements (%s)
-
- p561-This Perl can't set CRTL environ elements (%s=%s)
-
(W internal) Warnings peculiar to VMS. You tried to change or delete an element of the CRTL's internal environ array, but your copy of Perl wasn't built with a CRTL that contained the setenv() function. You'll need to rebuild Perl with a CRTL that does, or redefine PERL_ENV_TABLES (see perlvms) so that the environ array isn't the target of the change to %ENV which produced the warning.
- p561-Too late to run %s block
-
(W void) A CHECK or INIT block is being defined during run time proper, when the opportunity to run them has already passed. Perhaps you are loading a file with require
or do
when you should be using use
instead. Or perhaps you should put the require
or do
inside a BEGIN block.
- p561-Unknown open() mode '%s'
-
(F) The second argument of 3-argument open() is not among the list of valid modes: <
, >
, >>
, +<
, +>
, +>>
, -|
, |-
.
- p561-Unknown process %x sent message to prime_env_iter: %s
-
(P) An error peculiar to VMS. Perl was reading values for %ENV before iterating over it, and someone else stuck a message in the stream of data Perl expected. Someone's very confused, or perhaps trying to subvert Perl's population of %ENV for nefarious purposes.
- p561-Unrecognized escape \\%c passed through
-
(W misc) You used a backslash-character combination which is not recognized by Perl. The character was understood literally.
- p561-Unterminated attribute parameter in attribute list
-
(F) The lexer saw an opening (left) parenthesis character while parsing an attribute list, but the matching closing (right) parenthesis character was not found. You may need to add (or remove) a backslash character to get your parentheses to balance. See attributes.
- p561-Unterminated attribute list
-
(F) The lexer found something other than a simple identifier at the start of an attribute, and it wasn't a semicolon or the start of a block. Perhaps you terminated the parameter list of the previous attribute too soon. See attributes.
- p561-Unterminated attribute parameter in subroutine attribute list
-
(F) The lexer saw an opening (left) parenthesis character while parsing a subroutine attribute list, but the matching closing (right) parenthesis character was not found. You may need to add (or remove) a backslash character to get your parentheses to balance.
- p561-Unterminated subroutine attribute list
-
(F) The lexer found something other than a simple identifier at the start of a subroutine attribute, and it wasn't a semicolon or the start of a block. Perhaps you terminated the parameter list of the previous attribute too soon.
- p561-Value of CLI symbol "%s" too long
-
(W misc) A warning peculiar to VMS. Perl tried to read the value of an %ENV element from a CLI symbol table, and found a resultant string longer than 1024 characters. The return value has been truncated to 1024 characters.
- p561-Version number must be a constant number
-
(P) The attempt to translate a use Module n.n LIST
statement into its equivalent BEGIN
block found an internal inconsistency with the version number.
p561-New tests
- p561-lib/attrs
-
Compatibility tests for sub : attrs
vs the older use attrs
.
- p561-lib/env
-
Tests for new environment scalar capability (e.g., use Env qw($BAR);
).
- p561-lib/env-array
-
Tests for new environment array capability (e.g., use Env qw(@PATH);
).
- p561-lib/io_const
-
IO constants (SEEK_*, _IO*).
- p561-lib/io_dir
-
Directory-related IO methods (new, read, close, rewind, tied delete).
- p561-lib/io_multihomed
-
INET sockets with multi-homed hosts.
- p561-lib/io_poll
-
IO poll().
- p561-lib/io_unix
-
UNIX sockets.
- p561-op/attrs
-
Regression tests for my ($x,@y,%z) : attrs
and .
- p561-op/filetest
-
File test operators.
- p561-op/lex_assign
-
Verify operations that access pad objects (lexicals and temporaries).
- p561-op/exists_sub
-
Verify exists &sub
operations.
p561-Incompatible Changes
p561-Perl Source Incompatibilities
Beware that any new warnings that have been added or old ones that have been enhanced are not considered incompatible changes.
Since all new warnings must be explicitly requested via the -w
switch or the warnings
pragma, it is ultimately the programmer's responsibility to ensure that warnings are enabled judiciously.
- p561-CHECK is a new keyword
-
All subroutine definitions named CHECK are now special. See /"Support for CHECK blocks"
for more information.
- p561-Treatment of list slices of undef has changed
-
There is a potential incompatibility in the behavior of list slices that are comprised entirely of undefined values. See "p561-Behavior of list slices is more consistent".
- p561-Format of $English::PERL_VERSION is different
-
The English module now sets $PERL_VERSION to $^V (a string value) rather than $]
(a numeric value). This is a potential incompatibility. Send us a report via perlbug if you are affected by this.
See "p561-Improved Perl version numbering system" for the reasons for this change.
- p561-Literals of the form
1.2.3
parse differently
-
Previously, numeric literals with more than one dot in them were interpreted as a floating point number concatenated with one or more numbers. Such "numbers" are now parsed as strings composed of the specified ordinals.
For example, print 97.98.99
used to output 97.9899
in earlier versions, but now prints abc
.
See "p561-Support for strings represented as a vector of ordinals".
- p561-Possibly changed pseudo-random number generator
-
Perl programs that depend on reproducing a specific set of pseudo-random numbers may now produce different output due to improvements made to the rand() builtin. You can use sh Configure -Drandfunc=rand
to obtain the old behavior.
- p561-Hashing function for hash keys has changed
-
Even though Perl hashes are not order preserving, the apparently random order encountered when iterating on the contents of a hash is actually determined by the hashing algorithm used. Improvements in the algorithm may yield a random order that is different from that of previous versions, especially when iterating on hashes.
See "p561-Better worst-case behavior of hashes" for additional information.
- p561-
undef
fails on read only values
-
Using the undef
operator on a readonly value (such as $1) has the same effect as assigning undef
to the readonly value--it throws an exception.
- p561-Close-on-exec bit may be set on pipe and socket handles
-
Pipe and socket handles are also now subject to the close-on-exec behavior determined by the special variable $^F.
- p561-Writing
"$$1"
to mean "${$}1"
is unsupported
-
Perl 5.004 deprecated the interpretation of $$1
and similar within interpolated strings to mean $$ . "1"
, but still allowed it.
In Perl 5.6.0 and later, "$$1"
always means "${$1}"
.
- p561-delete(), each(), values() and
\(%h)
-
operate on aliases to values, not copies
delete(), each(), values() and hashes (e.g. \(%h)
) in a list context return the actual values in the hash, instead of copies (as they used to in earlier versions). Typical idioms for using these constructs copy the returned values, but this can make a significant difference when creating references to the returned values. Keys in the hash are still returned as copies when iterating on a hash.
See also "p561-delete(), each(), values() and hash iteration are faster".
- p561-vec(EXPR,OFFSET,BITS) enforces powers-of-two BITS
-
vec() generates a run-time error if the BITS argument is not a valid power-of-two integer.
- p561-Text of some diagnostic output has changed
-
Most references to internal Perl operations in diagnostics have been changed to be more descriptive. This may be an issue for programs that may incorrectly rely on the exact text of diagnostics for proper functioning.
- p561-
%@
has been removed
-
The undocumented special variable %@
that used to accumulate "background" errors (such as those that happen in DESTROY()) has been removed, because it could potentially result in memory leaks.
- p561-Parenthesized not() behaves like a list operator
-
The not
operator now falls under the "if it looks like a function, it behaves like a function" rule.
As a result, the parenthesized form can be used with grep
and map
. The following construct used to be a syntax error before, but it works as expected now:
grep not($_), @things;
On the other hand, using not
with a literal list slice may not work. The following previously allowed construct:
print not (1,2,3)[0];
needs to be written with additional parentheses now:
print not((1,2,3)[0]);
The behavior remains unaffected when not
is not followed by parentheses.
- p561-Semantics of bareword prototype
(*)
have changed
-
The semantics of the bareword prototype *
have changed. Perl 5.005 always coerced simple scalar arguments to a typeglob, which wasn't useful in situations where the subroutine must distinguish between a simple scalar and a typeglob. The new behavior is to not coerce bareword arguments to a typeglob. The value will always be visible as either a simple scalar or as a reference to a typeglob.
- p561-Semantics of bit operators may have changed on 64-bit platforms
-
If your platform is either natively 64-bit or if Perl has been configured to used 64-bit integers, i.e., $Config{ivsize} is 8, there may be a potential incompatibility in the behavior of bitwise numeric operators (& | ^ ~ << >>). These operators used to strictly operate on the lower 32 bits of integers in previous versions, but now operate over the entire native integral width. In particular, note that unary ~
will produce different results on platforms that have different $Config{ivsize}. For portability, be sure to mask off the excess bits in the result of unary ~
, e.g., ~$x & 0xffffffff
.
- p561-More builtins taint their results
-
As described in "p561-Improved security features", there may be more sources of taint in a Perl program.
To avoid these new tainting behaviors, you can build Perl with the Configure option -Accflags=-DINCOMPLETE_TAINTS
. Beware that the ensuing perl binary may be insecure.
p561-C Source Incompatibilities
- p561-
PERL_POLLUTE
-
Release 5.005 grandfathered old global symbol names by providing preprocessor macros for extension source compatibility. As of release 5.6.0, these preprocessor definitions are not available by default. You need to explicitly compile perl with -DPERL_POLLUTE
to get these definitions. For extensions still using the old symbols, this option can be specified via MakeMaker:
perl Makefile.PL POLLUTE=1
- p561-
PERL_IMPLICIT_CONTEXT
-
This new build option provides a set of macros for all API functions such that an implicit interpreter/thread context argument is passed to every API function. As a result of this, something like sv_setsv(foo,bar)
amounts to a macro invocation that actually translates to something like Perl_sv_setsv(my_perl,foo,bar)
. While this is generally expected to not have any significant source compatibility issues, the difference between a macro and a real function call will need to be considered.
This means that there is a source compatibility issue as a result of this if your extensions attempt to use pointers to any of the Perl API functions.
Note that the above issue is not relevant to the default build of Perl, whose interfaces continue to match those of prior versions (but subject to the other options described here).
See "The Perl API" in perlguts for detailed information on the ramifications of building Perl with this option.
NOTE: PERL_IMPLICIT_CONTEXT is automatically enabled whenever Perl is built
with one of -Dusethreads, -Dusemultiplicity, or both. It is not
intended to be enabled by users at this time.
- p561-
PERL_POLLUTE_MALLOC
-
Enabling Perl's malloc in release 5.005 and earlier caused the namespace of the system's malloc family of functions to be usurped by the Perl versions, since by default they used the same names. Besides causing problems on platforms that do not allow these functions to be cleanly replaced, this also meant that the system versions could not be called in programs that used Perl's malloc. Previous versions of Perl have allowed this behaviour to be suppressed with the HIDEMYMALLOC and EMBEDMYMALLOC preprocessor definitions.
As of release 5.6.0, Perl's malloc family of functions have default names distinct from the system versions. You need to explicitly compile perl with -DPERL_POLLUTE_MALLOC
to get the older behaviour. HIDEMYMALLOC and EMBEDMYMALLOC have no effect, since the behaviour they enabled is now the default.
Note that these functions do not constitute Perl's memory allocation API. See "Memory Allocation" in perlguts for further information about that.
p561-Compatible C Source API Changes
- p561-
PATCHLEVEL
is now PERL_VERSION
-
The cpp macros PERL_REVISION
, PERL_VERSION
, and PERL_SUBVERSION
are now available by default from perl.h, and reflect the base revision, patchlevel, and subversion respectively. PERL_REVISION
had no prior equivalent, while PERL_VERSION
and PERL_SUBVERSION
were previously available as PATCHLEVEL
and SUBVERSION
.
The new names cause less pollution of the cpp namespace and reflect what the numbers have come to stand for in common practice. For compatibility, the old names are still supported when patchlevel.h is explicitly included (as required before), so there is no source incompatibility from the change.
p561-Binary Incompatibilities
In general, the default build of this release is expected to be binary compatible for extensions built with the 5.005 release or its maintenance versions. However, specific platforms may have broken binary compatibility due to changes in the defaults used in hints files. Therefore, please be sure to always check the platform-specific README files for any notes to the contrary.
The usethreads or usemultiplicity builds are not binary compatible with the corresponding builds in 5.005.
On platforms that require an explicit list of exports (AIX, OS/2 and Windows, among others), purely internal symbols such as parser functions and the run time opcodes are not exported by default. Perl 5.005 used to export all functions irrespective of whether they were considered part of the public API or not.
For the full list of public API functions, see perlapi.
p561-Known Problems
p561-Localizing a tied hash element may leak memory
As of the 5.6.1 release, there is a known leak when code such as this is executed:
use Tie::Hash;
tie my %tie_hash => 'Tie::StdHash';
...
local($tie_hash{Foo}) = 1; # leaks
p561-Known test failures
- 64-bit builds
Subtest #15 of lib/b.t may fail under 64-bit builds on platforms such as HP-UX PA64 and Linux IA64. The issue is still being investigated.
The lib/io_multihomed test may hang in HP-UX if Perl has been configured to be 64-bit. Because other 64-bit platforms do not hang in this test, HP-UX is suspect. All other tests pass in 64-bit HP-UX. The test attempts to create and connect to "multihomed" sockets (sockets which have multiple IP addresses).
Note that 64-bit support is still experimental.
- Failure of Thread tests
The subtests 19 and 20 of lib/thr5005.t test are known to fail due to fundamental problems in the 5.005 threading implementation. These are not new failures--Perl 5.005_0x has the same bugs, but didn't have these tests. (Note that support for 5.005-style threading remains experimental.)
- NEXTSTEP 3.3 POSIX test failure
In NEXTSTEP 3.3p2 the implementation of the strftime(3) in the operating system libraries is buggy: the %j format numbers the days of a month starting from zero, which, while being logical to programmers, will cause the subtests 19 to 27 of the lib/posix test may fail.
- Tru64 (aka Digital UNIX, aka DEC OSF/1) lib/sdbm test failure with gcc
If compiled with gcc 2.95 the lib/sdbm test will fail (dump core). The cure is to use the vendor cc, it comes with the operating system and produces good code.
p561-EBCDIC platforms not fully supported
In earlier releases of Perl, EBCDIC environments like OS390 (also known as Open Edition MVS) and VM-ESA were supported. Due to changes required by the UTF-8 (Unicode) support, the EBCDIC platforms are not supported in Perl 5.6.0.
The 5.6.1 release improves support for EBCDIC platforms, but they are not fully supported yet.
p561-UNICOS/mk CC failures during Configure run
In UNICOS/mk the following errors may appear during the Configure run:
Guessing which symbols your C compiler and preprocessor define...
CC-20 cc: ERROR File = try.c, Line = 3
...
bad switch yylook 79bad switch yylook 79bad switch yylook 79bad switch yylook 79#ifdef A29K
...
4 errors detected in the compilation of "try.c".
The culprit is the broken awk of UNICOS/mk. The effect is fortunately rather mild: Perl itself is not adversely affected by the error, only the h2ph utility coming with Perl, and that is rather rarely needed these days.
p561-Arrow operator and arrays
When the left argument to the arrow operator ->
is an array, or the scalar
operator operating on an array, the result of the operation must be considered erroneous. For example:
@x->[2]
scalar(@x)->[2]
These expressions will get run-time errors in some future release of Perl.
p561-Experimental features
As discussed above, many features are still experimental. Interfaces and implementation of these features are subject to change, and in extreme cases, even subject to removal in some future release of Perl. These features include the following:
- p561-Threads
-
- p561-Unicode
-
- p561-64-bit support
-
- p561-Lvalue subroutines
-
- p561-Weak references
-
- p561-The pseudo-hash data type
-
- p561-The Compiler suite
-
- p561-Internal implementation of file globbing
-
- p561-The DB module
-
- p561-The regular expression code constructs:
-
(?{ code })
and (??{ code })
p561-Obsolete Diagnostics
- p561-Character class syntax [: :] is reserved for future extensions
-
(W) Within regular expression character classes ([]) the syntax beginning with "[:" and ending with ":]" is reserved for future extensions. If you need to represent those character sequences inside a regular expression character class, just quote the square brackets with the backslash: "\[:" and ":\]".
- p561-Ill-formed logical name |%s| in prime_env_iter
-
(W) A warning peculiar to VMS. A logical name was encountered when preparing to iterate over %ENV which violates the syntactic rules governing logical names. Because it cannot be translated normally, it is skipped, and will not appear in %ENV. This may be a benign occurrence, as some software packages might directly modify logical name tables and introduce nonstandard names, or it may indicate that a logical name table has been corrupted.
- p561-In string, @%s now must be written as \@%s
-
The description of this error used to say:
(Someday it will simply assume that an unbackslashed @
interpolates an array.)
That day has come, and this fatal error has been removed. It has been replaced by a non-fatal warning instead. See "p561-Arrays now always interpolate into double-quoted strings" for details.
- p561-Probable precedence problem on %s
-
(W) The compiler found a bareword where it expected a conditional, which often indicates that an || or && was parsed as part of the last argument of the previous construct, for example:
open FOO || die;
- p561-regexp too big
-
(F) The current implementation of regular expressions uses shorts as address offsets within a string. Unfortunately this means that if the regular expression compiles to longer than 32767, it'll blow up. Usually when you want a regular expression this big, there is a better way to do it with multiple statements. See perlre.
- "_to_mean_"${$}
"_is_deprecated"
>p561-Use of "$$" to mean "${$}" is deprecated
-
(D) Perl versions before 5.004 misinterpreted any type marker followed by "$" and a digit. For example, "$$0" was incorrectly taken to mean "${$}0" instead of "${$0}". This bug is (mostly) fixed in Perl 5.004.
However, the developers of Perl 5.004 could not fix this bug completely, because at least two widely-used modules depend on the old meaning of "$$0" in a string. So Perl 5.004 still interprets "$$" in the old (broken) way inside strings; but it generates this message as a warning. And in Perl 5.005, this special treatment will cease.
p561-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. There may also be information at http://www.perl.com/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
p561-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p561-HISTORY
Written by Gurusamy Sarathy <gsar@ActiveState.com>, with many contributions from The Perl Porters.
Send omissions or corrections to <perlbug@perl.org>.
p56-NAME
perl56delta - what's new for perl v5.6.0
p56-DESCRIPTION
This document describes differences between the 5.005 release and the 5.6.0 release.
p56-Core Enhancements
p56-Interpreter cloning, threads, and concurrency
Perl 5.6.0 introduces the beginnings of support for running multiple interpreters concurrently in different threads. In conjunction with the perl_clone() API call, which can be used to selectively duplicate the state of any given interpreter, it is possible to compile a piece of code once in an interpreter, clone that interpreter one or more times, and run all the resulting interpreters in distinct threads.
On the Windows platform, this feature is used to emulate fork() at the interpreter level. See perlfork for details about that.
This feature is still in evolution. It is eventually meant to be used to selectively clone a subroutine and data reachable from that subroutine in a separate interpreter and run the cloned subroutine in a separate thread. Since there is no shared data between the interpreters, little or no locking will be needed (unless parts of the symbol table are explicitly shared). This is obviously intended to be an easy-to-use replacement for the existing threads support.
Support for cloning interpreters and interpreter concurrency can be enabled using the -Dusethreads Configure option (see win32/Makefile for how to enable it on Windows.) The resulting perl executable will be functionally identical to one that was built with -Dmultiplicity, but the perl_clone() API call will only be available in the former.
-Dusethreads enables the cpp macro USE_ITHREADS by default, which in turn enables Perl source code changes that provide a clear separation between the op tree and the data it operates with. The former is immutable, and can therefore be shared between an interpreter and all of its clones, while the latter is considered local to each interpreter, and is therefore copied for each clone.
Note that building Perl with the -Dusemultiplicity Configure option is adequate if you wish to run multiple independent interpreters concurrently in different threads. -Dusethreads only provides the additional functionality of the perl_clone() API call and other support for running cloned interpreters concurrently.
NOTE: This is an experimental feature. Implementation details are
subject to change.
p56-Lexically scoped warning categories
You can now control the granularity of warnings emitted by perl at a finer level using the use warnings
pragma. warnings and perllexwarn have copious documentation on this feature.
p56-Unicode and UTF-8 support
Perl now uses UTF-8 as its internal representation for character strings. The utf8
and bytes
pragmas are used to control this support in the current lexical scope. See perlunicode, utf8 and bytes for more information.
This feature is expected to evolve quickly to support some form of I/O disciplines that can be used to specify the kind of input and output data (bytes or characters). Until that happens, additional modules from CPAN will be needed to complete the toolkit for dealing with Unicode.
NOTE: This should be considered an experimental feature. Implementation
details are subject to change.
p56-Support for interpolating named characters
The new \N
escape interpolates named characters within strings. For example, "Hi! \N{WHITE SMILING FACE}"
evaluates to a string with a unicode smiley face at the end.
p56-"our" declarations
An "our" declaration introduces a value that can be best understood as a lexically scoped symbolic alias to a global variable in the package that was current where the variable was declared. This is mostly useful as an alternative to the vars
pragma, but also provides the opportunity to introduce typing and other attributes for such variables. See "our" in perlfunc.
p56-Support for strings represented as a vector of ordinals
Literals of the form v1.2.3.4
are now parsed as a string composed of characters with the specified ordinals. This is an alternative, more readable way to construct (possibly unicode) strings instead of interpolating characters, as in "\x{1}\x{2}\x{3}\x{4}"
. The leading v
may be omitted if there are more than two ordinals, so 1.2.3
is parsed the same as v1.2.3
.
Strings written in this form are also useful to represent version "numbers". It is easy to compare such version "numbers" (which are really just plain strings) using any of the usual string comparison operators eq
, ne
, lt
, gt
, etc., or perform bitwise string operations on them using |
, &
, etc.
In conjunction with the new $^V
magic variable (which contains the perl version as a string), such literals can be used as a readable way to check if you're running a particular version of Perl:
# this will parse in older versions of Perl also
if ($^V and $^V gt v5.6.0) {
# new features supported
}
require
and use
also have some special magic to support such literals, but this particular usage should be avoided because it leads to misleading error messages under versions of Perl which don't support vector strings. Using a true version number will ensure correct behavior in all versions of Perl:
require 5.006; # run time check for v5.6
use 5.006_001; # compile time check for v5.6.1
Also, sprintf
and printf
support the Perl-specific format flag %v
to print ordinals of characters in arbitrary strings:
printf "v%vd", $^V; # prints current version, such as "v5.5.650"
printf "%*vX", ":", $addr; # formats IPv6 address
printf "%*vb", " ", $bits; # displays bitstring
See "Scalar value constructors" in perldata for additional information.
p56-Improved Perl version numbering system
Beginning with Perl version 5.6.0, the version number convention has been changed to a "dotted integer" scheme that is more commonly found in open source projects.
Maintenance versions of v5.6.0 will be released as v5.6.1, v5.6.2 etc. The next development series following v5.6.0 will be numbered v5.7.x, beginning with v5.7.0, and the next major production release following v5.6.0 will be v5.8.0.
The English module now sets $PERL_VERSION to $^V (a string value) rather than $]
(a numeric value). (This is a potential incompatibility. Send us a report via perlbug if you are affected by this.)
The v1.2.3 syntax is also now legal in Perl. See "p56-Support for strings represented as a vector of ordinals" for more on that.
To cope with the new versioning system's use of at least three significant digits for each version component, the method used for incrementing the subversion number has also changed slightly. We assume that versions older than v5.6.0 have been incrementing the subversion component in multiples of 10. Versions after v5.6.0 will increment them by 1. Thus, using the new notation, 5.005_03 is the "same" as v5.5.30, and the first maintenance version following v5.6.0 will be v5.6.1 (which should be read as being equivalent to a floating point value of 5.006_001 in the older format, stored in $]
).
p56-New syntax for declaring subroutine attributes
Formerly, if you wanted to mark a subroutine as being a method call or as requiring an automatic lock() when it is entered, you had to declare that with a use attrs
pragma in the body of the subroutine. That can now be accomplished with declaration syntax, like this:
sub mymethod : locked method;
...
sub mymethod : locked method {
...
}
sub othermethod :locked :method;
...
sub othermethod :locked :method {
...
}
(Note how only the first :
is mandatory, and whitespace surrounding the :
is optional.)
AutoSplit.pm and SelfLoader.pm have been updated to keep the attributes with the stubs they provide. See attributes.
p56-File and directory handles can be autovivified
Similar to how constructs such as $x->[0]
autovivify a reference, handle constructors (open(), opendir(), pipe(), socketpair(), sysopen(), socket(), and accept()) now autovivify a file or directory handle if the handle passed to them is an uninitialized scalar variable. This allows the constructs such as open(my $fh, ...)
and open(local $fh,...)
to be used to create filehandles that will conveniently be closed automatically when the scope ends, provided there are no other references to them. This largely eliminates the need for typeglobs when opening filehandles that must be passed around, as in the following example:
sub myopen {
open my $fh, "@_"
or die "Can't open '@_': $!";
return $fh;
}
{
my $f = myopen(";
# $f implicitly closed here
}
p56-open() with more than two arguments
If open() is passed three arguments instead of two, the second argument is used as the mode and the third argument is taken to be the file name. This is primarily useful for protecting against unintended magic behavior of the traditional two-argument form. See "open" in perlfunc.
p56-64-bit support
Any platform that has 64-bit integers either
(1) natively as longs or ints
(2) via special compiler flags
(3) using long long or int64_t
is able to use "quads" (64-bit integers) as follows:
- constants (decimal, hexadecimal, octal, binary) in the code
- arguments to oct() and hex()
- arguments to print(), printf() and sprintf() (flag prefixes ll, L, q)
- printed as such
- pack() and unpack() "q" and "Q" formats
- in basic arithmetics: + - * / % (NOTE: operating close to the limits of the integer values may produce surprising results)
- in bit arithmetics: & | ^ ~ << >> (NOTE: these used to be forced to be 32 bits wide but now operate on the full native width.)
- vec()
Note that unless you have the case (a) you will have to configure and compile Perl using the -Duse64bitint Configure flag.
NOTE: The Configure flags -Duselonglong and -Duse64bits have been
deprecated. Use -Duse64bitint instead.
There are actually two modes of 64-bitness: the first one is achieved using Configure -Duse64bitint and the second one using Configure -Duse64bitall. The difference is that the first one is minimal and the second one maximal. The first works in more places than the second.
The use64bitint
does only as much as is required to get 64-bit integers into Perl (this may mean, for example, using "long longs") while your memory may still be limited to 2 gigabytes (because your pointers could still be 32-bit). Note that the name 64bitint
does not imply that your C compiler will be using 64-bit int
s (it might, but it doesn't have to): the use64bitint
means that you will be able to have 64 bits wide scalar values.
The use64bitall
goes all the way by attempting to switch also integers (if it can), longs (and pointers) to being 64-bit. This may create an even more binary incompatible Perl than -Duse64bitint: the resulting executable may not run at all in a 32-bit box, or you may have to reboot/reconfigure/rebuild your operating system to be 64-bit aware.
Natively 64-bit systems like Alpha and Cray need neither -Duse64bitint nor -Duse64bitall.
Last but not least: note that due to Perl's habit of always using floating point numbers, the quads are still not true integers. When quads overflow their limits (0...18_446_744_073_709_551_615 unsigned, -9_223_372_036_854_775_808...9_223_372_036_854_775_807 signed), they are silently promoted to floating point numbers, after which they will start losing precision (in their lower digits).
NOTE: 64-bit support is still experimental on most platforms.
Existing support only covers the LP64 data model. In particular, the
LLP64 data model is not yet supported. 64-bit libraries and system
APIs on many platforms have not stabilized--your mileage may vary.
p56-Large file support
If you have filesystems that support "large files" (files larger than 2 gigabytes), you may now also be able to create and access them from Perl.
NOTE: The default action is to enable large file support, if
available on the platform.
If the large file support is on, and you have a Fcntl constant O_LARGEFILE, the O_LARGEFILE is automatically added to the flags of sysopen().
Beware that unless your filesystem also supports "sparse files" seeking to umpteen petabytes may be inadvisable.
Note that in addition to requiring a proper file system to do large files you may also need to adjust your per-process (or your per-system, or per-process-group, or per-user-group) maximum filesize limits before running Perl scripts that try to handle large files, especially if you intend to write such files.
Finally, in addition to your process/process group maximum filesize limits, you may have quota limits on your filesystems that stop you (your user id or your user group id) from using large files.
Adjusting your process/user/group/file system/operating system limits is outside the scope of Perl core language. For process limits, you may try increasing the limits using your shell's limits/limit/ulimit command before running Perl. The BSD::Resource extension (not included with the standard Perl distribution) may also be of use, it offers the getrlimit/setrlimit interface that can be used to adjust process resource usage limits, including the maximum filesize limit.
p56-Long doubles
In some systems you may be able to use long doubles to enhance the range and precision of your double precision floating point numbers (that is, Perl's numbers). Use Configure -Duselongdouble to enable this support (if it is available).
p56-"more bits"
You can "Configure -Dusemorebits" to turn on both the 64-bit support and the long double support.
p56-Enhanced support for sort() subroutines
Perl subroutines with a prototype of ($$)
, and XSUBs in general, can now be used as sort subroutines. In either case, the two elements to be compared are passed as normal parameters in @_. See "sort" in perlfunc.
For unprototyped sort subroutines, the historical behavior of passing the elements to be compared as the global variables $a and $b remains unchanged.
p56-sort $coderef @foo
allowed
sort() did not accept a subroutine reference as the comparison function in earlier versions. This is now permitted.
p56-File globbing implemented internally
Perl now uses the File::Glob implementation of the glob() operator automatically. This avoids using an external csh process and the problems associated with it.
NOTE: This is currently an experimental feature. Interfaces and
implementation are subject to change.
p56-Support for CHECK blocks
In addition to BEGIN
, INIT
, END
, DESTROY
and AUTOLOAD
, subroutines named CHECK
are now special. These are queued up during compilation and behave similar to END blocks, except they are called at the end of compilation rather than at the end of execution. They cannot be called directly.
p56-POSIX character class syntax [: :] supported
For example to match alphabetic characters use /[[:alpha:]]/. See perlre for details.
p56-Better pseudo-random number generator
In 5.005_0x and earlier, perl's rand() function used the C library rand(3) function. As of 5.005_52, Configure tests for drand48(), random(), and rand() (in that order) and picks the first one it finds.
These changes should result in better random numbers from rand().
p56-Improved qw//
operator
The qw//
operator is now evaluated at compile time into a true list instead of being replaced with a run time call to split()
. This removes the confusing misbehaviour of qw//
in scalar context, which had inherited that behaviour from split().
Thus:
$foo = ($bar) = qw(a b c); print "$foo|$bar\n";
now correctly prints "3|a", instead of "2|a".
p56-Better worst-case behavior of hashes
Small changes in the hashing algorithm have been implemented in order to improve the distribution of lower order bits in the hashed value. This is expected to yield better performance on keys that are repeated sequences.
p56-pack() format 'Z' supported
The new format type 'Z' is useful for packing and unpacking null-terminated strings. See "pack" in perlfunc.
p56-pack() format modifier '!' supported
The new format type modifier '!' is useful for packing and unpacking native shorts, ints, and longs. See "pack" in perlfunc.
p56-pack() and unpack() support counted strings
The template character '/' can be used to specify a counted string type to be packed or unpacked. See "pack" in perlfunc.
p56-Comments in pack() templates
The '#' character in a template introduces a comment up to end of the line. This facilitates documentation of pack() templates.
p56-Weak references
In previous versions of Perl, you couldn't cache objects so as to allow them to be deleted if the last reference from outside the cache is deleted. The reference in the cache would hold a reference count on the object and the objects would never be destroyed.
Another familiar problem is with circular references. When an object references itself, its reference count would never go down to zero, and it would not get destroyed until the program is about to exit.
Weak references solve this by allowing you to "weaken" any reference, that is, make it not count towards the reference count. When the last non-weak reference to an object is deleted, the object is destroyed and all the weak references to the object are automatically undef-ed.
To use this feature, you need the Devel::WeakRef package from CPAN, which contains additional documentation.
NOTE: This is an experimental feature. Details are subject to change.
p56-Binary numbers supported
Binary numbers are now supported as literals, in s?printf formats, and oct()
:
$answer = 0b101010;
printf "The answer is: %b\n", oct("0b101010");
p56-Lvalue subroutines
Subroutines can now return modifiable lvalues. See "Lvalue subroutines" in perlsub.
NOTE: This is an experimental feature. Details are subject to change.
p56-Some arrows may be omitted in calls through references
Perl now allows the arrow to be omitted in many constructs involving subroutine calls through references. For example, $foo[10]->('foo')
may now be written $foo[10]('foo')
. This is rather similar to how the arrow may be omitted from $foo[10]->{'foo'}
. Note however, that the arrow is still required for foo(10)->('bar')
.
p56-Boolean assignment operators are legal lvalues
Constructs such as ($a ||= 2) += 1
are now allowed.
p56-exists() is supported on subroutine names
The exists() builtin now works on subroutine names. A subroutine is considered to exist if it has been declared (even if implicitly). See "exists" in perlfunc for examples.
p56-exists() and delete() are supported on array elements
The exists() and delete() builtins now work on simple arrays as well. The behavior is similar to that on hash elements.
exists() can be used to check whether an array element has been initialized. This avoids autovivifying array elements that don't exist. If the array is tied, the EXISTS() method in the corresponding tied package will be invoked.
delete() may be used to remove an element from the array and return it. The array element at that position returns to its uninitialized state, so that testing for the same element with exists() will return false. If the element happens to be the one at the end, the size of the array also shrinks up to the highest element that tests true for exists(), or 0 if none such is found. If the array is tied, the DELETE() method in the corresponding tied package will be invoked.
See "exists" in perlfunc and "delete" in perlfunc for examples.
p56-Pseudo-hashes work better
Dereferencing some types of reference values in a pseudo-hash, such as $ph->{foo}[1]
, was accidentally disallowed. This has been corrected.
When applied to a pseudo-hash element, exists() now reports whether the specified value exists, not merely if the key is valid.
delete() now works on pseudo-hashes. When given a pseudo-hash element or slice it deletes the values corresponding to the keys (but not the keys themselves). See "Pseudo-hashes: Using an array as a hash" in perlref.
Pseudo-hash slices with constant keys are now optimized to array lookups at compile-time.
List assignments to pseudo-hash slices are now supported.
The fields
pragma now provides ways to create pseudo-hashes, via fields::new() and fields::phash(). See fields.
NOTE: The pseudo-hash data type continues to be experimental.
Limiting oneself to the interface elements provided by the
fields pragma will provide protection from any future changes.
p56-Automatic flushing of output buffers
fork(), exec(), system(), qx//, and pipe open()s now flush buffers of all files opened for output when the operation was attempted. This mostly eliminates confusing buffering mishaps suffered by users unaware of how Perl internally handles I/O.
This is not supported on some platforms like Solaris where a suitably correct implementation of fflush(NULL) isn't available.
p56-Better diagnostics on meaningless filehandle operations
Constructs such as open()
and close()
are compile time errors. Attempting to read from filehandles that were opened only for writing will now produce warnings (just as writing to read-only filehandles does).
p56-Where possible, buffered data discarded from duped input filehandle
open(NEW, "<&OLD")
now attempts to discard any data that was previously read and buffered in OLD
before duping the handle. On platforms where doing this is allowed, the next read operation on NEW
will return the same data as the corresponding operation on OLD
. Formerly, it would have returned the data from the start of the following disk block instead.
p56-eof() has the same old magic as <>
eof()
would return true if no attempt to read from <>
had yet been made. eof()
has been changed to have a little magic of its own, it now opens the <>
files.
p56-binmode() can be used to set :crlf and :raw modes
binmode() now accepts a second argument that specifies a discipline for the handle in question. The two pseudo-disciplines ":raw" and ":crlf" are currently supported on DOS-derivative platforms. See "binmode" in perlfunc and open.
p56--T
filetest recognizes UTF-8 encoded files as "text"
The algorithm used for the -T
filetest has been enhanced to correctly identify UTF-8 content as "text".
p56-system(), backticks and pipe open now reflect exec() failure
On Unix and similar platforms, system(), qx() and open(FOO, "cmd |") etc., are implemented via fork() and exec(). When the underlying exec() fails, earlier versions did not report the error properly, since the exec() happened to be in a different process.
The child process now communicates with the parent about the error in launching the external command, which allows these constructs to return with their usual error value and set $!.
p56-Improved diagnostics
Line numbers are no longer suppressed (under most likely circumstances) during the global destruction phase.
Diagnostics emitted from code running in threads other than the main thread are now accompanied by the thread ID.
Embedded null characters in diagnostics now actually show up. They used to truncate the message in prior versions.
$foo::a and $foo::b are now exempt from "possible typo" warnings only if sort() is encountered in package foo
.
Unrecognized alphabetic escapes encountered when parsing quote constructs now generate a warning, since they may take on new semantics in later versions of Perl.
Many diagnostics now report the internal operation in which the warning was provoked, like so:
Use of uninitialized value in concatenation (.) at (eval 1) line 1.
Use of uninitialized value in print at (eval 1) line 1.
Diagnostics that occur within eval may also report the file and line number where the eval is located, in addition to the eval sequence number and the line number within the evaluated text itself. For example:
Not enough arguments for scalar at (eval 4)[newlib/perl5db.pl:1411] line 2, at EOF
p56-Diagnostics follow STDERR
Diagnostic output now goes to whichever file the STDERR
handle is pointing at, instead of always going to the underlying C runtime library's stderr
.
p56-More consistent close-on-exec behavior
On systems that support a close-on-exec flag on filehandles, the flag is now set for any handles created by pipe(), socketpair(), socket(), and accept(), if that is warranted by the value of $^F that may be in effect. Earlier versions neglected to set the flag for handles created with these operators. See "pipe" in perlfunc, "socketpair" in perlfunc, "socket" in perlfunc, "accept" in perlfunc, and "$^F" in perlvar.
p56-syswrite() ease-of-use
The length argument of syswrite()
has become optional.
p56-Better syntax checks on parenthesized unary operators
Expressions such as:
print defined(&foo,&bar,&baz);
print uc("foo","bar","baz");
undef($foo,&bar);
used to be accidentally allowed in earlier versions, and produced unpredictable behaviour. Some produced ancillary warnings when used in this way; others silently did the wrong thing.
The parenthesized forms of most unary operators that expect a single argument now ensure that they are not called with more than one argument, making the cases shown above syntax errors. The usual behaviour of:
print defined &foo, &bar, &baz;
print uc "foo", "bar", "baz";
undef $foo, &bar;
remains unchanged. See perlop.
p56-Bit operators support full native integer width
The bit operators (& | ^ ~ << >>) now operate on the full native integral width (the exact size of which is available in $Config{ivsize}). For example, if your platform is either natively 64-bit or if Perl has been configured to use 64-bit integers, these operations apply to 8 bytes (as opposed to 4 bytes on 32-bit platforms). For portability, be sure to mask off the excess bits in the result of unary ~
, e.g., ~$x & 0xffffffff
.
p56-Improved security features
More potentially unsafe operations taint their results for improved security.
The passwd
and shell
fields returned by the getpwent(), getpwnam(), and getpwuid() are now tainted, because the user can affect their own encrypted password and login shell.
The variable modified by shmread(), and messages returned by msgrcv() (and its object-oriented interface IPC::SysV::Msg::rcv) are also tainted, because other untrusted processes can modify messages and shared memory segments for their own nefarious purposes.
p56-More functional bareword prototype (*)
Bareword prototypes have been rationalized to enable them to be used to override builtins that accept barewords and interpret them in a special way, such as require
or do
.
Arguments prototyped as *
will now be visible within the subroutine as either a simple scalar or as a reference to a typeglob. See "Prototypes" in perlsub.
p56-require
and do
may be overridden
require
and do 'file'
operations may be overridden locally by importing subroutines of the same name into the current package (or globally by importing them into the CORE::GLOBAL:: namespace). Overriding require
will also affect use
, provided the override is visible at compile-time. See "Overriding Built-in Functions" in perlsub.
p56-$^X variables may now have names longer than one character
Formerly, $^X was synonymous with ${"\cX"}, but $^XY was a syntax error. Now variable names that begin with a control character may be arbitrarily long. However, for compatibility reasons, these variables must be written with explicit braces, as ${^XY}
for example. ${^XYZ}
is synonymous with ${"\cXYZ"}. Variable names with more than one control character, such as ${^XY^Z}
, are illegal.
The old syntax has not changed. As before, `^X' may be either a literal control-X character or the two-character sequence `caret' plus `X'. When braces are omitted, the variable name stops after the control character. Thus "$^XYZ"
continues to be synonymous with $^X . "YZ"
as before.
As before, lexical variables may not have names beginning with control characters. As before, variables whose names begin with a control character are always forced to be in package `main'. All such variables are reserved for future extensions, except those that begin with ^_
, which may be used by user programs and are guaranteed not to acquire special meaning in any future version of Perl.
p56-New variable $^C reflects -c
switch
$^C
has a boolean value that reflects whether perl is being run in compile-only mode (i.e. via the -c
switch). Since BEGIN blocks are executed under such conditions, this variable enables perl code to determine whether actions that make sense only during normal running are warranted. See perlvar.
p56-New variable $^V contains Perl version as a string
$^V
contains the Perl version number as a string composed of characters whose ordinals match the version numbers, i.e. v5.6.0. This may be used in string comparisons.
See Support for strings represented as a vector of ordinals
for an example.
p56-Optional Y2K warnings
If Perl is built with the cpp macro PERL_Y2KWARN
defined, it emits optional warnings when concatenating the number 19 with another number.
This behavior must be specifically enabled when running Configure. See INSTALL and README.Y2K.
p56-Arrays now always interpolate into double-quoted strings
In double-quoted strings, arrays now interpolate, no matter what. The behavior in earlier versions of perl 5 was that arrays would interpolate into strings if the array had been mentioned before the string was compiled, and otherwise Perl would raise a fatal compile-time error. In versions 5.000 through 5.003, the error was
Literal @example now requires backslash
In versions 5.004_01 through 5.6.0, the error was
In string, @example now must be written as \@example
The idea here was to get people into the habit of writing "fred\@example.com"
when they wanted a literal @
sign, just as they have always written "Give me back my \$5"
when they wanted a literal $
sign.
Starting with 5.6.1, when Perl now sees an @
sign in a double-quoted string, it always attempts to interpolate an array, regardless of whether or not the array has been used or declared already. The fatal error has been downgraded to an optional warning:
Possible unintended interpolation of @example in string
This warns you that "fred@example.com"
is going to turn into fred.com
if you don't backslash the @
. See http://perl.plover.com/at-error.html for more details about the history here.
p56-@- and @+ provide starting/ending offsets of regex matches
The new magic variables @- and @+ provide the starting and ending offsets, respectively, of $&, $1, $2, etc. See perlvar for details.
p56-Modules and Pragmata
p56-Modules
- p56-attributes
-
While used internally by Perl as a pragma, this module also provides a way to fetch subroutine and variable attributes. See attributes.
- p56-B
-
The Perl Compiler suite has been extensively reworked for this release. More of the standard Perl test suite passes when run under the Compiler, but there is still a significant way to go to achieve production quality compiled executables.
NOTE: The Compiler suite remains highly experimental. The
generated code may not be correct, even when it manages to execute
without errors.
- p56-Benchmark
-
Overall, Benchmark results exhibit lower average error and better timing accuracy.
You can now run tests for n seconds instead of guessing the right number of tests to run: e.g., timethese(-5, ...) will run each code for at least 5 CPU seconds. Zero as the "number of repetitions" means "for at least 3 CPU seconds". The output format has also changed. For example:
use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})
will now output something like this:
Benchmark: running a, b, each for at least 5 CPU seconds...
a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516)
b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686)
New features: "each for at least N CPU seconds...", "wallclock secs", and the "@ operations/CPU second (n=operations)".
timethese() now returns a reference to a hash of Benchmark objects containing the test results, keyed on the names of the tests.
timethis() now returns the iterations field in the Benchmark result object instead of 0.
timethese(), timethis(), and the new cmpthese() (see below) can also take a format specifier of 'none' to suppress output.
A new function countit() is just like timeit() except that it takes a TIME instead of a COUNT.
A new function cmpthese() prints a chart comparing the results of each test returned from a timethese() call. For each possible pair of tests, the percentage speed difference (iters/sec or seconds/iter) is shown.
For other details, see Benchmark.
- p56-ByteLoader
-
The ByteLoader is a dedicated extension to generate and run Perl bytecode. See ByteLoader.
- p56-constant
-
References can now be used.
The new version also allows a leading underscore in constant names, but disallows a double leading underscore (as in "__LINE__"). Some other names are disallowed or warned against, including BEGIN, END, etc. Some names which were forced into main:: used to fail silently in some cases; now they're fatal (outside of main::) and an optional warning (inside of main::). The ability to detect whether a constant had been set with a given name has been added.
See constant.
- p56-charnames
-
This pragma implements the \N
string escape. See charnames.
- p56-Data::Dumper
-
A Maxdepth
setting can be specified to avoid venturing too deeply into deep data structures. See Data::Dumper.
The XSUB implementation of Dump() is now automatically called if the Useqq
setting is not in use.
Dumping qr//
objects works correctly.
- p56-DB
-
DB
is an experimental module that exposes a clean abstraction to Perl's debugging API.
- p56-DB_File
-
DB_File can now be built with Berkeley DB versions 1, 2 or 3. See ext/DB_File/Changes
.
- p56-Devel::DProf
-
Devel::DProf, a Perl source code profiler has been added. See Devel::DProf and dprofpp.
- p56-Devel::Peek
-
The Devel::Peek module provides access to the internal representation of Perl variables and data. It is a data debugging tool for the XS programmer.
- p56-Dumpvalue
-
The Dumpvalue module provides screen dumps of Perl data.
- p56-DynaLoader
-
DynaLoader now supports a dl_unload_file() function on platforms that support unloading shared objects using dlclose().
Perl can also optionally arrange to unload all extension shared objects loaded by Perl. To enable this, build Perl with the Configure option -Accflags=-DDL_UNLOAD_ALL_AT_EXIT
. (This maybe useful if you are using Apache with mod_perl.)
- p56-English
-
$PERL_VERSION now stands for $^V
(a string value) rather than for $]
(a numeric value).
- p56-Env
-
Env now supports accessing environment variables like PATH as array variables.
- p56-Fcntl
-
More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for large file (more than 4GB) access (NOTE: the O_LARGEFILE is automatically added to sysopen() flags if large file support has been configured, as is the default), Free/Net/OpenBSD locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and O_ACCMODE: the combined mask of O_RDONLY, O_WRONLY, and O_RDWR. The seek()/sysseek() constants SEEK_SET, SEEK_CUR, and SEEK_END are available via the :seek
tag. The chmod()/stat() S_IF* constants and S_IS* functions are available via the :mode
tag.
- p56-File::Compare
-
A compare_text() function has been added, which allows custom comparison functions. See File::Compare.
- p56-File::Find
-
File::Find now works correctly when the wanted() function is either autoloaded or is a symbolic reference.
A bug that caused File::Find to lose track of the working directory when pruning top-level directories has been fixed.
File::Find now also supports several other options to control its behavior. It can follow symbolic links if the follow
option is specified. Enabling the no_chdir
option will make File::Find skip changing the current directory when walking directories. The untaint
flag can be useful when running with taint checks enabled.
See File::Find.
- p56-File::Glob
-
This extension implements BSD-style file globbing. By default, it will also be used for the internal implementation of the glob() operator. See File::Glob.
- p56-File::Spec
-
New methods have been added to the File::Spec module: devnull() returns the name of the null device (/dev/null on Unix) and tmpdir() the name of the temp directory (normally /tmp on Unix). There are now also methods to convert between absolute and relative filenames: abs2rel() and rel2abs(). For compatibility with operating systems that specify volume names in file paths, the splitpath(), splitdir(), and catdir() methods have been added.
- p56-File::Spec::Functions
-
The new File::Spec::Functions modules provides a function interface to the File::Spec module. Allows shorthand
$fullname = catfile($dir1, $dir2, $file);
instead of
$fullname = File::Spec->catfile($dir1, $dir2, $file);
- p56-Getopt::Long
-
Getopt::Long licensing has changed to allow the Perl Artistic License as well as the GPL. It used to be GPL only, which got in the way of non-GPL applications that wanted to use Getopt::Long.
Getopt::Long encourages the use of Pod::Usage to produce help messages. For example:
use Getopt::Long;
use Pod::Usage;
my $man = 0;
my $help = 0;
GetOptions('help|?' => \$help, man => \$man) or pod2usage(2);
pod2usage(1) if $help;
pod2usage(-exitstatus => 0, -verbose => 2) if $man;
__END__
=head1 NAME
sample - Using Getopt::Long and Pod::Usage
=head1 SYNOPSIS
sample [options] [file ...]
Options:
-help brief help message
-man full documentation
=head1 OPTIONS
=over 8
=item B<-help>
Print a brief help message and exits.
=item B<-man>
Prints the manual page and exits.
=back
=head1 DESCRIPTION
B will read the given input file(s) and do something
useful with the contents thereof.
=cut
See Pod::Usage for details.
A bug that prevented the non-option call-back <> from being specified as the first argument has been fixed.
To specify the characters < and > as option starters, use ><. Note, however, that changing option starters is strongly deprecated.
- p56-IO
-
write() and syswrite() will now accept a single-argument form of the call, for consistency with Perl's syswrite().
You can now create a TCP-based IO::Socket::INET without forcing a connect attempt. This allows you to configure its options (like making it non-blocking) and then call connect() manually.
A bug that prevented the IO::Socket::protocol() accessor from ever returning the correct value has been corrected.
IO::Socket::connect now uses non-blocking IO instead of alarm() to do connect timeouts.
IO::Socket::accept now uses select() instead of alarm() for doing timeouts.
IO::Socket::INET->new now sets $! correctly on failure. $@ is still set for backwards compatibility.
- p56-JPL
-
Java Perl Lingo is now distributed with Perl. See jpl/README for more information.
- p56-lib
-
use lib
now weeds out any trailing duplicate entries. no lib
removes all named entries.
- p56-Math::BigInt
-
The bitwise operations <<
, >>
, &
, |
, and ~
are now supported on bigints.
- p56-Math::Complex
-
The accessor methods Re, Im, arg, abs, rho, and theta can now also act as mutators (accessor $z->Re(), mutator $z->Re(3)).
The class method display_format
and the corresponding object method display_format
, in addition to accepting just one argument, now can also accept a parameter hash. Recognized keys of a parameter hash are "style"
, which corresponds to the old one parameter case, and two new parameters: "format"
, which is a printf()-style format string (defaults usually to "%.15g"
, you can revert to the default by setting the format string to undef
) used for both parts of a complex number, and "polar_pretty_print"
(defaults to true), which controls whether an attempt is made to try to recognize small multiples and rationals of pi (2pi, pi/2) at the argument (angle) of a polar complex number.
The potentially disruptive change is that in list context both methods now return the parameter hash, instead of only the value of the "style"
parameter.
- p56-Math::Trig
-
A little bit of radial trigonometry (cylindrical and spherical), radial coordinate conversions, and the great circle distance were added.
- p56-Pod::Parser, Pod::InputObjects
-
Pod::Parser is a base class for parsing and selecting sections of pod documentation from an input stream. This module takes care of identifying pod paragraphs and commands in the input and hands off the parsed paragraphs and commands to user-defined methods which are free to interpret or translate them as they see fit.
Pod::InputObjects defines some input objects needed by Pod::Parser, and for advanced users of Pod::Parser that need more about a command besides its name and text.
As of release 5.6.0 of Perl, Pod::Parser is now the officially sanctioned "base parser code" recommended for use by all pod2xxx translators. Pod::Text (pod2text) and Pod::Man (pod2man) have already been converted to use Pod::Parser and efforts to convert Pod::HTML (pod2html) are already underway. For any questions or comments about pod parsing and translating issues and utilities, please use the pod-people@perl.org mailing list.
For further information, please see Pod::Parser and Pod::InputObjects.
- p56-Pod::Checker, podchecker
-
This utility checks pod files for correct syntax, according to perlpod. Obvious errors are flagged as such, while warnings are printed for mistakes that can be handled gracefully. The checklist is not complete yet. See Pod::Checker.
- p56-Pod::ParseUtils, Pod::Find
-
These modules provide a set of gizmos that are useful mainly for pod translators. Pod::Find traverses directory structures and returns found pod files, along with their canonical names (like File::Spec::Unix
). Pod::ParseUtils contains Pod::List (useful for storing pod list information), Pod::Hyperlink (for parsing the contents of L<>
sequences) and Pod::Cache (for caching information about pod files, e.g., link nodes).
- p56-Pod::Select, podselect
-
Pod::Select is a subclass of Pod::Parser which provides a function named "podselect()" to filter out user-specified sections of raw pod documentation from an input stream. podselect is a script that provides access to Pod::Select from other scripts to be used as a filter. See Pod::Select.
- p56-Pod::Usage, pod2usage
-
Pod::Usage provides the function "pod2usage()" to print usage messages for a Perl script based on its embedded pod documentation. The pod2usage() function is generally useful to all script authors since it lets them write and maintain a single source (the pods) for documentation, thus removing the need to create and maintain redundant usage message text consisting of information already in the pods.
There is also a pod2usage script which can be used from other kinds of scripts to print usage messages from pods (even for non-Perl scripts with pods embedded in comments).
For details and examples, please see Pod::Usage.
- p56-Pod::Text and Pod::Man
-
Pod::Text has been rewritten to use Pod::Parser. While pod2text() is still available for backwards compatibility, the module now has a new preferred interface. See Pod::Text for the details. The new Pod::Text module is easily subclassed for tweaks to the output, and two such subclasses (Pod::Text::Termcap for man-page-style bold and underlining using termcap information, and Pod::Text::Color for markup with ANSI color sequences) are now standard.
pod2man has been turned into a module, Pod::Man, which also uses Pod::Parser. In the process, several outstanding bugs related to quotes in section headers, quoting of code escapes, and nested lists have been fixed. pod2man is now a wrapper script around this module.
- p56-SDBM_File
-
An EXISTS method has been added to this module (and sdbm_exists() has been added to the underlying sdbm library), so one can now call exists on an SDBM_File tied hash and get the correct result, rather than a runtime error.
A bug that may have caused data loss when more than one disk block happens to be read from the database in a single FETCH() has been fixed.
- p56-Sys::Syslog
-
Sys::Syslog now uses XSUBs to access facilities from syslog.h so it no longer requires syslog.ph to exist.
- p56-Sys::Hostname
-
Sys::Hostname now uses XSUBs to call the C library's gethostname() or uname() if they exist.
- p56-Term::ANSIColor
-
Term::ANSIColor is a very simple module to provide easy and readable access to the ANSI color and highlighting escape sequences, supported by most ANSI terminal emulators. It is now included standard.
- p56-Time::Local
-
The timelocal() and timegm() functions used to silently return bogus results when the date fell outside the machine's integer range. They now consistently croak() if the date falls in an unsupported range.
- p56-Win32
-
The error return value in list context has been changed for all functions that return a list of values. Previously these functions returned a list with a single element undef
if an error occurred. Now these functions return the empty list in these situations. This applies to the following functions:
Win32::FsType
Win32::GetOSVersion
The remaining functions are unchanged and continue to return undef
on error even in list context.
The Win32::SetLastError(ERROR) function has been added as a complement to the Win32::GetLastError() function.
The new Win32::GetFullPathName(FILENAME) returns the full absolute pathname for FILENAME in scalar context. In list context it returns a two-element list containing the fully qualified directory name and the filename. See Win32.
- p56-XSLoader
-
The XSLoader extension is a simpler alternative to DynaLoader. See XSLoader.
- p56-DBM Filters
-
A new feature called "DBM Filters" has been added to all the DBM modules--DB_File, GDBM_File, NDBM_File, ODBM_File, and SDBM_File. DBM Filters add four new methods to each DBM module:
filter_store_key
filter_store_value
filter_fetch_key
filter_fetch_value
These can be used to filter key-value pairs before the pairs are written to the database or just after they are read from the database. See perldbmfilter for further information.
p56-Pragmata
use attrs
is now obsolete, and is only provided for backward-compatibility. It's been replaced by the sub : attributes
syntax. See "Subroutine Attributes" in perlsub and attributes.
Lexical warnings pragma, use warnings;
, to control optional warnings. See perllexwarn.
use filetest
to control the behaviour of filetests (-r
-w
...). Currently only one subpragma implemented, "use filetest 'access';", that uses access(2) or equivalent to check permissions instead of using stat(2) as usual. This matters in filesystems where there are ACLs (access control lists): the stat(2) might lie, but access(2) knows better.
The open
pragma can be used to specify default disciplines for handle constructors (e.g. open()) and for qx//. The two pseudo-disciplines :raw
and :crlf
are currently supported on DOS-derivative platforms (i.e. where binmode is not a no-op). See also "p56-binmode() can be used to set :crlf and :raw modes".
p56-Utility Changes
p56-dprofpp
dprofpp
is used to display profile data generated using Devel::DProf
. See dprofpp.
p56-find2perl
The find2perl
utility now uses the enhanced features of the File::Find module. The -depth and -follow options are supported. Pod documentation is also included in the script.
p56-h2xs
The h2xs
tool can now work in conjunction with C::Scan
(available from CPAN) to automatically parse real-life header files. The -M
, -a
, -k
, and -o
options are new.
p56-perlcc
perlcc
now supports the C and Bytecode backends. By default, it generates output from the simple C backend rather than the optimized C backend.
Support for non-Unix platforms has been improved.
p56-perldoc
perldoc
has been reworked to avoid possible security holes. It will not by default let itself be run as the superuser, but you may still use the -U switch to try to make it drop privileges first.
p56-The Perl Debugger
Many bug fixes and enhancements were added to perl5db.pl, the Perl debugger. The help documentation was rearranged. New commands include < ?
, > ?
, and { ?
to list out current actions, man docpage
to run your doc viewer on some perl docset, and support for quoted options. The help information was rearranged, and should be viewable once again if you're using less as your pager. A serious security hole was plugged--you should immediately remove all older versions of the Perl debugger as installed in previous releases, all the way back to perl3, from your system to avoid being bitten by this.
p56-Improved Documentation
Many of the platform-specific README files are now part of the perl installation. See perl for the complete list.
- p56-perlapi.pod
-
The official list of public Perl API functions.
- p56-perlboot.pod
-
A tutorial for beginners on object-oriented Perl.
- p56-perlcompile.pod
-
An introduction to using the Perl Compiler suite.
- p56-perldbmfilter.pod
-
A howto document on using the DBM filter facility.
- p56-perldebug.pod
-
All material unrelated to running the Perl debugger, plus all low-level guts-like details that risked crushing the casual user of the debugger, have been relocated from the old manpage to the next entry below.
- p56-perldebguts.pod
-
This new manpage contains excessively low-level material not related to the Perl debugger, but slightly related to debugging Perl itself. It also contains some arcane internal details of how the debugging process works that may only be of interest to developers of Perl debuggers.
- p56-perlfork.pod
-
Notes on the fork() emulation currently available for the Windows platform.
- p56-perlfilter.pod
-
An introduction to writing Perl source filters.
- p56-perlhack.pod
-
Some guidelines for hacking the Perl source code.
- p56-perlintern.pod
-
A list of internal functions in the Perl source code. (List is currently empty.)
- p56-perllexwarn.pod
-
Introduction and reference information about lexically scoped warning categories.
- p56-perlnumber.pod
-
Detailed information about numbers as they are represented in Perl.
- p56-perlopentut.pod
-
A tutorial on using open() effectively.
- p56-perlreftut.pod
-
A tutorial that introduces the essentials of references.
- p56-perltootc.pod
-
A tutorial on managing class data for object modules.
- p56-perltodo.pod
-
Discussion of the most often wanted features that may someday be supported in Perl.
- p56-perlunicode.pod
-
An introduction to Unicode support features in Perl.
p56-Performance enhancements
p56-Simple sort() using { $a <=> $b } and the like are optimized
Many common sort() operations using a simple inlined block are now optimized for faster performance.
p56-Optimized assignments to lexical variables
Certain operations in the RHS of assignment statements have been optimized to directly set the lexical variable on the LHS, eliminating redundant copying overheads.
p56-Faster subroutine calls
Minor changes in how subroutine calls are handled internally provide marginal improvements in performance.
p56-delete(), each(), values() and hash iteration are faster
The hash values returned by delete(), each(), values() and hashes in a list context are the actual values in the hash, instead of copies. This results in significantly better performance, because it eliminates needless copying in most situations.
p56-Installation and Configuration Improvements
p56--Dusethreads means something different
The -Dusethreads flag now enables the experimental interpreter-based thread support by default. To get the flavor of experimental threads that was in 5.005 instead, you need to run Configure with "-Dusethreads -Duse5005threads".
As of v5.6.0, interpreter-threads support is still lacking a way to create new threads from Perl (i.e., use Thread;
will not work with interpreter threads). use Thread;
continues to be available when you specify the -Duse5005threads option to Configure, bugs and all.
NOTE: Support for threads continues to be an experimental feature.
Interfaces and implementation are subject to sudden and drastic changes.
p56-New Configure flags
The following new flags may be enabled on the Configure command line by running Configure with -Dflag
.
usemultiplicity
usethreads useithreads (new interpreter threads: no Perl API yet)
usethreads use5005threads (threads as they were in 5.005)
use64bitint (equal to now deprecated 'use64bits')
use64bitall
uselongdouble
usemorebits
uselargefiles
usesocks (only SOCKS v5 supported)
p56-Threadedness and 64-bitness now more daring
The Configure options enabling the use of threads and the use of 64-bitness are now more daring in the sense that they no more have an explicit list of operating systems of known threads/64-bit capabilities. In other words: if your operating system has the necessary APIs and datatypes, you should be able just to go ahead and use them, for threads by Configure -Dusethreads, and for 64 bits either explicitly by Configure -Duse64bitint or implicitly if your system has 64-bit wide datatypes. See also "p56-64-bit support".
p56-Long Doubles
Some platforms have "long doubles", floating point numbers of even larger range than ordinary "doubles". To enable using long doubles for Perl's scalars, use -Duselongdouble.
p56--Dusemorebits
You can enable both -Duse64bitint and -Duselongdouble with -Dusemorebits. See also "p56-64-bit support".
p56--Duselargefiles
Some platforms support system APIs that are capable of handling large files (typically, files larger than two gigabytes). Perl will try to use these APIs if you ask for -Duselargefiles.
See "p56-Large file support" for more information.
p56-installusrbinperl
You can use "Configure -Uinstallusrbinperl" which causes installperl to skip installing perl also as /usr/bin/perl. This is useful if you prefer not to modify /usr/bin for some reason or another but harmful because many scripts assume to find Perl in /usr/bin/perl.
p56-SOCKS support
You can use "Configure -Dusesocks" which causes Perl to probe for the SOCKS proxy protocol library (v5, not v4). For more information on SOCKS, see:
http://www.socks.nec.com/
p56--A
flag
You can "post-edit" the Configure variables using the Configure -A
switch. The editing happens immediately after the platform specific hints files have been processed but before the actual configuration process starts. Run Configure -h
to find out the full -A
syntax.
p56-Enhanced Installation Directories
The installation structure has been enriched to improve the support for maintaining multiple versions of perl, to provide locations for vendor-supplied modules, scripts, and manpages, and to ease maintenance of locally-added modules, scripts, and manpages. See the section on Installation Directories in the INSTALL file for complete details. For most users building and installing from source, the defaults should be fine.
If you previously used Configure -Dsitelib
or -Dsitearch
to set special values for library directories, you might wish to consider using the new -Dsiteprefix
setting instead. Also, if you wish to re-use a config.sh file from an earlier version of perl, you should be sure to check that Configure makes sensible choices for the new directories. See INSTALL for complete details.
p56-Platform specific changes
p56-Supported platforms
- The Mach CThreads (NEXTSTEP, OPENSTEP) are now supported by the Thread extension.
- GNU/Hurd is now supported.
- Rhapsody/Darwin is now supported.
- EPOC is now supported (on Psion 5).
- The cygwin port (formerly cygwin32) has been greatly improved.
p56-DOS
- Perl now works with djgpp 2.02 (and 2.03 alpha).
- Environment variable names are not converted to uppercase any more.
- Incorrect exit codes from backticks have been fixed.
- This port continues to use its own builtin globbing (not File::Glob).
p56-OS390 (OpenEdition MVS)
Support for this EBCDIC platform has not been renewed in this release. There are difficulties in reconciling Perl's standardization on UTF-8 as its internal representation for characters with the EBCDIC character set, because the two are incompatible.
It is unclear whether future versions will renew support for this platform, but the possibility exists.
p56-VMS
Numerous revisions and extensions to configuration, build, testing, and installation process to accommodate core changes and VMS-specific options.
Expand %ENV-handling code to allow runtime mapping to logical names, CLI symbols, and CRTL environ array.
Extension of subprocess invocation code to accept filespecs as command "verbs".
Add to Perl command line processing the ability to use default file types and to recognize Unix-style 2>&1
.
Expansion of File::Spec::VMS routines, and integration into ExtUtils::MM_VMS.
Extension of ExtUtils::MM_VMS to handle complex extensions more flexibly.
Barewords at start of Unix-syntax paths may be treated as text rather than only as logical names.
Optional secure translation of several logical names used internally by Perl.
Miscellaneous bugfixing and porting of new core code to VMS.
Thanks are gladly extended to the many people who have contributed VMS patches, testing, and ideas.
p56-Win32
Perl can now emulate fork() internally, using multiple interpreters running in different concurrent threads. This support must be enabled at build time. See perlfork for detailed information.
When given a pathname that consists only of a drivename, such as A:
, opendir() and stat() now use the current working directory for the drive rather than the drive root.
The builtin XSUB functions in the Win32:: namespace are documented. See Win32.
$^X now contains the full path name of the running executable.
A Win32::GetLongPathName() function is provided to complement Win32::GetFullPathName() and Win32::GetShortPathName(). See Win32.
POSIX::uname() is supported.
system(1,...) now returns true process IDs rather than process handles. kill() accepts any real process id, rather than strictly return values from system(1,...).
For better compatibility with Unix, kill(0, $pid)
can now be used to test whether a process exists.
The Shell
module is supported.
Better support for building Perl under command.com in Windows 95 has been added.
Scripts are read in binary mode by default to allow ByteLoader (and the filter mechanism in general) to work properly. For compatibility, the DATA filehandle will be set to text mode if a carriage return is detected at the end of the line containing the __END__ or __DATA__ token; if not, the DATA filehandle will be left open in binary mode. Earlier versions always opened the DATA filehandle in text mode.
The glob() operator is implemented via the File::Glob
extension, which supports glob syntax of the C shell. This increases the flexibility of the glob() operator, but there may be compatibility issues for programs that relied on the older globbing syntax. If you want to preserve compatibility with the older syntax, you might want to run perl with -MFile::DosGlob
. For details and compatibility information, see File::Glob.
p56-Significant bug fixes
p56- on empty files
With $/
set to undef
, "slurping" an empty file returns a string of zero length (instead of undef
, as it used to) the first time the HANDLE is read after $/
is set to undef
. Further reads yield undef
.
This means that the following will append "foo" to an empty file (it used to do nothing):
perl -0777 -pi -e 's/^/foo/' empty_file
The behaviour of:
perl -pi -e 's/^/foo/' empty_file
is unchanged (it continues to leave the file empty).
p56-eval '...'
improvements
Line numbers (as reflected by caller() and most diagnostics) within eval '...'
were often incorrect where here documents were involved. This has been corrected.
Lexical lookups for variables appearing in eval '...'
within functions that were themselves called within an eval '...'
were searching the wrong place for lexicals. The lexical search now correctly ends at the subroutine's block boundary.
The use of return
within eval {...}
caused $@ not to be reset correctly when no exception occurred within the eval. This has been fixed.
Parsing of here documents used to be flawed when they appeared as the replacement expression in eval 's/.../.../e'
. This has been fixed.
p56-All compilation errors are true errors
Some "errors" encountered at compile time were by necessity generated as warnings followed by eventual termination of the program. This enabled more such errors to be reported in a single run, rather than causing a hard stop at the first error that was encountered.
The mechanism for reporting such errors has been reimplemented to queue compile-time errors and report them at the end of the compilation as true errors rather than as warnings. This fixes cases where error messages leaked through in the form of warnings when code was compiled at run time using eval STRING
, and also allows such errors to be reliably trapped using eval "..."
.
p56-Implicitly closed filehandles are safer
Sometimes implicitly closed filehandles (as when they are localized, and Perl automatically closes them on exiting the scope) could inadvertently set $? or $!. This has been corrected.
p56-Behavior of list slices is more consistent
When taking a slice of a literal list (as opposed to a slice of an array or hash), Perl used to return an empty list if the result happened to be composed of all undef values.
The new behavior is to produce an empty list if (and only if) the original list was empty. Consider the following example:
@a = (1,undef,undef,2)[2,1,2];
The old behavior would have resulted in @a having no elements. The new behavior ensures it has three undefined elements.
Note in particular that the behavior of slices of the following cases remains unchanged:
@a = ()[1,2];
@a = (getpwent)[7,0];
@a = (anything_returning_empty_list())[2,1,2];
@a = @b[2,1,2];
@a = @c{'a','b','c'};
See perldata.
p56-(\$)
prototype and $foo{a}
A scalar reference prototype now correctly allows a hash or array element in that slot.
p56-goto &sub
and AUTOLOAD
The goto &sub
construct works correctly when &sub
happens to be autoloaded.
p56--bareword
allowed under use integer
The autoquoting of barewords preceded by -
did not work in prior versions when the integer
pragma was enabled. This has been fixed.
p56-Failures in DESTROY()
When code in a destructor threw an exception, it went unnoticed in earlier versions of Perl, unless someone happened to be looking in $@ just after the point the destructor happened to run. Such failures are now visible as warnings when warnings are enabled.
p56-Locale bugs fixed
printf() and sprintf() previously reset the numeric locale back to the default "C" locale. This has been fixed.
Numbers formatted according to the local numeric locale (such as using a decimal comma instead of a decimal dot) caused "isn't numeric" warnings, even while the operations accessing those numbers produced correct results. These warnings have been discontinued.
p56-Memory leaks
The eval 'return sub {...}'
construct could sometimes leak memory. This has been fixed.
Operations that aren't filehandle constructors used to leak memory when used on invalid filehandles. This has been fixed.
Constructs that modified @_
could fail to deallocate values in @_
and thus leak memory. This has been corrected.
p56-Spurious subroutine stubs after failed subroutine calls
Perl could sometimes create empty subroutine stubs when a subroutine was not found in the package. Such cases stopped later method lookups from progressing into base packages. This has been corrected.
p56-Taint failures under -U
When running in unsafe mode, taint violations could sometimes cause silent failures. This has been fixed.
p56-END blocks and the -c
switch
Prior versions used to run BEGIN and END blocks when Perl was run in compile-only mode. Since this is typically not the expected behavior, END blocks are not executed anymore when the -c
switch is used, or if compilation fails.
See "p56-Support for CHECK blocks" for how to run things when the compile phase ends.
p56-Potential to leak DATA filehandles
Using the __DATA__
token creates an implicit filehandle to the file that contains the token. It is the program's responsibility to close it when it is done reading from it.
This caveat is now better explained in the documentation. See perldata.
p56-New or Changed Diagnostics
- p56-"%s" variable %s masks earlier declaration in same %s
-
(W misc) A "my" or "our" variable has been redeclared in the current scope or statement, effectively eliminating all access to the previous instance. This is almost always a typographical error. Note that the earlier variable will still exist until the end of the scope or until all closure referents to it are destroyed.
- p56-"my sub" not yet implemented
-
(F) Lexically scoped subroutines are not yet implemented. Don't try that yet.
- p56-"our" variable %s redeclared
-
(W misc) You seem to have already declared the same global once before in the current lexical scope.
- p56-'!' allowed only after types %s
-
(F) The '!' is allowed in pack() and unpack() only after certain types. See "pack" in perlfunc.
- p56-/ cannot take a count
-
(F) You had an unpack template indicating a counted-length string, but you have also specified an explicit size for the string. See "pack" in perlfunc.
- p56-/ must be followed by a, A or Z
-
(F) You had an unpack template indicating a counted-length string, which must be followed by one of the letters a, A or Z to indicate what sort of string is to be unpacked. See "pack" in perlfunc.
- p56-/ must be followed by a*, A* or Z*
-
(F) You had a pack template indicating a counted-length string, Currently the only things that can have their length counted are a*, A* or Z*. See "pack" in perlfunc.
- p56-/ must follow a numeric type
-
(F) You had an unpack template that contained a '#', but this did not follow some numeric unpack specification. See "pack" in perlfunc.
- p56-/%s/: Unrecognized escape \\%c passed through
-
(W regexp) You used a backslash-character combination which is not recognized by Perl. This combination appears in an interpolated variable or a '
-delimited regular expression. The character was understood literally.
- p56-/%s/: Unrecognized escape \\%c in character class passed through
-
(W regexp) You used a backslash-character combination which is not recognized by Perl inside character classes. The character was understood literally.
- p56-/%s/ should probably be written as "%s"
-
(W syntax) You have used a pattern where Perl expected to find a string, as in the first argument to join
. Perl will treat the true or false result of matching the pattern against $_ as the string, which is probably not what you had in mind.
- p56-%s() called too early to check prototype
-
(W prototype) You've called a function that has a prototype before the parser saw a definition or declaration for it, and Perl could not check that the call conforms to the prototype. You need to either add an early prototype declaration for the subroutine in question, or move the subroutine definition ahead of the call to get proper prototype checking. Alternatively, if you are certain that you're calling the function correctly, you may put an ampersand before the name to avoid the warning. See perlsub.
- p56-%s argument is not a HASH or ARRAY element
-
(F) The argument to exists() must be a hash or array element, such as:
$foo{$bar}
$ref->{"susie"}[12]
- p56-%s argument is not a HASH or ARRAY element or slice
-
(F) The argument to delete() must be either a hash or array element, such as:
$foo{$bar}
$ref->{"susie"}[12]
or a hash or array slice, such as:
@foo[$bar, $baz, $xyzzy]
@{$ref->[12]}{"susie", "queue"}
- p56-%s argument is not a subroutine name
-
(F) The argument to exists() for exists &sub
must be a subroutine name, and not a subroutine call. exists &sub()
will generate this error.
- p56-%s package attribute may clash with future reserved word: %s
-
(W reserved) A lowercase attribute name was used that had a package-specific handler. That name might have a meaning to Perl itself some day, even though it doesn't yet. Perhaps you should use a mixed-case attribute name, instead. See attributes.
- p56-(in cleanup) %s
-
(W misc) This prefix usually indicates that a DESTROY() method raised the indicated exception. Since destructors are usually called by the system at arbitrary points during execution, and often a vast number of times, the warning is issued only once for any number of failures that would otherwise result in the same message being repeated.
Failure of user callbacks dispatched using the G_KEEPERR
flag could also result in this warning. See "G_KEEPERR" in perlcall.
- p56-<> should be quotes
-
(F) You wrote require
when you should have written require 'file'
.
- p56-Attempt to join self
-
(F) You tried to join a thread from within itself, which is an impossible task. You may be joining the wrong thread, or you may need to move the join() to some other thread.
- p56-Bad evalled substitution pattern
-
(F) You've used the /e switch to evaluate the replacement for a substitution, but perl found a syntax error in the code to evaluate, most likely an unexpected right brace '}'.
- p56-Bad realloc() ignored
-
(S) An internal routine called realloc() on something that had never been malloc()ed in the first place. Mandatory, but can be disabled by setting environment variable PERL_BADFREE
to 1.
- p56-Bareword found in conditional
-
(W bareword) The compiler found a bareword where it expected a conditional, which often indicates that an || or && was parsed as part of the last argument of the previous construct, for example:
open FOO || die;
It may also indicate a misspelled constant that has been interpreted as a bareword:
use constant TYPO => 1;
if (TYOP) { print "foo" }
The strict
pragma is useful in avoiding such errors.
- p56-Binary number > 0b11111111111111111111111111111111 non-portable
-
(W portable) The binary number you specified is larger than 2**32-1 (4294967295) and therefore non-portable between systems. See perlport for more on portability concerns.
- p56-Bit vector size > 32 non-portable
-
(W portable) Using bit vector sizes larger than 32 is non-portable.
- p56-Buffer overflow in prime_env_iter: %s
-
(W internal) A warning peculiar to VMS. While Perl was preparing to iterate over %ENV, it encountered a logical name or symbol definition which was too long, so it was truncated to the string shown.
- p56-Can't check filesystem of script "%s"
-
(P) For some reason you can't check the filesystem of the script for nosuid.
- p56-Can't declare class for non-scalar %s in "%s"
-
(S) Currently, only scalar variables can declared with a specific class qualifier in a "my" or "our" declaration. The semantics may be extended for other types of variables in future.
- p56-Can't declare %s in "%s"
-
(F) Only scalar, array, and hash variables may be declared as "my" or "our" variables. They must have ordinary identifiers as names.
- p56-Can't ignore signal CHLD, forcing to default
-
(W signal) Perl has detected that it is being run with the SIGCHLD signal (sometimes known as SIGCLD) disabled. Since disabling this signal will interfere with proper determination of exit status of child processes, Perl has reset the signal to its default value. This situation typically indicates that the parent program under which Perl may be running (e.g., cron) is being very careless.
- p56-Can't modify non-lvalue subroutine call
-
(F) Subroutines meant to be used in lvalue context should be declared as such, see "Lvalue subroutines" in perlsub.
- p56-Can't read CRTL environ
-
(S) A warning peculiar to VMS. Perl tried to read an element of %ENV from the CRTL's internal environment array and discovered the array was missing. You need to figure out where your CRTL misplaced its environ or define PERL_ENV_TABLES (see perlvms) so that environ is not searched.
- p56-Can't remove %s: %s, skipping file
-
(S) You requested an inplace edit without creating a backup file. Perl was unable to remove the original file to replace it with the modified file. The file was left unmodified.
- p56-Can't return %s from lvalue subroutine
-
(F) Perl detected an attempt to return illegal lvalues (such as temporary or readonly values) from a subroutine used as an lvalue. This is not allowed.
- p56-Can't weaken a nonreference
-
(F) You attempted to weaken something that was not a reference. Only references can be weakened.
- p56-Character class [:%s:] unknown
-
(F) The class in the character class [: :] syntax is unknown. See perlre.
- p56-Character class syntax [%s] belongs inside character classes
-
(W unsafe) The character class constructs [: :], [= =], and [. .] go inside character classes, the [] are part of the construct, for example: /[012[:alpha:]345]/. Note that [= =] and [. .] are not currently implemented; they are simply placeholders for future extensions.
- p56-Constant is not %s reference
-
(F) A constant value (perhaps declared using the use constant
pragma) is being dereferenced, but it amounts to the wrong type of reference. The message indicates the type of reference that was expected. This usually indicates a syntax error in dereferencing the constant value. See "Constant Functions" in perlsub and constant.
- p56-constant(%s): %s
-
(F) The parser found inconsistencies either while attempting to define an overloaded constant, or when trying to find the character name specified in the \N{...}
escape. Perhaps you forgot to load the corresponding overload
or charnames
pragma? See charnames and overload.
- p56-CORE::%s is not a keyword
-
(F) The CORE:: namespace is reserved for Perl keywords.
- p56-defined(@array) is deprecated
-
(D) defined() is not usually useful on arrays because it checks for an undefined scalar value. If you want to see if the array is empty, just use if (@array) { # not empty }
for example.
- p56-defined(%hash) is deprecated
-
(D) defined() is not usually useful on hashes because it checks for an undefined scalar value. If you want to see if the hash is empty, just use if (%hash) { # not empty }
for example.
- p56-Did not produce a valid header
-
See Server error.
- p56-(Did you mean "local" instead of "our"?)
-
(W misc) Remember that "our" does not localize the declared global variable. You have declared it again in the same lexical scope, which seems superfluous.
- p56-Document contains no data
-
See Server error.
- p56-entering effective %s failed
-
(F) While under the use filetest
pragma, switching the real and effective uids or gids failed.
- p56-false [] range "%s" in regexp
-
(W regexp) A character class range must start and end at a literal character, not another character class like \d
or [:alpha:]
. The "-" in your false range is interpreted as a literal "-". Consider quoting the "-", "\-". See perlre.
- p56-Filehandle %s opened only for output
-
(W io) You tried to read from a filehandle opened only for writing. If you intended it to be a read/write filehandle, you needed to open it with "+<" or "+>" or "+>>" instead of with "<" or nothing. If you intended only to read from the file, use "<". See "open" in perlfunc.
- p56-flock() on closed filehandle %s
-
(W closed) The filehandle you're attempting to flock() got itself closed some time before now. Check your logic flow. flock() operates on filehandles. Are you attempting to call flock() on a dirhandle by the same name?
- p56-Global symbol "%s" requires explicit package name
-
(F) You've said "use strict vars", which indicates that all variables must either be lexically scoped (using "my"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::").
- p56-Hexadecimal number > 0xffffffff non-portable
-
(W portable) The hexadecimal number you specified is larger than 2**32-1 (4294967295) and therefore non-portable between systems. See perlport for more on portability concerns.
- p56-Ill-formed CRTL environ value "%s"
-
(W internal) A warning peculiar to VMS. Perl tried to read the CRTL's internal environ array, and encountered an element without the =
delimiter used to separate keys from values. The element is ignored.
- p56-Ill-formed message in prime_env_iter: |%s|
-
(W internal) A warning peculiar to VMS. Perl tried to read a logical name or CLI symbol definition when preparing to iterate over %ENV, and didn't see the expected delimiter between key and value, so the line was ignored.
- p56-Illegal binary digit %s
-
(F) You used a digit other than 0 or 1 in a binary number.
- p56-Illegal binary digit %s ignored
-
(W digit) You may have tried to use a digit other than 0 or 1 in a binary number. Interpretation of the binary number stopped before the offending digit.
- p56-Illegal number of bits in vec
-
(F) The number of bits in vec() (the third argument) must be a power of two from 1 to 32 (or 64, if your platform supports that).
- p56-Integer overflow in %s number
-
(W overflow) The hexadecimal, octal or binary number you have specified either as a literal or as an argument to hex() or oct() is too big for your architecture, and has been converted to a floating point number. On a 32-bit architecture the largest hexadecimal, octal or binary number representable without overflow is 0xFFFFFFFF, 037777777777, or 0b11111111111111111111111111111111 respectively. Note that Perl transparently promotes all numbers to a floating point representation internally--subject to loss of precision errors in subsequent operations.
- p56-Invalid %s attribute: %s
-
The indicated attribute for a subroutine or variable was not recognized by Perl or by a user-supplied handler. See attributes.
- p56-Invalid %s attributes: %s
-
The indicated attributes for a subroutine or variable were not recognized by Perl or by a user-supplied handler. See attributes.
- p56-invalid [] range "%s" in regexp
-
The offending range is now explicitly displayed.
- p56-Invalid separator character %s in attribute list
-
(F) Something other than a colon or whitespace was seen between the elements of an attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon. See attributes.
- p56-Invalid separator character %s in subroutine attribute list
-
(F) Something other than a colon or whitespace was seen between the elements of a subroutine attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon.
- p56-leaving effective %s failed
-
(F) While under the use filetest
pragma, switching the real and effective uids or gids failed.
- p56-Lvalue subs returning %s not implemented yet
-
(F) Due to limitations in the current implementation, array and hash values cannot be returned in subroutines used in lvalue context. See "Lvalue subroutines" in perlsub.
- p56-Method %s not permitted
-
See Server error.
- p56-Missing %sbrace%s on \N{}
-
(F) Wrong syntax of character name literal \N{charname}
within double-quotish context.
- p56-Missing command in piped open
-
(W pipe) You used the open(FH, "| command")
or open(FH, "command |")
construction, but the command was missing or blank.
- p56-Missing name in "my sub"
-
(F) The reserved syntax for lexically scoped subroutines requires that they have a name with which they can be found.
- p56-No %s specified for -%c
-
(F) The indicated command line switch needs a mandatory argument, but you haven't specified one.
- p56-No package name allowed for variable %s in "our"
-
(F) Fully qualified variable names are not allowed in "our" declarations, because that doesn't make much sense under existing semantics. Such syntax is reserved for future extensions.
- p56-No space allowed after -%c
-
(F) The argument to the indicated command line switch must follow immediately after the switch, without intervening spaces.
- p56-no UTC offset information; assuming local time is UTC
-
(S) A warning peculiar to VMS. Perl was unable to find the local timezone offset, so it's assuming that local system time is equivalent to UTC. If it's not, define the logical name SYS$TIMEZONE_DIFFERENTIAL to translate to the number of seconds which need to be added to UTC to get local time.
- p56-Octal number > 037777777777 non-portable
-
(W portable) The octal number you specified is larger than 2**32-1 (4294967295) and therefore non-portable between systems. See perlport for more on portability concerns.
See also perlport for writing portable code.
- p56-panic: del_backref
-
(P) Failed an internal consistency check while trying to reset a weak reference.
- p56-panic: kid popen errno read
-
(F) forked child returned an incomprehensible message about its errno.
- p56-panic: magic_killbackrefs
-
(P) Failed an internal consistency check while trying to reset all weak references to an object.
- p56-Parentheses missing around "%s" list
-
(W parenthesis) You said something like
my $foo, $bar = @_;
when you meant
my ($foo, $bar) = @_;
Remember that "my", "our", and "local" bind tighter than comma.
- p56-Possible unintended interpolation of %s in string
-
(W ambiguous) It used to be that Perl would try to guess whether you wanted an array interpolated or a literal @. It no longer does this; arrays are now always interpolated into strings. This means that if you try something like:
print "fred@example.com";
and the array @example
doesn't exist, Perl is going to print fred.com
, which is probably not what you wanted. To get a literal @
sign in a string, put a backslash before it, just as you would to get a literal $
sign.
- p56-Possible Y2K bug: %s
-
(W y2k) You are concatenating the number 19 with another number, which could be a potential Year 2000 problem.
- p56-pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead
-
(W deprecated) You have written something like this:
sub doit
{
use attrs qw(locked);
}
You should use the new declaration syntax instead.
sub doit : locked
{
...
The use attrs
pragma is now obsolete, and is only provided for backward-compatibility. See "Subroutine Attributes" in perlsub.
- p56-Premature end of script headers
-
See Server error.
- p56-Repeat count in pack overflows
-
(F) You can't specify a repeat count so large that it overflows your signed integers. See "pack" in perlfunc.
- p56-Repeat count in unpack overflows
-
(F) You can't specify a repeat count so large that it overflows your signed integers. See "unpack" in perlfunc.
- p56-realloc() of freed memory ignored
-
(S) An internal routine called realloc() on something that had already been freed.
- p56-Reference is already weak
-
(W misc) You have attempted to weaken a reference that is already weak. Doing so has no effect.
- p56-setpgrp can't take arguments
-
(F) Your system has the setpgrp() from BSD 4.2, which takes no arguments, unlike POSIX setpgid(), which takes a process ID and process group ID.
- p56-Strange *+?{} on zero-length expression
-
(W regexp) You applied a regular expression quantifier in a place where it makes no sense, such as on a zero-width assertion. Try putting the quantifier inside the assertion instead. For example, the way to match "abc" provided that it is followed by three repetitions of "xyz" is /abc(?=(?:xyz){3})/
, not /abc(?=xyz){3}/
.
- p56-switching effective %s is not implemented
-
(F) While under the use filetest
pragma, we cannot switch the real and effective uids or gids.
- p56-This Perl can't reset CRTL environ elements (%s)
-
- p56-This Perl can't set CRTL environ elements (%s=%s)
-
(W internal) Warnings peculiar to VMS. You tried to change or delete an element of the CRTL's internal environ array, but your copy of Perl wasn't built with a CRTL that contained the setenv() function. You'll need to rebuild Perl with a CRTL that does, or redefine PERL_ENV_TABLES (see perlvms) so that the environ array isn't the target of the change to %ENV which produced the warning.
- p56-Too late to run %s block
-
(W void) A CHECK or INIT block is being defined during run time proper, when the opportunity to run them has already passed. Perhaps you are loading a file with require
or do
when you should be using use
instead. Or perhaps you should put the require
or do
inside a BEGIN block.
- p56-Unknown open() mode '%s'
-
(F) The second argument of 3-argument open() is not among the list of valid modes: <
, >
, >>
, +<
, +>
, +>>
, -|
, |-
.
- p56-Unknown process %x sent message to prime_env_iter: %s
-
(P) An error peculiar to VMS. Perl was reading values for %ENV before iterating over it, and someone else stuck a message in the stream of data Perl expected. Someone's very confused, or perhaps trying to subvert Perl's population of %ENV for nefarious purposes.
- p56-Unrecognized escape \\%c passed through
-
(W misc) You used a backslash-character combination which is not recognized by Perl. The character was understood literally.
- p56-Unterminated attribute parameter in attribute list
-
(F) The lexer saw an opening (left) parenthesis character while parsing an attribute list, but the matching closing (right) parenthesis character was not found. You may need to add (or remove) a backslash character to get your parentheses to balance. See attributes.
- p56-Unterminated attribute list
-
(F) The lexer found something other than a simple identifier at the start of an attribute, and it wasn't a semicolon or the start of a block. Perhaps you terminated the parameter list of the previous attribute too soon. See attributes.
- p56-Unterminated attribute parameter in subroutine attribute list
-
(F) The lexer saw an opening (left) parenthesis character while parsing a subroutine attribute list, but the matching closing (right) parenthesis character was not found. You may need to add (or remove) a backslash character to get your parentheses to balance.
- p56-Unterminated subroutine attribute list
-
(F) The lexer found something other than a simple identifier at the start of a subroutine attribute, and it wasn't a semicolon or the start of a block. Perhaps you terminated the parameter list of the previous attribute too soon.
- p56-Value of CLI symbol "%s" too long
-
(W misc) A warning peculiar to VMS. Perl tried to read the value of an %ENV element from a CLI symbol table, and found a resultant string longer than 1024 characters. The return value has been truncated to 1024 characters.
- p56-Version number must be a constant number
-
(P) The attempt to translate a use Module n.n LIST
statement into its equivalent BEGIN
block found an internal inconsistency with the version number.
p56-New tests
- p56-lib/attrs
-
Compatibility tests for sub : attrs
vs the older use attrs
.
- p56-lib/env
-
Tests for new environment scalar capability (e.g., use Env qw($BAR);
).
- p56-lib/env-array
-
Tests for new environment array capability (e.g., use Env qw(@PATH);
).
- p56-lib/io_const
-
IO constants (SEEK_*, _IO*).
- p56-lib/io_dir
-
Directory-related IO methods (new, read, close, rewind, tied delete).
- p56-lib/io_multihomed
-
INET sockets with multi-homed hosts.
- p56-lib/io_poll
-
IO poll().
- p56-lib/io_unix
-
UNIX sockets.
- p56-op/attrs
-
Regression tests for my ($x,@y,%z) : attrs
and .
- p56-op/filetest
-
File test operators.
- p56-op/lex_assign
-
Verify operations that access pad objects (lexicals and temporaries).
- p56-op/exists_sub
-
Verify exists &sub
operations.
p56-Incompatible Changes
p56-Perl Source Incompatibilities
Beware that any new warnings that have been added or old ones that have been enhanced are not considered incompatible changes.
Since all new warnings must be explicitly requested via the -w
switch or the warnings
pragma, it is ultimately the programmer's responsibility to ensure that warnings are enabled judiciously.
- p56-CHECK is a new keyword
-
All subroutine definitions named CHECK are now special. See /"Support for CHECK blocks"
for more information.
- p56-Treatment of list slices of undef has changed
-
There is a potential incompatibility in the behavior of list slices that are comprised entirely of undefined values. See "p56-Behavior of list slices is more consistent".
- p56-Format of $English::PERL_VERSION is different
-
The English module now sets $PERL_VERSION to $^V (a string value) rather than $]
(a numeric value). This is a potential incompatibility. Send us a report via perlbug if you are affected by this.
See "p56-Improved Perl version numbering system" for the reasons for this change.
- p56-Literals of the form
1.2.3
parse differently
-
Previously, numeric literals with more than one dot in them were interpreted as a floating point number concatenated with one or more numbers. Such "numbers" are now parsed as strings composed of the specified ordinals.
For example, print 97.98.99
used to output 97.9899
in earlier versions, but now prints abc
.
See "p56-Support for strings represented as a vector of ordinals".
- p56-Possibly changed pseudo-random number generator
-
Perl programs that depend on reproducing a specific set of pseudo-random numbers may now produce different output due to improvements made to the rand() builtin. You can use sh Configure -Drandfunc=rand
to obtain the old behavior.
- p56-Hashing function for hash keys has changed
-
Even though Perl hashes are not order preserving, the apparently random order encountered when iterating on the contents of a hash is actually determined by the hashing algorithm used. Improvements in the algorithm may yield a random order that is different from that of previous versions, especially when iterating on hashes.
See "p56-Better worst-case behavior of hashes" for additional information.
- p56-
undef
fails on read only values
-
Using the undef
operator on a readonly value (such as $1) has the same effect as assigning undef
to the readonly value--it throws an exception.
- p56-Close-on-exec bit may be set on pipe and socket handles
-
Pipe and socket handles are also now subject to the close-on-exec behavior determined by the special variable $^F.
- p56-Writing
"$$1"
to mean "${$}1"
is unsupported
-
Perl 5.004 deprecated the interpretation of $$1
and similar within interpolated strings to mean $$ . "1"
, but still allowed it.
In Perl 5.6.0 and later, "$$1"
always means "${$1}"
.
- p56-delete(), each(), values() and
\(%h)
-
operate on aliases to values, not copies
delete(), each(), values() and hashes (e.g. \(%h)
) in a list context return the actual values in the hash, instead of copies (as they used to in earlier versions). Typical idioms for using these constructs copy the returned values, but this can make a significant difference when creating references to the returned values. Keys in the hash are still returned as copies when iterating on a hash.
See also "p56-delete(), each(), values() and hash iteration are faster".
- p56-vec(EXPR,OFFSET,BITS) enforces powers-of-two BITS
-
vec() generates a run-time error if the BITS argument is not a valid power-of-two integer.
- p56-Text of some diagnostic output has changed
-
Most references to internal Perl operations in diagnostics have been changed to be more descriptive. This may be an issue for programs that may incorrectly rely on the exact text of diagnostics for proper functioning.
- p56-
%@
has been removed
-
The undocumented special variable %@
that used to accumulate "background" errors (such as those that happen in DESTROY()) has been removed, because it could potentially result in memory leaks.
- p56-Parenthesized not() behaves like a list operator
-
The not
operator now falls under the "if it looks like a function, it behaves like a function" rule.
As a result, the parenthesized form can be used with grep
and map
. The following construct used to be a syntax error before, but it works as expected now:
grep not($_), @things;
On the other hand, using not
with a literal list slice may not work. The following previously allowed construct:
print not (1,2,3)[0];
needs to be written with additional parentheses now:
print not((1,2,3)[0]);
The behavior remains unaffected when not
is not followed by parentheses.
- p56-Semantics of bareword prototype
(*)
have changed
-
The semantics of the bareword prototype *
have changed. Perl 5.005 always coerced simple scalar arguments to a typeglob, which wasn't useful in situations where the subroutine must distinguish between a simple scalar and a typeglob. The new behavior is to not coerce bareword arguments to a typeglob. The value will always be visible as either a simple scalar or as a reference to a typeglob.
- p56-Semantics of bit operators may have changed on 64-bit platforms
-
If your platform is either natively 64-bit or if Perl has been configured to used 64-bit integers, i.e., $Config{ivsize} is 8, there may be a potential incompatibility in the behavior of bitwise numeric operators (& | ^ ~ << >>). These operators used to strictly operate on the lower 32 bits of integers in previous versions, but now operate over the entire native integral width. In particular, note that unary ~
will produce different results on platforms that have different $Config{ivsize}. For portability, be sure to mask off the excess bits in the result of unary ~
, e.g., ~$x & 0xffffffff
.
- p56-More builtins taint their results
-
As described in "p56-Improved security features", there may be more sources of taint in a Perl program.
To avoid these new tainting behaviors, you can build Perl with the Configure option -Accflags=-DINCOMPLETE_TAINTS
. Beware that the ensuing perl binary may be insecure.
p56-C Source Incompatibilities
- p56-
PERL_POLLUTE
-
Release 5.005 grandfathered old global symbol names by providing preprocessor macros for extension source compatibility. As of release 5.6.0, these preprocessor definitions are not available by default. You need to explicitly compile perl with -DPERL_POLLUTE
to get these definitions. For extensions still using the old symbols, this option can be specified via MakeMaker:
perl Makefile.PL POLLUTE=1
- p56-
PERL_IMPLICIT_CONTEXT
-
This new build option provides a set of macros for all API functions such that an implicit interpreter/thread context argument is passed to every API function. As a result of this, something like sv_setsv(foo,bar)
amounts to a macro invocation that actually translates to something like Perl_sv_setsv(my_perl,foo,bar)
. While this is generally expected to not have any significant source compatibility issues, the difference between a macro and a real function call will need to be considered.
This means that there is a source compatibility issue as a result of this if your extensions attempt to use pointers to any of the Perl API functions.
Note that the above issue is not relevant to the default build of Perl, whose interfaces continue to match those of prior versions (but subject to the other options described here).
See "The Perl API" in perlguts for detailed information on the ramifications of building Perl with this option.
NOTE: PERL_IMPLICIT_CONTEXT is automatically enabled whenever Perl is built
with one of -Dusethreads, -Dusemultiplicity, or both. It is not
intended to be enabled by users at this time.
- p56-
PERL_POLLUTE_MALLOC
-
Enabling Perl's malloc in release 5.005 and earlier caused the namespace of the system's malloc family of functions to be usurped by the Perl versions, since by default they used the same names. Besides causing problems on platforms that do not allow these functions to be cleanly replaced, this also meant that the system versions could not be called in programs that used Perl's malloc. Previous versions of Perl have allowed this behaviour to be suppressed with the HIDEMYMALLOC and EMBEDMYMALLOC preprocessor definitions.
As of release 5.6.0, Perl's malloc family of functions have default names distinct from the system versions. You need to explicitly compile perl with -DPERL_POLLUTE_MALLOC
to get the older behaviour. HIDEMYMALLOC and EMBEDMYMALLOC have no effect, since the behaviour they enabled is now the default.
Note that these functions do not constitute Perl's memory allocation API. See "Memory Allocation" in perlguts for further information about that.
p56-Compatible C Source API Changes
- p56-
PATCHLEVEL
is now PERL_VERSION
-
The cpp macros PERL_REVISION
, PERL_VERSION
, and PERL_SUBVERSION
are now available by default from perl.h, and reflect the base revision, patchlevel, and subversion respectively. PERL_REVISION
had no prior equivalent, while PERL_VERSION
and PERL_SUBVERSION
were previously available as PATCHLEVEL
and SUBVERSION
.
The new names cause less pollution of the cpp namespace and reflect what the numbers have come to stand for in common practice. For compatibility, the old names are still supported when patchlevel.h is explicitly included (as required before), so there is no source incompatibility from the change.
p56-Binary Incompatibilities
In general, the default build of this release is expected to be binary compatible for extensions built with the 5.005 release or its maintenance versions. However, specific platforms may have broken binary compatibility due to changes in the defaults used in hints files. Therefore, please be sure to always check the platform-specific README files for any notes to the contrary.
The usethreads or usemultiplicity builds are not binary compatible with the corresponding builds in 5.005.
On platforms that require an explicit list of exports (AIX, OS/2 and Windows, among others), purely internal symbols such as parser functions and the run time opcodes are not exported by default. Perl 5.005 used to export all functions irrespective of whether they were considered part of the public API or not.
For the full list of public API functions, see perlapi.
p56-Known Problems
p56-Thread test failures
The subtests 19 and 20 of lib/thr5005.t test are known to fail due to fundamental problems in the 5.005 threading implementation. These are not new failures--Perl 5.005_0x has the same bugs, but didn't have these tests.
p56-EBCDIC platforms not supported
In earlier releases of Perl, EBCDIC environments like OS390 (also known as Open Edition MVS) and VM-ESA were supported. Due to changes required by the UTF-8 (Unicode) support, the EBCDIC platforms are not supported in Perl 5.6.0.
p56-In 64-bit HP-UX the lib/io_multihomed test may hang
The lib/io_multihomed test may hang in HP-UX if Perl has been configured to be 64-bit. Because other 64-bit platforms do not hang in this test, HP-UX is suspect. All other tests pass in 64-bit HP-UX. The test attempts to create and connect to "multihomed" sockets (sockets which have multiple IP addresses).
p56-NEXTSTEP 3.3 POSIX test failure
In NEXTSTEP 3.3p2 the implementation of the strftime(3) in the operating system libraries is buggy: the %j format numbers the days of a month starting from zero, which, while being logical to programmers, will cause the subtests 19 to 27 of the lib/posix test may fail.
p56-Tru64 (aka Digital UNIX, aka DEC OSF/1) lib/sdbm test failure with gcc
If compiled with gcc 2.95 the lib/sdbm test will fail (dump core). The cure is to use the vendor cc, it comes with the operating system and produces good code.
p56-UNICOS/mk CC failures during Configure run
In UNICOS/mk the following errors may appear during the Configure run:
Guessing which symbols your C compiler and preprocessor define...
CC-20 cc: ERROR File = try.c, Line = 3
...
bad switch yylook 79bad switch yylook 79bad switch yylook 79bad switch yylook 79#ifdef A29K
...
4 errors detected in the compilation of "try.c".
The culprit is the broken awk of UNICOS/mk. The effect is fortunately rather mild: Perl itself is not adversely affected by the error, only the h2ph utility coming with Perl, and that is rather rarely needed these days.
p56-Arrow operator and arrays
When the left argument to the arrow operator ->
is an array, or the scalar
operator operating on an array, the result of the operation must be considered erroneous. For example:
@x->[2]
scalar(@x)->[2]
These expressions will get run-time errors in some future release of Perl.
p56-Experimental features
As discussed above, many features are still experimental. Interfaces and implementation of these features are subject to change, and in extreme cases, even subject to removal in some future release of Perl. These features include the following:
- p56-Threads
-
- p56-Unicode
-
- p56-64-bit support
-
- p56-Lvalue subroutines
-
- p56-Weak references
-
- p56-The pseudo-hash data type
-
- p56-The Compiler suite
-
- p56-Internal implementation of file globbing
-
- p56-The DB module
-
- p56-The regular expression code constructs:
-
(?{ code })
and (??{ code })
p56-Obsolete Diagnostics
- p56-Character class syntax [: :] is reserved for future extensions
-
(W) Within regular expression character classes ([]) the syntax beginning with "[:" and ending with ":]" is reserved for future extensions. If you need to represent those character sequences inside a regular expression character class, just quote the square brackets with the backslash: "\[:" and ":\]".
- p56-Ill-formed logical name |%s| in prime_env_iter
-
(W) A warning peculiar to VMS. A logical name was encountered when preparing to iterate over %ENV which violates the syntactic rules governing logical names. Because it cannot be translated normally, it is skipped, and will not appear in %ENV. This may be a benign occurrence, as some software packages might directly modify logical name tables and introduce nonstandard names, or it may indicate that a logical name table has been corrupted.
- p56-In string, @%s now must be written as \@%s
-
The description of this error used to say:
(Someday it will simply assume that an unbackslashed @
interpolates an array.)
That day has come, and this fatal error has been removed. It has been replaced by a non-fatal warning instead. See "p56-Arrays now always interpolate into double-quoted strings" for details.
- p56-Probable precedence problem on %s
-
(W) The compiler found a bareword where it expected a conditional, which often indicates that an || or && was parsed as part of the last argument of the previous construct, for example:
open FOO || die;
- p56-regexp too big
-
(F) The current implementation of regular expressions uses shorts as address offsets within a string. Unfortunately this means that if the regular expression compiles to longer than 32767, it'll blow up. Usually when you want a regular expression this big, there is a better way to do it with multiple statements. See perlre.
- "_to_mean_"${$}
"_is_deprecated"
>p56-Use of "$$" to mean "${$}" is deprecated
-
(D) Perl versions before 5.004 misinterpreted any type marker followed by "$" and a digit. For example, "$$0" was incorrectly taken to mean "${$}0" instead of "${$0}". This bug is (mostly) fixed in Perl 5.004.
However, the developers of Perl 5.004 could not fix this bug completely, because at least two widely-used modules depend on the old meaning of "$$0" in a string. So Perl 5.004 still interprets "$$" in the old (broken) way inside strings; but it generates this message as a warning. And in Perl 5.005, this special treatment will cease.
p56-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. There may also be information at http://www.perl.com/perl/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
p56-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p56-HISTORY
Written by Gurusamy Sarathy <gsar@activestate.com>, with many contributions from The Perl Porters.
Send omissions or corrections to <perlbug@perl.org>.
p5005-NAME
perl5005delta - what's new for perl5.005
p5005-DESCRIPTION
This document describes differences between the 5.004 release and this one.
p5005-About the new versioning system
Perl is now developed on two tracks: a maintenance track that makes small, safe updates to released production versions with emphasis on compatibility; and a development track that pursues more aggressive evolution. Maintenance releases (which should be considered production quality) have subversion numbers that run from 1
to 49
, and development releases (which should be considered "alpha" quality) run from 50
to 99
.
Perl 5.005 is the combined product of the new dual-track development scheme.
p5005-Incompatible Changes
p5005-WARNING: This version is not binary compatible with Perl 5.004.
Starting with Perl 5.004_50 there were many deep and far-reaching changes to the language internals. If you have dynamically loaded extensions that you built under perl 5.003 or 5.004, you can continue to use them with 5.004, but you will need to rebuild and reinstall those extensions to use them 5.005. See INSTALL for detailed instructions on how to upgrade.
p5005-Default installation structure has changed
The new Configure defaults are designed to allow a smooth upgrade from 5.004 to 5.005, but you should read INSTALL for a detailed discussion of the changes in order to adapt them to your system.
p5005-Perl Source Compatibility
When none of the experimental features are enabled, there should be very few user-visible Perl source compatibility issues.
If threads are enabled, then some caveats apply. @_
and $_
become lexical variables. The effect of this should be largely transparent to the user, but there are some boundary conditions under which user will need to be aware of the issues. For example, local(@_)
results in a "Can't localize lexical variable @_ ..." message. This may be enabled in a future version.
Some new keywords have been introduced. These are generally expected to have very little impact on compatibility. See "p5005-New INIT
keyword", "p5005-New lock
keyword", and "p5005-New qr//
operator".
Certain barewords are now reserved. Use of these will provoke a warning if you have asked for them with the -w
switch. See "p5005-our
is now a reserved word".
p5005-C Source Compatibility
There have been a large number of changes in the internals to support the new features in this release.
- Core sources now require ANSI C compiler
An ANSI C compiler is now required to build perl. See INSTALL.
- All Perl global variables must now be referenced with an explicit prefix
All Perl global variables that are visible for use by extensions now have a PL_
prefix. New extensions should not
refer to perl globals by their unqualified names. To preserve sanity, we provide limited backward compatibility for globals that are being widely used like sv_undef
and na
(which should now be written as PL_sv_undef
, PL_na
etc.)
If you find that your XS extension does not compile anymore because a perl global is not visible, try adding a PL_
prefix to the global and rebuild.
It is strongly recommended that all functions in the Perl API that don't begin with perl
be referenced with a Perl_
prefix. The bare function names without the Perl_
prefix are supported with macros, but this support may cease in a future release.
See perlapi.
- Enabling threads has source compatibility issues
Perl built with threading enabled requires extensions to use the new dTHR
macro to initialize the handle to access per-thread data. If you see a compiler error that talks about the variable thr
not being declared (when building a module that has XS code), you need to add dTHR;
at the beginning of the block that elicited the error.
The API function perl_get_sv("@",GV_ADD)
should be used instead of directly accessing perl globals as GvSV(errgv)
. The API call is backward compatible with existing perls and provides source compatibility with threading is enabled.
See "p5005-C Source Compatibility" for more information.
p5005-Binary Compatibility
This version is NOT binary compatible with older versions. All extensions will need to be recompiled. Further binaries built with threads enabled are incompatible with binaries built without. This should largely be transparent to the user, as all binary incompatible configurations have their own unique architecture name, and extension binaries get installed at unique locations. This allows coexistence of several configurations in the same directory hierarchy. See INSTALL.
p5005-Security fixes may affect compatibility
A few taint leaks and taint omissions have been corrected. This may lead to "failure" of scripts that used to work with older versions. Compiling with -DINCOMPLETE_TAINTS provides a perl with minimal amounts of changes to the tainting behavior. But note that the resulting perl will have known insecurities.
Oneliners with the -e
switch do not create temporary files anymore.
p5005-Relaxed new mandatory warnings introduced in 5.004
Many new warnings that were introduced in 5.004 have been made optional. Some of these warnings are still present, but perl's new features make them less often a problem. See "p5005-New Diagnostics".
p5005-Licensing
Perl has a new Social Contract for contributors. See Porting/Contract.
The license included in much of the Perl documentation has changed. Most of the Perl documentation was previously under the implicit GNU General Public License or the Artistic License (at the user's choice). Now much of the documentation unambiguously states the terms under which it may be distributed. Those terms are in general much less restrictive than the GNU GPL. See perl and the individual perl manpages listed therein.
p5005-Core Changes
p5005-Threads
WARNING: Threading is considered an experimental feature. Details of the implementation may change without notice. There are known limitations and some bugs. These are expected to be fixed in future versions.
See README.threads.
p5005-Compiler
WARNING: The Compiler and related tools are considered experimental. Features may change without notice, and there are known limitations and bugs. Since the compiler is fully external to perl, the default configuration will build and install it.
The Compiler produces three different types of transformations of a perl program. The C backend generates C code that captures perl's state just before execution begins. It eliminates the compile-time overheads of the regular perl interpreter, but the run-time performance remains comparatively the same. The CC backend generates optimized C code equivalent to the code path at run-time. The CC backend has greater potential for big optimizations, but only a few optimizations are implemented currently. The Bytecode backend generates a platform independent bytecode representation of the interpreter's state just before execution. Thus, the Bytecode back end also eliminates much of the compilation overhead of the interpreter.
The compiler comes with several valuable utilities.
B::Lint
is an experimental module to detect and warn about suspicious code, especially the cases that the -w
switch does not detect.
B::Deparse
can be used to demystify perl code, and understand how perl optimizes certain constructs.
B::Xref
generates cross reference reports of all definition and use of variables, subroutines and formats in a program.
B::Showlex
show the lexical variables used by a subroutine or file at a glance.
perlcc
is a simple frontend for compiling perl.
See ext/B/README
, B, and the respective compiler modules.
p5005-Regular Expressions
Perl's regular expression engine has been seriously overhauled, and many new constructs are supported. Several bugs have been fixed.
Here is an itemized summary:
- p5005-Many new and improved optimizations
-
Changes in the RE engine:
Unneeded nodes removed;
Substrings merged together;
New types of nodes to process (SUBEXPR)* and similar expressions
quickly, used if the SUBEXPR has no side effects and matches
strings of the same length;
Better optimizations by lookup for constant substrings;
Better search for constants substrings anchored by $ ;
Changes in Perl code using RE engine:
More optimizations to s/longer/short/;
study() was not working;
/blah/ may be optimized to an analogue of index() if $& $` $' not seen;
Unneeded copying of matched-against string removed;
Only matched part of the string is copying if $` $' were not seen;
- p5005-Many bug fixes
-
Note that only the major bug fixes are listed here. See Changes for others.
Backtracking might not restore start of $3.
No feedback if max count for * or + on "complex" subexpression
was reached, similarly (but at compile time) for {3,34567}
Primitive restrictions on max count introduced to decrease a
possibility of a segfault;
(ZERO-LENGTH)* could segfault;
(ZERO-LENGTH)* was prohibited;
Long REs were not allowed;
/RE/g could skip matches at the same position after a
zero-length match;
- p5005-New regular expression constructs
-
The following new syntax elements are supported:
(?<=RE)
(?RE)
\z
- p5005-New operator for precompiled regular expressions
-
- p5005-Other improvements
-
Better debugging output (possibly with colors),
even from non-debugging Perl;
RE engine code now looks like C, not like assembler;
Behaviour of RE modifiable by `use re' directive;
Improved documentation;
Test suite significantly extended;
Syntax [:^upper:] etc., reserved inside character classes;
- p5005-Incompatible changes
-
(?i) localized inside enclosing group;
$( is not interpolated into RE any more;
/RE/g may match at the same position (with non-zero length)
after a zero-length match (bug fix).
p5005-Improved malloc()
See banner at the beginning of malloc.c
for details.
p5005-Quicksort is internally implemented
Perl now contains its own highly optimized qsort() routine. The new qsort() is resistant to inconsistent comparison functions, so Perl's sort()
will not provoke coredumps any more when given poorly written sort subroutines. (Some C library qsort()
s that were being used before used to have this problem.) In our testing, the new qsort()
required the minimal number of pair-wise compares on average, among all known qsort()
implementations.
See perlfunc/sort
.
p5005-Reliable signals
Perl's signal handling is susceptible to random crashes, because signals arrive asynchronously, and the Perl runtime is not reentrant at arbitrary times.
However, one experimental implementation of reliable signals is available when threads are enabled. See Thread::Signal
. Also see INSTALL for how to build a Perl capable of threads.
p5005-Reliable stack pointers
The internals now reallocate the perl stack only at predictable times. In particular, magic calls never trigger reallocations of the stack, because all reentrancy of the runtime is handled using a "stack of stacks". This should improve reliability of cached stack pointers in the internals and in XSUBs.
p5005-More generous treatment of carriage returns
Perl used to complain if it encountered literal carriage returns in scripts. Now they are mostly treated like whitespace within program text. Inside string literals and here documents, literal carriage returns are ignored if they occur paired with linefeeds, or get interpreted as whitespace if they stand alone. This behavior means that literal carriage returns in files should be avoided. You can get the older, more compatible (but less generous) behavior by defining the preprocessor symbol PERL_STRICT_CR
when building perl. Of course, all this has nothing whatever to do with how escapes like \r
are handled within strings.
Note that this doesn't somehow magically allow you to keep all text files in DOS format. The generous treatment only applies to files that perl itself parses. If your C compiler doesn't allow carriage returns in files, you may still be unable to build modules that need a C compiler.
p5005-Memory leaks
substr
, pos
and vec
don't leak memory anymore when used in lvalue context. Many small leaks that impacted applications that embed multiple interpreters have been fixed.
p5005-Better support for multiple interpreters
The build-time option -DMULTIPLICITY
has had many of the details reworked. Some previously global variables that should have been per-interpreter now are. With care, this allows interpreters to call each other. See the PerlInterp
extension on CPAN.
p5005-Behavior of local() on array and hash elements is now well-defined
See "Temporary Values via local()" in perlsub.
p5005-%!
is transparently tied to the Errno module
p5005-Pseudo-hashes are supported
See perlref.
p5005-EXPR foreach EXPR
is supported
See perlsyn.
p5005-Keywords can be globally overridden
See perlsub.
p5005-$^E
is meaningful on Win32
See perlvar.
p5005-foreach (1..1000000)
optimized
foreach (1..1000000)
is now optimized into a counting loop. It does not try to allocate a 1000000-size list anymore.
p5005-Foo::
can be used as implicitly quoted package name
Barewords caused unintuitive behavior when a subroutine with the same name as a package happened to be defined. Thus, new Foo @args
, use the result of the call to Foo()
instead of Foo
being treated as a literal. The recommended way to write barewords in the indirect object slot is new Foo:: @args
. Note that the method new()
is called with a first argument of Foo
, not Foo::
when you do that.
p5005-exists $Foo::{Bar::}
tests existence of a package
It was impossible to test for the existence of a package without actually creating it before. Now exists $Foo::{Bar::}
can be used to test if the Foo::Bar
namespace has been created.
p5005-Better locale support
See perllocale.
p5005-Experimental support for 64-bit platforms
Perl5 has always had 64-bit support on systems with 64-bit longs. Starting with 5.005, the beginnings of experimental support for systems with 32-bit long and 64-bit 'long long' integers has been added. If you add -DUSE_LONG_LONG to your ccflags in config.sh (or manually define it in perl.h) then perl will be built with 'long long' support. There will be many compiler warnings, and the resultant perl may not work on all systems. There are many other issues related to third-party extensions and libraries. This option exists to allow people to work on those issues.
p5005-prototype() returns useful results on builtins
p5005-Extended support for exception handling
die()
now accepts a reference value, and $@
gets set to that value in exception traps. This makes it possible to propagate exception objects. This is an undocumented experimental feature.
p5005-Re-blessing in DESTROY() supported for chaining DESTROY() methods
p5005-All printf
format conversions are handled internally
See "printf" in perlfunc.
p5005-New INIT
keyword
INIT
subs are like BEGIN
and END
, but they get run just before the perl runtime begins execution. e.g., the Perl Compiler makes use of INIT
blocks to initialize and resolve pointers to XSUBs.
p5005-New lock
keyword
The lock
keyword is the fundamental synchronization primitive in threaded perl. When threads are not enabled, it is currently a noop.
To minimize impact on source compatibility this keyword is "weak", i.e., any user-defined subroutine of the same name overrides it, unless a use Thread
has been seen.
p5005-New qr//
operator
The qr//
operator, which is syntactically similar to the other quote-like operators, is used to create precompiled regular expressions. This compiled form can now be explicitly passed around in variables, and interpolated in other regular expressions. See perlop.
p5005-our
is now a reserved word
Calling a subroutine with the name our
will now provoke a warning when using the -w
switch.
p5005-Tied arrays are now fully supported
See Tie::Array.
p5005-Tied handles support is better
Several missing hooks have been added. There is also a new base class for TIEARRAY implementations. See Tie::Array.
p5005-4th argument to substr
substr() can now both return and replace in one operation. The optional 4th argument is the replacement string. See "substr" in perlfunc.
p5005-Negative LENGTH argument to splice
splice() with a negative LENGTH argument now work similar to what the LENGTH did for substr(). Previously a negative LENGTH was treated as 0. See "splice" in perlfunc.
p5005-Magic lvalues are now more magical
When you say something like substr($x, 5) = "hi"
, the scalar returned by substr() is special, in that any modifications to it affect $x. (This is called a 'magic lvalue' because an 'lvalue' is something on the left side of an assignment.) Normally, this is exactly what you would expect to happen, but Perl uses the same magic if you use substr(), pos(), or vec() in a context where they might be modified, like taking a reference with \
or as an argument to a sub that modifies @_
. In previous versions, this 'magic' only went one way, but now changes to the scalar the magic refers to ($x in the above example) affect the magic lvalue too. For instance, this code now acts differently:
$x = "hello";
sub printit {
$x = "g'bye";
print $_[0], "\n";
}
printit(substr($x, 0, 5));
In previous versions, this would print "hello", but it now prints "g'bye".
p5005-<> now reads in records
If $/
is a reference to an integer, or a scalar that holds an integer, <> will read in records instead of lines. For more info, see "$/" in perlvar.
p5005-Supported Platforms
Configure has many incremental improvements. Site-wide policy for building perl can now be made persistent, via Policy.sh. Configure also records the command-line arguments used in config.sh.
p5005-New Platforms
BeOS is now supported. See README.beos.
DOS is now supported under the DJGPP tools. See README.dos (installed as perldos on some systems).
MiNT is now supported. See README.mint.
MPE/iX is now supported. See README.mpeix.
MVS (aka OS390, aka Open Edition) is now supported. See README.os390 (installed as perlos390 on some systems).
Stratus VOS is now supported. See README.vos.
p5005-Changes in existing support
Win32 support has been vastly enhanced. Support for Perl Object, a C++ encapsulation of Perl. GCC and EGCS are now supported on Win32. See README.win32, aka perlwin32.
VMS configuration system has been rewritten. See README.vms (installed as README_vms on some systems).
The hints files for most Unix platforms have seen incremental improvements.
p5005-Modules and Pragmata
p5005-New Modules
- p5005-B
-
Perl compiler and tools. See B.
- p5005-Data::Dumper
-
A module to pretty print Perl data. See Data::Dumper.
- p5005-Dumpvalue
-
A module to dump perl values to the screen. See Dumpvalue.
- p5005-Errno
-
A module to look up errors more conveniently. See Errno.
- p5005-File::Spec
-
A portable API for file operations.
- p5005-ExtUtils::Installed
-
Query and manage installed modules.
- p5005-ExtUtils::Packlist
-
Manipulate .packlist files.
- p5005-Fatal
-
Make functions/builtins succeed or die.
- p5005-IPC::SysV
-
Constants and other support infrastructure for System V IPC operations in perl.
- p5005-Test
-
A framework for writing test suites.
- p5005-Tie::Array
-
Base class for tied arrays.
- p5005-Tie::Handle
-
Base class for tied handles.
- p5005-Thread
-
Perl thread creation, manipulation, and support.
- p5005-attrs
-
Set subroutine attributes.
- p5005-fields
-
Compile-time class fields.
- p5005-re
-
Various pragmata to control behavior of regular expressions.
p5005-Changes in existing modules
- p5005-Benchmark
-
You can now run tests for x seconds instead of guessing the right number of tests to run.
Keeps better time.
- p5005-Carp
-
Carp has a new function cluck(). cluck() warns, like carp(), but also adds a stack backtrace to the error message, like confess().
- p5005-CGI
-
CGI has been updated to version 2.42.
- p5005-Fcntl
-
More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for large (more than 4G) file access (the 64-bit support is not yet working, though, so no need to get overly excited), Free/Net/OpenBSD locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR.
- p5005-Math::Complex
-
The accessors methods Re, Im, arg, abs, rho, theta, methods can ($z->Re()) now also act as mutators ($z->Re(3)).
- p5005-Math::Trig
-
A little bit of radial trigonometry (cylindrical and spherical) added, for example the great circle distance.
- p5005-POSIX
-
POSIX now has its own platform-specific hints files.
- p5005-DB_File
-
DB_File supports version 2.x of Berkeley DB. See ext/DB_File/Changes
.
- p5005-MakeMaker
-
MakeMaker now supports writing empty makefiles, provides a way to specify that site umask() policy should be honored. There is also better support for manipulation of .packlist files, and getting information about installed modules.
Extensions that have both architecture-dependent and architecture-independent files are now always installed completely in the architecture-dependent locations. Previously, the shareable parts were shared both across architectures and across perl versions and were therefore liable to be overwritten with newer versions that might have subtle incompatibilities.
- p5005-CPAN
-
See perlmodinstall and CPAN.
- p5005-Cwd
-
Cwd::cwd is faster on most platforms.
p5005-Utility Changes
h2ph
and related utilities have been vastly overhauled.
perlcc
, a new experimental front end for the compiler is available.
The crude GNU configure
emulator is now called configure.gnu
to avoid trampling on Configure
under case-insensitive filesystems.
perldoc
used to be rather slow. The slower features are now optional. In particular, case-insensitive searches need the -i
switch, and recursive searches need -r
. You can set these switches in the PERLDOC
environment variable to get the old behavior.
p5005-Documentation Changes
Config.pm now has a glossary of variables.
Porting/patching.pod has detailed instructions on how to create and submit patches for perl.
perlport specifies guidelines on how to write portably.
perlmodinstall describes how to fetch and install modules from CPAN
sites.
Some more Perl traps are documented now. See perltrap.
perlopentut gives a tutorial on using open().
perlreftut gives a tutorial on references.
perlthrtut gives a tutorial on threads.
p5005-New Diagnostics
- p5005-Ambiguous call resolved as CORE::%s(), qualify as such or use &
-
(W) A subroutine you have declared has the same name as a Perl keyword, and you have used the name without qualification for calling one or the other. Perl decided to call the builtin because the subroutine is not imported.
To force interpretation as a subroutine call, either put an ampersand before the subroutine name, or qualify the name with its package. Alternatively, you can import the subroutine (or pretend that it's imported with the use subs
pragma).
To silently interpret it as the Perl operator, use the CORE::
prefix on the operator (e.g. CORE::log($x)
) or by declaring the subroutine to be an object method (see attrs).
- p5005-Bad index while coercing array into hash
-
(F) The index looked up in the hash found as the 0'th element of a pseudo-hash is not legal. Index values must be at 1 or greater. See perlref.
- p5005-Bareword "%s" refers to nonexistent package
-
(W) You used a qualified bareword of the form Foo::
, but the compiler saw no other uses of that namespace before that point. Perhaps you need to predeclare a package?
- p5005-Can't call method "%s" on an undefined value
-
(F) You used the syntax of a method call, but the slot filled by the object reference or package name contains an undefined value. Something like this will reproduce the error:
$BADREF = 42;
process $BADREF 1,2,3;
$BADREF->process(1,2,3);
- p5005-Can't check filesystem of script "%s" for nosuid
-
(P) For some reason you can't check the filesystem of the script for nosuid.
- p5005-Can't coerce array into hash
-
(F) You used an array where a hash was expected, but the array has no information on how to map from keys to array indices. You can do that only with arrays that have a hash reference at index 0.
- p5005-Can't goto subroutine from an eval-string
-
(F) The "goto subroutine" call can't be used to jump out of an eval "string". (You can use it to jump out of an eval {BLOCK}, but you probably don't want to.)
- p5005-Can't localize pseudo-hash element
-
(F) You said something like local $ar->{'key'}
, where $ar is a reference to a pseudo-hash. That hasn't been implemented yet, but you can get a similar effect by localizing the corresponding array element directly: local $ar->[$ar->[0]{'key'}]
.
- p5005-Can't use %%! because Errno.pm is not available
-
(F) The first time the %! hash is used, perl automatically loads the Errno.pm module. The Errno module is expected to tie the %! hash to provide symbolic names for $!
errno values.
- p5005-Cannot find an opnumber for "%s"
-
(F) A string of a form CORE::word
was given to prototype(), but there is no builtin with the name word
.
- p5005-Character class syntax [. .] is reserved for future extensions
-
(W) Within regular expression character classes ([]) the syntax beginning with "[." and ending with ".]" is reserved for future extensions. If you need to represent those character sequences inside a regular expression character class, just quote the square brackets with the backslash: "\[." and ".\]".
- p5005-Character class syntax [: :] is reserved for future extensions
-
(W) Within regular expression character classes ([]) the syntax beginning with "[:" and ending with ":]" is reserved for future extensions. If you need to represent those character sequences inside a regular expression character class, just quote the square brackets with the backslash: "\[:" and ":\]".
- p5005-Character class syntax [= =] is reserved for future extensions
-
(W) Within regular expression character classes ([]) the syntax beginning with "[=" and ending with "=]" is reserved for future extensions. If you need to represent those character sequences inside a regular expression character class, just quote the square brackets with the backslash: "\[=" and "=\]".
- p5005-%s: Eval-group in insecure regular expression
-
(F) Perl detected tainted data when trying to compile a regular expression that contains the (?{ ... })
zero-width assertion, which is unsafe. See "(?{ code })" in perlre, and perlsec.
- p5005-%s: Eval-group not allowed, use re 'eval'
-
(F) A regular expression contained the (?{ ... })
zero-width assertion, but that construct is only allowed when the use re 'eval'
pragma is in effect. See "(?{ code })" in perlre.
- p5005-%s: Eval-group not allowed at run time
-
(F) Perl tried to compile a regular expression containing the (?{ ... })
zero-width assertion at run time, as it would when the pattern contains interpolated values. Since that is a security risk, it is not allowed. If you insist, you may still do this by explicitly building the pattern from an interpolated string at run time and using that in an eval(). See "(?{ code })" in perlre.
- p5005-Explicit blessing to '' (assuming package main)
-
(W) You are blessing a reference to a zero length string. This has the effect of blessing the reference into the package main. This is usually not what you want. Consider providing a default target package, e.g. bless($ref, $p || 'MyPackage');
- p5005-Illegal hex digit ignored
-
(W) You may have tried to use a character other than 0 - 9 or A - F in a hexadecimal number. Interpretation of the hexadecimal number stopped before the illegal character.
- p5005-No such array field
-
(F) You tried to access an array as a hash, but the field name used is not defined. The hash at index 0 should map all valid field names to array indices for that to work.
- p5005-No such field "%s" in variable %s of type %s
-
(F) You tried to access a field of a typed variable where the type does not know about the field name. The field names are looked up in the %FIELDS hash in the type package at compile time. The %FIELDS hash is usually set up with the 'fields' pragma.
- p5005-Out of memory during ridiculously large request
-
(F) You can't allocate more than 2^31+"small amount" bytes. This error is most likely to be caused by a typo in the Perl program. e.g., $arr[time]
instead of $arr[$time]
.
- p5005-Range iterator outside integer range
-
(F) One (or both) of the numeric arguments to the range operator ".." are outside the range which can be represented by integers internally. One possible workaround is to force Perl to use magical string increment by prepending "0" to your numbers.
- p5005-Recursive inheritance detected while looking for method '%s' %s
-
(F) More than 100 levels of inheritance were encountered while invoking a method. Probably indicates an unintended loop in your inheritance hierarchy.
- p5005-Reference found where even-sized list expected
-
(W) You gave a single reference where Perl was expecting a list with an even number of elements (for assignment to a hash). This usually means that you used the anon hash constructor when you meant to use parens. In any case, a hash requires key/value pairs.
%hash = { one => 1, two => 2, }; # WRONG
%hash = [ qw/ an anon array / ]; # WRONG
%hash = ( one => 1, two => 2, ); # right
%hash = qw( one 1 two 2 ); # also fine
- p5005-Undefined value assigned to typeglob
-
(W) An undefined value was assigned to a typeglob, a la *foo = undef
. This does nothing. It's possible that you really mean undef *foo
.
- p5005-Use of reserved word "%s" is deprecated
-
(D) The indicated bareword is a reserved word. Future versions of perl may use it as a keyword, so you're better off either explicitly quoting the word in a manner appropriate for its context of use, or using a different name altogether. The warning can be suppressed for subroutine names by either adding a &
prefix, or using a package qualifier, e.g. &our()
, or Foo::our()
.
- p5005-perl: warning: Setting locale failed.
-
(S) The whole warning message will look something like:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = "En_US",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Exactly what were the failed locale settings varies. In the above the settings were that the LC_ALL was "En_US" and the LANG had no value. This error means that Perl detected that you and/or your system administrator have set up the so-called variable system but Perl could not use those settings. This was not dead serious, fortunately: there is a "default locale" called "C" that Perl can and will use, the script will be run. Before you really fix the problem, however, you will get the same error message each time you run Perl. How to really fix the problem can be found in "LOCALE PROBLEMS" in perllocale.
p5005-Obsolete Diagnostics
- p5005-Can't mktemp()
-
(F) The mktemp() routine failed for some reason while trying to process a -e switch. Maybe your /tmp partition is full, or clobbered.
Removed because -e doesn't use temporary files any more.
- p5005-Can't write to temp file for -e: %s
-
(F) The write routine failed for some reason while trying to process a -e switch. Maybe your /tmp partition is full, or clobbered.
Removed because -e doesn't use temporary files any more.
- p5005-Cannot open temporary file
-
(F) The create routine failed for some reason while trying to process a -e switch. Maybe your /tmp partition is full, or clobbered.
Removed because -e doesn't use temporary files any more.
- p5005-regexp too big
-
(F) The current implementation of regular expressions uses shorts as address offsets within a string. Unfortunately this means that if the regular expression compiles to longer than 32767, it'll blow up. Usually when you want a regular expression this big, there is a better way to do it with multiple statements. See perlre.
p5005-Configuration Changes
You can use "Configure -Uinstallusrbinperl" which causes installperl to skip installing perl also as /usr/bin/perl. This is useful if you prefer not to modify /usr/bin for some reason or another but harmful because many scripts assume to find Perl in /usr/bin/perl.
p5005-BUGS
If you find what you think is a bug, you might check the headers of recently posted articles in the comp.lang.perl.misc newsgroup. There may also be information at http://www.perl.com/perl/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Make sure you trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to <perlbug@perl.com> to be analysed by the Perl porting team.
p5005-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
p5005-HISTORY
Written by Gurusamy Sarathy <gsar@activestate.com>, with many contributions from The Perl Porters.
Send omissions or corrections to <perlbug@perl.com>.
p5004-NAME
perl5004delta - what's new for perl5.004
p5004-DESCRIPTION
This document describes differences between the 5.003 release (as documented in Programming Perl, second edition--the Camel Book) and this one.
p5004-Supported Environments
Perl5.004 builds out of the box on Unix, Plan 9, LynxOS, VMS, OS/2, QNX, AmigaOS, and Windows NT. Perl runs on Windows 95 as well, but it cannot be built there, for lack of a reasonable command interpreter.
p5004-Core Changes
Most importantly, many bugs were fixed, including several security problems. See the Changes file in the distribution for details.
p5004-List assignment to %ENV works
%ENV = ()
and %ENV = @list
now work as expected (except on VMS where it generates a fatal error).
p5004-Change to "Can't locate Foo.pm in @INC" error
The error "Can't locate Foo.pm in @INC" now lists the contents of @INC for easier debugging.
p5004-Compilation option: Binary compatibility with 5.003
There is a new Configure question that asks if you want to maintain binary compatibility with Perl 5.003. If you choose binary compatibility, you do not have to recompile your extensions, but you might have symbol conflicts if you embed Perl in another application, just as in the 5.003 release. By default, binary compatibility is preserved at the expense of symbol table pollution.
p5004-$PERL5OPT environment variable
You may now put Perl options in the $PERL5OPT environment variable. Unless Perl is running with taint checks, it will interpret this variable as if its contents had appeared on a "#!perl" line at the beginning of your script, except that hyphens are optional. PERL5OPT may only be used to set the following switches: -[DIMUdmw].
p5004-Limitations on -M, -m, and -T options
The -M
and -m
options are no longer allowed on the #!
line of a script. If a script needs a module, it should invoke it with the use
pragma.
The -T option is also forbidden on the #!
line of a script, unless it was present on the Perl command line. Due to the way #!
works, this usually means that -T must be in the first argument. Thus:
#!/usr/bin/perl -T -w
will probably work for an executable script invoked as scriptname
, while:
#!/usr/bin/perl -w -T
will probably fail under the same conditions. (Non-Unix systems will probably not follow this rule.) But perl scriptname
is guaranteed to fail, since then there is no chance of -T being found on the command line before it is found on the #!
line.
p5004-More precise warnings
If you removed the -w option from your Perl 5.003 scripts because it made Perl too verbose, we recommend that you try putting it back when you upgrade to Perl 5.004. Each new perl version tends to remove some undesirable warnings, while adding new warnings that may catch bugs in your scripts.
p5004-Deprecated: Inherited AUTOLOAD
for non-methods
Before Perl 5.004, AUTOLOAD
functions were looked up as methods (using the @ISA
hierarchy), even when the function to be autoloaded was called as a plain function (e.g. Foo::bar()
), not a method (e.g. Foo->bar()
or $obj->bar()
).
Perl 5.005 will use method lookup only for methods' AUTOLOAD
s. However, there is a significant base of existing code that may be using the old behavior. So, as an interim step, Perl 5.004 issues an optional warning when a non-method uses an inherited AUTOLOAD
.
The simple rule is: Inheritance will not work when autoloading non-methods. The simple fix for old code is: In any module that used to depend on inheriting AUTOLOAD
for non-methods from a base class named BaseClass
, execute *AUTOLOAD = \&BaseClass::AUTOLOAD
during startup.
p5004-Previously deprecated %OVERLOAD is no longer usable
Using %OVERLOAD to define overloading was deprecated in 5.003. Overloading is now defined using the overload pragma. %OVERLOAD is still used internally but should not be used by Perl scripts. See overload for more details.
p5004-Subroutine arguments created only when they're modified
In Perl 5.004, nonexistent array and hash elements used as subroutine parameters are brought into existence only if they are actually assigned to (via @_
).
Earlier versions of Perl vary in their handling of such arguments. Perl versions 5.002 and 5.003 always brought them into existence. Perl versions 5.000 and 5.001 brought them into existence only if they were not the first argument (which was almost certainly a bug). Earlier versions of Perl never brought them into existence.
For example, given this code:
undef @a; undef %a;
sub show { print $_[0] };
sub change { $_[0]++ };
show($a[2]);
change($a{b});
After this code executes in Perl 5.004, $a{b} exists but $a[2] does not. In Perl 5.002 and 5.003, both $a{b} and $a[2] would have existed (but $a[2]'s value would have been undefined).
p5004-Group vector changeable with $)
The $)
special variable has always (well, in Perl 5, at least) reflected not only the current effective group, but also the group list as returned by the getgroups()
C function (if there is one). However, until this release, there has not been a way to call the setgroups()
C function from Perl.
In Perl 5.004, assigning to $)
is exactly symmetrical with examining it: The first number in its string value is used as the effective gid; if there are any numbers after the first one, they are passed to the setgroups()
C function (if there is one).
p5004-Fixed parsing of $$, &$, etc.
Perl versions before 5.004 misinterpreted any type marker followed by "$" and a digit. For example, "$$0" was incorrectly taken to mean "${$}0" instead of "${$0}". This bug is (mostly) fixed in Perl 5.004.
However, the developers of Perl 5.004 could not fix this bug completely, because at least two widely-used modules depend on the old meaning of "$$0" in a string. So Perl 5.004 still interprets "$$" in the old (broken) way inside strings; but it generates this message as a warning. And in Perl 5.005, this special treatment will cease.
p5004-Fixed localization of $, $&, etc.
Perl versions before 5.004 did not always properly localize the regex-related special variables. Perl 5.004 does localize them, as the documentation has always said it should. This may result in $1, $2, etc. no longer being set where existing programs use them.
p5004-No resetting of $. on implicit close
The documentation for Perl 5.0 has always stated that $.
is not reset when an already-open file handle is reopened with no intervening call to close
. Due to a bug, perl versions 5.000 through 5.003 did reset $.
under that circumstance; Perl 5.004 does not.
p5004-wantarray
may return undef
The wantarray
operator returns true if a subroutine is expected to return a list, and false otherwise. In Perl 5.004, wantarray
can also return the undefined value if a subroutine's return value will not be used at all, which allows subroutines to avoid a time-consuming calculation of a return value if it isn't going to be used.
p5004-eval EXPR
determines value of EXPR in scalar context
Perl (version 5) used to determine the value of EXPR inconsistently, sometimes incorrectly using the surrounding context for the determination. Now, the value of EXPR (before being parsed by eval) is always determined in a scalar context. Once parsed, it is executed as before, by providing the context that the scope surrounding the eval provided. This change makes the behavior Perl4 compatible, besides fixing bugs resulting from the inconsistent behavior. This program:
@a = qw(time now is time);
print eval @a;
print '|', scalar eval @a;
used to print something like "timenowis881399109|4", but now (and in perl4) prints "4|4".
p5004-Changes to tainting checks
A bug in previous versions may have failed to detect some insecure conditions when taint checks are turned on. (Taint checks are used in setuid or setgid scripts, or when explicitly turned on with the -T
invocation option.) Although it's unlikely, this may cause a previously-working script to now fail, which should be construed as a blessing since that indicates a potentially-serious security hole was just plugged.
The new restrictions when tainting include:
- p5004-No glob() or <*>
-
These operators may spawn the C shell (csh), which cannot be made safe. This restriction will be lifted in a future version of Perl when globbing is implemented without the use of an external program.
- p5004-No spawning if tainted $CDPATH, $ENV, $BASH_ENV
-
These environment variables may alter the behavior of spawned programs (especially shells) in ways that subvert security. So now they are treated as dangerous, in the manner of $IFS and $PATH.
- p5004-No spawning if tainted $TERM doesn't look like a terminal name
-
Some termcap libraries do unsafe things with $TERM. However, it would be unnecessarily harsh to treat all $TERM values as unsafe, since only shell metacharacters can cause trouble in $TERM. So a tainted $TERM is considered to be safe if it contains only alphanumerics, underscores, dashes, and colons, and unsafe if it contains other characters (including whitespace).
p5004-New Opcode module and revised Safe module
A new Opcode module supports the creation, manipulation and application of opcode masks. The revised Safe module has a new API and is implemented using the new Opcode module. Please read the new Opcode and Safe documentation.
p5004-Embedding improvements
In older versions of Perl it was not possible to create more than one Perl interpreter instance inside a single process without leaking like a sieve and/or crashing. The bugs that caused this behavior have all been fixed. However, you still must take care when embedding Perl in a C program. See the updated perlembed manpage for tips on how to manage your interpreters.
p5004-Internal change: FileHandle class based on IO::* classes
File handles are now stored internally as type IO::Handle. The FileHandle module is still supported for backwards compatibility, but it is now merely a front end to the IO::* modules, specifically IO::Handle, IO::Seekable, and IO::File. We suggest, but do not require, that you use the IO::* modules in new code.
In harmony with this change, *GLOB{FILEHANDLE}
is now just a backward-compatible synonym for *GLOB{IO}
.
p5004-Internal change: PerlIO abstraction interface
It is now possible to build Perl with AT&T's sfio IO package instead of stdio. See perlapio for more details, and the INSTALL file for how to use it.
p5004-New and changed syntax
- p5004-$coderef->(PARAMS)
-
A subroutine reference may now be suffixed with an arrow and a (possibly empty) parameter list. This syntax denotes a call of the referenced subroutine, with the given parameters (if any).
This new syntax follows the pattern of $hashref->{FOO}
and $aryref->[$foo]
: You may now write &$subref($foo)
as $subref->($foo)
. All these arrow terms may be chained; thus, &{$table->{FOO}}($bar)
may now be written $table->{FOO}->($bar)
.
p5004-New and changed builtin constants
- p5004-__PACKAGE__
-
The current package name at compile time, or the undefined value if there is no current package (due to a package;
directive). Like __FILE__
and __LINE__
, __PACKAGE__
does not interpolate into strings.
p5004-New and changed builtin variables
- p5004-$^E
-
Extended error message on some platforms. (Also known as $EXTENDED_OS_ERROR if you use English
).
- p5004-$^H
-
The current set of syntax checks enabled by use strict
. See the documentation of strict
for more details. Not actually new, but newly documented. Because it is intended for internal use by Perl core components, there is no use English
long name for this variable.
- p5004-$^M
-
By default, running out of memory it is not trappable. However, if compiled for this, Perl may use the contents of $^M
as an emergency pool after die()ing with this message. Suppose that your Perl were compiled with -DPERL_EMERGENCY_SBRK and used Perl's malloc. Then
$^M = 'a' x (1<<16);
would allocate a 64K buffer for use when in emergency. See the INSTALL file for information on how to enable this option. As a disincentive to casual use of this advanced feature, there is no use English
long name for this variable.
p5004-New and changed builtin functions
- p5004-delete on slices
-
This now works. (e.g. delete @ENV{'PATH', 'MANPATH'}
)
- p5004-flock
-
is now supported on more platforms, prefers fcntl to lockf when emulating, and always flushes before (un)locking.
- p5004-printf and sprintf
-
Perl now implements these functions itself; it doesn't use the C library function sprintf() any more, except for floating-point numbers, and even then only known flags are allowed. As a result, it is now possible to know which conversions and flags will work, and what they will do.
The new conversions in Perl's sprintf() are:
%i a synonym for %d
%p a pointer (the address of the Perl value, in hexadecimal)
%n special: *stores* the number of characters output so far
into the next variable in the parameter list
The new flags that go between the %
and the conversion are:
# prefix octal with "0", hex with "0x"
h interpret integer as C type "short" or "unsigned short"
V interpret integer as Perl's standard integer type
Also, where a number would appear in the flags, an asterisk ("*") may be used instead, in which case Perl uses the next item in the parameter list as the given number (that is, as the field width or precision). If a field width obtained through "*" is negative, it has the same effect as the '-' flag: left-justification.
See "sprintf" in perlfunc for a complete list of conversion and flags.
- p5004-keys as an lvalue
-
As an lvalue, keys
allows you to increase the number of hash buckets allocated for the given hash. This can gain you a measure of efficiency if you know the hash is going to get big. (This is similar to pre-extending an array by assigning a larger number to $#array.) If you say
keys %hash = 200;
then %hash
will have at least 200 buckets allocated for it. These buckets will be retained even if you do %hash = ()
; use undef %hash
if you want to free the storage while %hash
is still in scope. You can't shrink the number of buckets allocated for the hash using keys
in this way (but you needn't worry about doing this by accident, as trying has no effect).
- p5004-my() in Control Structures
-
You can now use my() (with or without the parentheses) in the control expressions of control structures such as:
while (defined(my $line = <>)) {
$line = lc $line;
} continue {
print $line;
}
if ((my $answer = ) =~ /^y(es)?$/i) {
user_agrees();
} elsif ($answer =~ /^n(o)?$/i) {
user_disagrees();
} else {
chomp $answer;
die "`$answer' is neither `yes' nor `no'";
}
Also, you can declare a foreach loop control variable as lexical by preceding it with the word "my". For example, in:
foreach my $i (1, 2, 3) {
some_function();
}
$i is a lexical variable, and the scope of $i extends to the end of the loop, but not beyond it.
Note that you still cannot use my() on global punctuation variables such as $_ and the like.
- p5004-pack() and unpack()
-
A new format 'w' represents a BER compressed integer (as defined in ASN.1). Its format is a sequence of one or more bytes, each of which provides seven bits of the total value, with the most significant first. Bit eight of each byte is set, except for the last byte, in which bit eight is clear.
If 'p' or 'P' are given undef as values, they now generate a NULL pointer.
Both pack() and unpack() now fail when their templates contain invalid types. (Invalid types used to be ignored.)
- p5004-sysseek()
-
The new sysseek() operator is a variant of seek() that sets and gets the file's system read/write position, using the lseek(2) system call. It is the only reliable way to seek before using sysread() or syswrite(). Its return value is the new position, or the undefined value on failure.
- p5004-use VERSION
-
If the first argument to use
is a number, it is treated as a version number instead of a module name. If the version of the Perl interpreter is less than VERSION, then an error message is printed and Perl exits immediately. Because use
occurs at compile time, this check happens immediately during the compilation process, unlike require VERSION
, which waits until runtime for the check. This is often useful if you need to check the current Perl version before use
ing library modules which have changed in incompatible ways from older versions of Perl. (We try not to do this more than we have to.)
- p5004-use Module VERSION LIST
-
If the VERSION argument is present between Module and LIST, then the use
will call the VERSION method in class Module with the given version as an argument. The default VERSION method, inherited from the UNIVERSAL class, croaks if the given version is larger than the value of the variable $Module::VERSION. (Note that there is not a comma after VERSION!)
This version-checking mechanism is similar to the one currently used in the Exporter module, but it is faster and can be used with modules that don't use the Exporter. It is the recommended method for new code.
- p5004-prototype(FUNCTION)
-
Returns the prototype of a function as a string (or undef
if the function has no prototype). FUNCTION is a reference to or the name of the function whose prototype you want to retrieve. (Not actually new; just never documented before.)
- p5004-srand
-
The default seed for srand
, which used to be time
, has been changed. Now it's a heady mix of difficult-to-predict system-dependent values, which should be sufficient for most everyday purposes.
Previous to version 5.004, calling rand
without first calling srand
would yield the same sequence of random numbers on most or all machines. Now, when perl sees that you're calling rand
and haven't yet called srand
, it calls srand
with the default seed. You should still call srand
manually if your code might ever be run on a pre-5.004 system, of course, or if you want a seed other than the default.
- p5004-$_ as Default
-
Functions documented in the Camel to default to $_ now in fact do, and all those that do are so documented in perlfunc.
- p5004-
m//gc
does not reset search position on failure
-
The m//g
match iteration construct has always reset its target string's search position (which is visible through the pos
operator) when a match fails; as a result, the next m//g
match after a failure starts again at the beginning of the string. With Perl 5.004, this reset may be disabled by adding the "c" (for "continue") modifier, i.e. m//gc
. This feature, in conjunction with the \G
zero-width assertion, makes it possible to chain matches together. See perlop and perlre.
- p5004-
m//x
ignores whitespace before ?*+{}
-
The m//x
construct has always been intended to ignore all unescaped whitespace. However, before Perl 5.004, whitespace had the effect of escaping repeat modifiers like "*" or "?"; for example, /a *b/x
was (mis)interpreted as /a\*b/x
. This bug has been fixed in 5.004.
- p5004-nested
sub{}
closures work now
-
Prior to the 5.004 release, nested anonymous functions didn't work right. They do now.
- p5004-formats work right on changing lexicals
-
Just like anonymous functions that contain lexical variables that change (like a lexical index variable for a foreach
loop), formats now work properly. For example, this silently failed before (printed only zeros), but is fine now:
my $i;
foreach $i ( 1 .. 10 ) {
write;
}
format =
my i is @#
$i
.
However, it still fails (without a warning) if the foreach is within a subroutine:
my $i;
sub foo {
foreach $i ( 1 .. 10 ) {
write;
}
}
foo;
format =
my i is @#
$i
.
p5004-New builtin methods
The UNIVERSAL
package automatically contains the following methods that are inherited by all other classes:
- p5004-isa(CLASS)
-
isa
returns true if its object is blessed into a subclass of CLASS
isa
is also exportable and can be called as a sub with two arguments. This allows the ability to check what a reference points to. Example:
use UNIVERSAL qw(isa);
if(isa($ref, 'ARRAY')) {
...
}
- p5004-can(METHOD)
-
can
checks to see if its object has a method called METHOD
, if it does then a reference to the sub is returned; if it does not then undef is returned.
- p5004-VERSION( [NEED] )
-
VERSION
returns the version number of the class (package). If the NEED argument is given then it will check that the current version (as defined by the $VERSION variable in the given package) not less than NEED; it will die if this is not the case. This method is normally called as a class method. This method is called automatically by the VERSION
form of use
.
use A 1.2 qw(some imported subs);
# implies:
A->VERSION(1.2);
NOTE: can
directly uses Perl's internal code for method lookup, and isa
uses a very similar method and caching strategy. This may cause strange effects if the Perl code dynamically changes @ISA in any package.
You may add other methods to the UNIVERSAL class via Perl or XS code. You do not need to use UNIVERSAL
in order to make these methods available to your program. This is necessary only if you wish to have isa
available as a plain subroutine in the current package.
p5004-TIEHANDLE now supported
See perltie for other kinds of tie()s.
- p5004-TIEHANDLE classname, LIST
-
This is the constructor for the class. That means it is expected to return an object of some sort. The reference can be used to hold some internal information.
sub TIEHANDLE {
print "\n";
my $i;
return bless \$i, shift;
}
- p5004-PRINT this, LIST
-
This method will be triggered every time the tied handle is printed to. Beyond its self reference it also expects the list that was passed to the print function.
sub PRINT {
$r = shift;
$$r++;
return print join( $, => map {uc} @_), $\;
}
- p5004-PRINTF this, LIST
-
This method will be triggered every time the tied handle is printed to with the printf()
function. Beyond its self reference it also expects the format and list that was passed to the printf function.
sub PRINTF {
shift;
my $fmt = shift;
print sprintf($fmt, @_)."\n";
}
- p5004-READ this LIST
-
This method will be called when the handle is read from via the read
or sysread
functions.
sub READ {
$r = shift;
my($buf,$len,$offset) = @_;
print "READ called, \$buf=$buf, \$len=$len, \$offset=$offset";
}
- p5004-READLINE this
-
This method will be called when the handle is read from. The method should return undef when there is no more data.
sub READLINE {
$r = shift;
return "PRINT called $$r times\n"
}
- p5004-GETC this
-
This method will be called when the getc
function is called.
sub GETC { print "Don't GETC, Get Perl"; return "a"; }
- p5004-DESTROY this
-
As with the other types of ties, this method will be called when the tied handle is about to be destroyed. This is useful for debugging and possibly for cleaning up.
sub DESTROY {
print "\n";
}
p5004-Malloc enhancements
If perl is compiled with the malloc included with the perl distribution (that is, if perl -V:d_mymalloc
is 'define') then you can print memory statistics at runtime by running Perl thusly:
env PERL_DEBUG_MSTATS=2 perl your_script_here
The value of 2 means to print statistics after compilation and on exit; with a value of 1, the statistics are printed only on exit. (If you want the statistics at an arbitrary time, you'll need to install the optional module Devel::Peek.)
Three new compilation flags are recognized by malloc.c. (They have no effect if perl is compiled with system malloc().)
- p5004--DPERL_EMERGENCY_SBRK
-
If this macro is defined, running out of memory need not be a fatal error: a memory pool can allocated by assigning to the special variable $^M
. See "p5004-$^M".
- p5004--DPACK_MALLOC
-
Perl memory allocation is by bucket with sizes close to powers of two. Because of these malloc overhead may be big, especially for data of size exactly a power of two. If PACK_MALLOC
is defined, perl uses a slightly different algorithm for small allocations (up to 64 bytes long), which makes it possible to have overhead down to 1 byte for allocations which are powers of two (and appear quite often).
Expected memory savings (with 8-byte alignment in alignbytes
) is about 20% for typical Perl usage. Expected slowdown due to additional malloc overhead is in fractions of a percent (hard to measure, because of the effect of saved memory on speed).
- p5004--DTWO_POT_OPTIMIZE
-
Similarly to PACK_MALLOC
, this macro improves allocations of data with size close to a power of two; but this works for big allocations (starting with 16K by default). Such allocations are typical for big hashes and special-purpose scripts, especially image processing.
On recent systems, the fact that perl requires 2M from system for 1M allocation will not affect speed of execution, since the tail of such a chunk is not going to be touched (and thus will not require real memory). However, it may result in a premature out-of-memory error. So if you will be manipulating very large blocks with sizes close to powers of two, it would be wise to define this macro.
Expected saving of memory is 0-100% (100% in applications which require most memory in such 2**n chunks); expected slowdown is negligible.
p5004-Miscellaneous efficiency enhancements
Functions that have an empty prototype and that do nothing but return a fixed value are now inlined (e.g. sub PI () { 3.14159 }
).
Each unique hash key is only allocated once, no matter how many hashes have an entry with that key. So even if you have 100 copies of the same hash, the hash keys never have to be reallocated.
p5004-Support for More Operating Systems
Support for the following operating systems is new in Perl 5.004.
p5004-Win32
Perl 5.004 now includes support for building a "native" perl under Windows NT, using the Microsoft Visual C++ compiler (versions 2.0 and above) or the Borland C++ compiler (versions 5.02 and above). The resulting perl can be used under Windows 95 (if it is installed in the same directory locations as it got installed in Windows NT). This port includes support for perl extension building tools like MakeMaker and h2xs, so that many extensions available on the Comprehensive Perl Archive Network (CPAN) can now be readily built under Windows NT. See http://www.perl.com/ for more information on CPAN and README.win32 in the perl distribution for more details on how to get started with building this port.
There is also support for building perl under the Cygwin32 environment. Cygwin32 is a set of GNU tools that make it possible to compile and run many Unix programs under Windows NT by providing a mostly Unix-like interface for compilation and execution. See README.cygwin32 in the perl distribution for more details on this port and how to obtain the Cygwin32 toolkit.
p5004-Plan 9
See README.plan9 in the perl distribution.
p5004-QNX
See README.qnx in the perl distribution.
p5004-AmigaOS
See README.amigaos in the perl distribution.
p5004-Pragmata
Six new pragmatic modules exist:
- p5004-use autouse MODULE => qw(sub1 sub2 sub3)
-
Defers require MODULE
until someone calls one of the specified subroutines (which must be exported by MODULE). This pragma should be used with caution, and only when necessary.
- p5004-use blib
-
- p5004-use blib 'dir'
-
Looks for MakeMaker-like 'blib' directory structure starting in dir (or current directory) and working back up to five levels of parent directories.
Intended for use on command line with -M option as a way of testing arbitrary scripts against an uninstalled version of a package.
- p5004-use constant NAME => VALUE
-
Provides a convenient interface for creating compile-time constants, See "Constant Functions" in perlsub.
- p5004-use locale
-
Tells the compiler to enable (or disable) the use of POSIX locales for builtin operations.
When use locale
is in effect, the current LC_CTYPE locale is used for regular expressions and case mapping; LC_COLLATE for string ordering; and LC_NUMERIC for numeric formatting in printf and sprintf (but not in print). LC_NUMERIC is always used in write, since lexical scoping of formats is problematic at best.
Each use locale
or no locale
affects statements to the end of the enclosing BLOCK or, if not inside a BLOCK, to the end of the current file. Locales can be switched and queried with POSIX::setlocale().
See perllocale for more information.
- p5004-use ops
-
Disable unsafe opcodes, or any named opcodes, when compiling Perl code.
- p5004-use vmsish
-
Enable VMS-specific language features. Currently, there are three VMS-specific features available: 'status', which makes $?
and system
return genuine VMS status values instead of emulating POSIX; 'exit', which makes exit
take a genuine VMS status value instead of assuming that exit 1
is an error; and 'time', which makes all times relative to the local time zone, in the VMS tradition.
p5004-Modules
p5004-Required Updates
Though Perl 5.004 is compatible with almost all modules that work with Perl 5.003, there are a few exceptions:
Module Required Version for Perl 5.004
------ -------------------------------
Filter Filter-1.12
LWP libwww-perl-5.08
Tk Tk400.202 (-w makes noise)
Also, the majordomo mailing list program, version 1.94.1, doesn't work with Perl 5.004 (nor with perl 4), because it executes an invalid regular expression. This bug is fixed in majordomo version 1.94.2.
p5004-Installation directories
The installperl script now places the Perl source files for extensions in the architecture-specific library directory, which is where the shared libraries for extensions have always been. This change is intended to allow administrators to keep the Perl 5.004 library directory unchanged from a previous version, without running the risk of binary incompatibility between extensions' Perl source and shared libraries.
p5004-Module information summary
Brand new modules, arranged by topic rather than strictly alphabetically:
CGI.pm Web server interface ("Common Gateway Interface")
CGI/Apache.pm Support for Apache's Perl module
CGI/Carp.pm Log server errors with helpful context
CGI/Fast.pm Support for FastCGI (persistent server process)
CGI/Push.pm Support for server push
CGI/Switch.pm Simple interface for multiple server types
CPAN Interface to Comprehensive Perl Archive Network
CPAN::FirstTime Utility for creating CPAN configuration file
CPAN::Nox Runs CPAN while avoiding compiled extensions
IO.pm Top-level interface to IO::* classes
IO/File.pm IO::File extension Perl module
IO/Handle.pm IO::Handle extension Perl module
IO/Pipe.pm IO::Pipe extension Perl module
IO/Seekable.pm IO::Seekable extension Perl module
IO/Select.pm IO::Select extension Perl module
IO/Socket.pm IO::Socket extension Perl module
Opcode.pm Disable named opcodes when compiling Perl code
ExtUtils/Embed.pm Utilities for embedding Perl in C programs
ExtUtils/testlib.pm Fixes up @INC to use just-built extension
FindBin.pm Find path of currently executing program
Class/Struct.pm Declare struct-like datatypes as Perl classes
File/stat.pm By-name interface to Perl's builtin stat
Net/hostent.pm By-name interface to Perl's builtin gethost*
Net/netent.pm By-name interface to Perl's builtin getnet*
Net/protoent.pm By-name interface to Perl's builtin getproto*
Net/servent.pm By-name interface to Perl's builtin getserv*
Time/gmtime.pm By-name interface to Perl's builtin gmtime
Time/localtime.pm By-name interface to Perl's builtin localtime
Time/tm.pm Internal object for Time::{gm,local}time
User/grent.pm By-name interface to Perl's builtin getgr*
User/pwent.pm By-name interface to Perl's builtin getpw*
Tie/RefHash.pm Base class for tied hashes with references as keys
UNIVERSAL.pm Base class for *ALL* classes
p5004-Fcntl
New constants in the existing Fcntl modules are now supported, provided that your operating system happens to support them:
F_GETOWN F_SETOWN
O_ASYNC O_DEFER O_DSYNC O_FSYNC O_SYNC
O_EXLOCK O_SHLOCK
These constants are intended for use with the Perl operators sysopen() and fcntl() and the basic database modules like SDBM_File. For the exact meaning of these and other Fcntl constants please refer to your operating system's documentation for fcntl() and open().
In addition, the Fcntl module now provides these constants for use with the Perl operator flock():
LOCK_SH LOCK_EX LOCK_NB LOCK_UN
These constants are defined in all environments (because where there is no flock() system call, Perl emulates it). However, for historical reasons, these constants are not exported unless they are explicitly requested with the ":flock" tag (e.g. use Fcntl ':flock'
).
p5004-IO
The IO module provides a simple mechanism to load all the IO modules at one go. Currently this includes:
IO::Handle
IO::Seekable
IO::File
IO::Pipe
IO::Socket
For more information on any of these modules, please see its respective documentation.
p5004-Math::Complex
The Math::Complex module has been totally rewritten, and now supports more operations. These are overloaded:
+ - * / ** <=> neg ~ abs sqrt exp log sin cos atan2 "" (stringify)
And these functions are now exported:
pi i Re Im arg
log10 logn ln cbrt root
tan
csc sec cot
asin acos atan
acsc asec acot
sinh cosh tanh
csch sech coth
asinh acosh atanh
acsch asech acoth
cplx cplxe
p5004-Math::Trig
This new module provides a simpler interface to parts of Math::Complex for those who need trigonometric functions only for real numbers.
p5004-DB_File
There have been quite a few changes made to DB_File. Here are a few of the highlights:
- Fixed a handful of bugs.
- By public demand, added support for the standard hash function exists().
- Made it compatible with Berkeley DB 1.86.
- Made negative subscripts work with RECNO interface.
- Changed the default flags from O_RDWR to O_CREAT|O_RDWR and the default mode from 0640 to 0666.
- Made DB_File automatically import the open() constants (O_RDWR, O_CREAT etc.) from Fcntl, if available.
- Updated documentation.
Refer to the HISTORY section in DB_File.pm for a complete list of changes. Everything after DB_File 1.01 has been added since 5.003.
p5004-Net::Ping
Major rewrite - support added for both udp echo and real icmp pings.
p5004-Object-oriented overrides for builtin operators
Many of the Perl builtins returning lists now have object-oriented overrides. These are:
File::stat
Net::hostent
Net::netent
Net::protoent
Net::servent
Time::gmtime
Time::localtime
User::grent
User::pwent
For example, you can now say
use File::stat;
use User::pwent;
$his = (stat($filename)->st_uid == pwent($whoever)->pw_uid);
p5004-Utility Changes
p5004-pod2html
- p5004-Sends converted HTML to standard output
-
The pod2html utility included with Perl 5.004 is entirely new. By default, it sends the converted HTML to its standard output, instead of writing it to a file like Perl 5.003's pod2html did. Use the --outfile=FILENAME option to write to a file.
p5004-xsubpp
- p5004-
void
XSUBs now default to returning nothing
-
Due to a documentation/implementation bug in previous versions of Perl, XSUBs with a return type of void
have actually been returning one value. Usually that value was the GV for the XSUB, but sometimes it was some already freed or reused value, which would sometimes lead to program failure.
In Perl 5.004, if an XSUB is declared as returning void
, it actually returns no value, i.e. an empty list (though there is a backward-compatibility exception; see below). If your XSUB really does return an SV, you should give it a return type of SV *
.
For backward compatibility, xsubpp tries to guess whether a void
XSUB is really void
or if it wants to return an SV *
. It does so by examining the text of the XSUB: if xsubpp finds what looks like an assignment to ST(0)
, it assumes that the XSUB's return type is really SV *
.
p5004-C Language API Changes
- p5004-
gv_fetchmethod
and perl_call_sv
-
The gv_fetchmethod
function finds a method for an object, just like in Perl 5.003. The GV it returns may be a method cache entry. However, in Perl 5.004, method cache entries are not visible to users; therefore, they can no longer be passed directly to perl_call_sv
. Instead, you should use the GvCV
macro on the GV to extract its CV, and pass the CV to perl_call_sv
.
The most likely symptom of passing the result of gv_fetchmethod
to perl_call_sv
is Perl's producing an "Undefined subroutine called" error on the second call to a given method (since there is no cache on the first call).
- p5004-
perl_eval_pv
-
A new function handy for eval'ing strings of Perl code inside C code. This function returns the value from the eval statement, which can be used instead of fetching globals from the symbol table. See perlguts, perlembed and perlcall for details and examples.
- p5004-Extended API for manipulating hashes
-
Internal handling of hash keys has changed. The old hashtable API is still fully supported, and will likely remain so. The additions to the API allow passing keys as SV*
s, so that tied
hashes can be given real scalars as keys rather than plain strings (nontied hashes still can only use strings as keys). New extensions must use the new hash access functions and macros if they wish to use SV*
keys. These additions also make it feasible to manipulate HE*
s (hash entries), which can be more efficient. See perlguts for details.
p5004-Documentation Changes
Many of the base and library pods were updated. These new pods are included in section 1:
- p5004-perldelta
-
This document.
- p5004-perlfaq
-
Frequently asked questions.
- p5004-perllocale
-
Locale support (internationalization and localization).
- p5004-perltoot
-
Tutorial on Perl OO programming.
- p5004-perlapio
-
Perl internal IO abstraction interface.
- p5004-perlmodlib
-
Perl module library and recommended practice for module creation. Extracted from perlmod (which is much smaller as a result).
- p5004-perldebug
-
Although not new, this has been massively updated.
- p5004-perlsec
-
Although not new, this has been massively updated.
p5004-New Diagnostics
Several new conditions will trigger warnings that were silent before. Some only affect certain platforms. The following new warnings and errors outline these. These messages are classified as follows (listed in increasing order of desperation):
(W) A warning (optional).
(D) A deprecation (optional).
(S) A severe warning (mandatory).
(F) A fatal error (trappable).
(P) An internal error you should never see (trappable).
(X) A very fatal error (nontrappable).
(A) An alien error message (not generated by Perl).
- p5004-"my" variable %s masks earlier declaration in same scope
-
(W) A lexical variable has been redeclared in the same scope, effectively eliminating all access to the previous instance. This is almost always a typographical error. Note that the earlier variable will still exist until the end of the scope or until all closure referents to it are destroyed.
- p5004-%s argument is not a HASH element or slice
-
(F) The argument to delete() must be either a hash element, such as
$foo{$bar}
$ref->[12]->{"susie"}
or a hash slice, such as
@foo{$bar, $baz, $xyzzy}
@{$ref->[12]}{"susie", "queue"}
- p5004-Allocation too large: %lx
-
(X) You can't allocate more than 64K on an MS-DOS machine.
- p5004-Allocation too large
-
(F) You can't allocate more than 2^31+"small amount" bytes.
- p5004-Applying %s to %s will act on scalar(%s)
-
(W) The pattern match (//), substitution (s///), and transliteration (tr///) operators work on scalar values. If you apply one of them to an array or a hash, it will convert the array or hash to a scalar value (the length of an array or the population info of a hash) and then work on that scalar value. This is probably not what you meant to do. See "grep" in perlfunc and "map" in perlfunc for alternatives.
- p5004-Attempt to free nonexistent shared string
-
(P) Perl maintains a reference counted internal table of strings to optimize the storage and access of hash keys and other strings. This indicates someone tried to decrement the reference count of a string that can no longer be found in the table.
- p5004-Attempt to use reference as lvalue in substr
-
(W) You supplied a reference as the first argument to substr() used as an lvalue, which is pretty strange. Perhaps you forgot to dereference it first. See "substr" in perlfunc.
- p5004-Bareword "%s" refers to nonexistent package
-
(W) You used a qualified bareword of the form Foo::
, but the compiler saw no other uses of that namespace before that point. Perhaps you need to predeclare a package?
- p5004-Can't redefine active sort subroutine %s
-
(F) Perl optimizes the internal handling of sort subroutines and keeps pointers into them. You tried to redefine one such sort subroutine when it was currently active, which is not allowed. If you really want to do this, you should write sort { &func } @x
instead of sort func @x
.
- p5004-Can't use bareword ("%s") as %s ref while "strict refs" in use
-
(F) Only hard references are allowed by "strict refs". Symbolic references are disallowed. See perlref.
- p5004-Cannot resolve method `%s' overloading `%s' in package `%s'
-
(P) Internal error trying to resolve overloading specified by a method name (as opposed to a subroutine reference).
- p5004-Constant subroutine %s redefined
-
(S) You redefined a subroutine which had previously been eligible for inlining. See "Constant Functions" in perlsub for commentary and workarounds.
- p5004-Constant subroutine %s undefined
-
(S) You undefined a subroutine which had previously been eligible for inlining. See "Constant Functions" in perlsub for commentary and workarounds.
- p5004-Copy method did not return a reference
-
(F) The method which overloads "=" is buggy. See "Copy Constructor" in overload.
- p5004-Died
-
(F) You passed die() an empty string (the equivalent of die ""
) or you called it with no args and both $@
and $_
were empty.
- p5004-Exiting pseudo-block via %s
-
(W) You are exiting a rather special block construct (like a sort block or subroutine) by unconventional means, such as a goto, or a loop control statement. See "sort" in perlfunc.
- p5004-Identifier too long
-
(F) Perl limits identifiers (names for variables, functions, etc.) to 252 characters for simple names, somewhat more for compound names (like $A::B
). You've exceeded Perl's limits. Future versions of Perl are likely to eliminate these arbitrary limitations.
- p5004-Illegal character %s (carriage return)
-
(F) A carriage return character was found in the input. This is an error, and not a warning, because carriage return characters can break multi-line strings, including here documents (e.g., print <).
- p5004-Illegal switch in PERL5OPT: %s
-
(X) The PERL5OPT environment variable may only be used to set the following switches: -[DIMUdmw].
- p5004-Integer overflow in hex number
-
(S) The literal hex number you have specified is too big for your architecture. On a 32-bit architecture the largest hex literal is 0xFFFFFFFF.
- p5004-Integer overflow in octal number
-
(S) The literal octal number you have specified is too big for your architecture. On a 32-bit architecture the largest octal literal is 037777777777.
- p5004-internal error: glob failed
-
(P) Something went wrong with the external program(s) used for glob
and <*.c>
. This may mean that your csh (C shell) is broken. If so, you should change all of the csh-related variables in config.sh: If you have tcsh, make the variables refer to it as if it were csh (e.g. full_csh='/usr/bin/tcsh'
); otherwise, make them all empty (except that d_csh
should be 'undef'
) so that Perl will think csh is missing. In either case, after editing config.sh, run ./Configure -S
and rebuild Perl.
- p5004-Invalid conversion in %s: "%s"
-
(W) Perl does not understand the given format conversion. See "sprintf" in perlfunc.
- p5004-Invalid type in pack: '%s'
-
(F) The given character is not a valid pack type. See "pack" in perlfunc.
- p5004-Invalid type in unpack: '%s'
-
(F) The given character is not a valid unpack type. See "unpack" in perlfunc.
- p5004-Name "%s::%s" used only once: possible typo
-
(W) Typographical errors often show up as unique variable names. If you had a good reason for having a unique name, then just mention it again somehow to suppress the message (the use vars
pragma is provided for just this purpose).
- p5004-Null picture in formline
-
(F) The first argument to formline must be a valid format picture specification. It was found to be empty, which probably means you supplied it an uninitialized value. See perlform.
- p5004-Offset outside string
-
(F) You tried to do a read/write/send/recv operation with an offset pointing outside the buffer. This is difficult to imagine. The sole exception to this is that sysread()
ing past the buffer will extend the buffer and zero pad the new area.
- p5004-Out of memory!
-
(X|F) The malloc() function returned 0, indicating there was insufficient remaining memory (or virtual memory) to satisfy the request.
The request was judged to be small, so the possibility to trap it depends on the way Perl was compiled. By default it is not trappable. However, if compiled for this, Perl may use the contents of $^M
as an emergency pool after die()ing with this message. In this case the error is trappable once.
- p5004-Out of memory during request for %s
-
(F) The malloc() function returned 0, indicating there was insufficient remaining memory (or virtual memory) to satisfy the request. However, the request was judged large enough (compile-time default is 64K), so a possibility to shut down by trapping this error is granted.
- p5004-panic: frexp
-
(P) The library function frexp() failed, making printf("%f") impossible.
- p5004-Possible attempt to put comments in qw() list
-
(W) qw() lists contain items separated by whitespace; as with literal strings, comment characters are not ignored, but are instead treated as literal data. (You may have used different delimiters than the parentheses shown here; braces are also frequently used.)
You probably wrote something like this:
@list = qw(
a # a comment
b # another comment
);
when you should have written this:
@list = qw(
a
b
);
If you really want comments, build your list the old-fashioned way, with quotes and commas:
@list = (
'a', # a comment
'b', # another comment
);
- p5004-Possible attempt to separate words with commas
-
(W) qw() lists contain items separated by whitespace; therefore commas aren't needed to separate the items. (You may have used different delimiters than the parentheses shown here; braces are also frequently used.)
You probably wrote something like this:
qw! a, b, c !;
which puts literal commas into some of the list items. Write it without commas if you don't want them to appear in your data:
qw! a b c !;
- p5004-Scalar value @%s{%s} better written as $%s{%s}
-
(W) You've used a hash slice (indicated by @) to select a single element of a hash. Generally it's better to ask for a scalar value (indicated by $). The difference is that $foo{&bar}
always behaves like a scalar, both when assigning to it and when evaluating its argument, while @foo{&bar}
behaves like a list when you assign to it, and provides a list context to its subscript, which can do weird things if you're expecting only one subscript.
- p5004-Stub found while resolving method `%s' overloading `%s' in %s
-
(P) Overloading resolution over @ISA tree may be broken by importing stubs. Stubs should never be implicitly created, but explicit calls to can
may break this.
- p5004-Too late for "-T" option
-
(X) The #! line (or local equivalent) in a Perl script contains the -T option, but Perl was not invoked with -T in its argument list. This is an error because, by the time Perl discovers a -T in a script, it's too late to properly taint everything from the environment. So Perl gives up.
- p5004-untie attempted while %d inner references still exist
-
(W) A copy of the object returned from tie
(or tied
) was still valid when untie
was called.
- p5004-Unrecognized character %s
-
(F) The Perl parser has no idea what to do with the specified character in your Perl script (or eval). Perhaps you tried to run a compressed script, a binary program, or a directory as a Perl program.
- p5004-Unsupported function fork
-
(F) Your version of executable does not support forking.
Note that under some systems, like OS/2, there may be different flavors of Perl executables, some of which may support fork, some not. Try changing the name you call Perl by to perl_
, perl__
, and so on.
- "_to_mean_"${$}
"_is_deprecated"
>p5004-Use of "$$" to mean "${$}" is deprecated
-
(D) Perl versions before 5.004 misinterpreted any type marker followed by "$" and a digit. For example, "$$0" was incorrectly taken to mean "${$}0" instead of "${$0}". This bug is (mostly) fixed in Perl 5.004.
However, the developers of Perl 5.004 could not fix this bug completely, because at least two widely-used modules depend on the old meaning of "$$0" in a string. So Perl 5.004 still interprets "$$" in the old (broken) way inside strings; but it generates this message as a warning. And in Perl 5.005, this special treatment will cease.
- p5004-Value of %s can be "0"; test with defined()
-
(W) In a conditional expression, you used , <*> (glob), each()
, or readdir()
as a boolean value. Each of these constructs can return a value of "0"; that would make the conditional expression false, which is probably not what you intended. When using these constructs in conditional expressions, test their values with the defined
operator.
- p5004-Variable "%s" may be unavailable
-
(W) An inner (nested) anonymous subroutine is inside a named subroutine, and outside that is another subroutine; and the anonymous (innermost) subroutine is referencing a lexical variable defined in the outermost subroutine. For example:
sub outermost { my $a; sub middle { sub { $a } } }
If the anonymous subroutine is called or referenced (directly or indirectly) from the outermost subroutine, it will share the variable as you would expect. But if the anonymous subroutine is called or referenced when the outermost subroutine is not active, it will see the value of the shared variable as it was before and during the *first* call to the outermost subroutine, which is probably not what you want.
In these circumstances, it is usually best to make the middle subroutine anonymous, using the sub {}
syntax. Perl has specific support for shared variables in nested anonymous subroutines; a named subroutine in between interferes with this feature.
- p5004-Variable "%s" will not stay shared
-
(W) An inner (nested) named subroutine is referencing a lexical variable defined in an outer subroutine.
When the inner subroutine is called, it will probably see the value of the outer subroutine's variable as it was before and during the *first* call to the outer subroutine; in this case, after the first call to the outer subroutine is complete, the inner and outer subroutines will no longer share a common value for the variable. In other words, the variable will no longer be shared.
Furthermore, if the outer subroutine is anonymous and references a lexical variable outside itself, then the outer and inner subroutines will never share the given variable.
This problem can usually be solved by making the inner subroutine anonymous, using the sub {}
syntax. When inner anonymous subs that reference variables in outer subroutines are called or referenced, they are automatically rebound to the current values of such variables.
- p5004-Warning: something's wrong
-
(W) You passed warn() an empty string (the equivalent of warn ""
) or you called it with no args and $_
was empty.
- p5004-Ill-formed logical name |%s| in prime_env_iter
-
(W) A warning peculiar to VMS. A logical name was encountered when preparing to iterate over %ENV which violates the syntactic rules governing logical names. Since it cannot be translated normally, it is skipped, and will not appear in %ENV. This may be a benign occurrence, as some software packages might directly modify logical name tables and introduce nonstandard names, or it may indicate that a logical name table has been corrupted.
- p5004-Got an error from DosAllocMem
-
(P) An error peculiar to OS/2. Most probably you're using an obsolete version of Perl, and this should not happen anyway.
- p5004-Malformed PERLLIB_PREFIX
-
(F) An error peculiar to OS/2. PERLLIB_PREFIX should be of the form
prefix1;prefix2
or
prefix1 prefix2
with nonempty prefix1 and prefix2. If prefix1
is indeed a prefix of a builtin library search path, prefix2 is substituted. The error may appear if components are not found, or are too long. See "PERLLIB_PREFIX" in README.os2.
- p5004-PERL_SH_DIR too long
-
(F) An error peculiar to OS/2. PERL_SH_DIR is the directory to find the sh
-shell in. See "PERL_SH_DIR" in README.os2.
- p5004-Process terminated by SIG%s
-
(W) This is a standard message issued by OS/2 applications, while *nix applications die in silence. It is considered a feature of the OS/2 port. One can easily disable this by appropriate sighandlers, see "Signals" in perlipc. See also "Process terminated by SIGTERM/SIGINT" in README.os2.
p5004-BUGS
If you find what you think is a bug, you might check the headers of recently posted articles in the comp.lang.perl.misc newsgroup. There may also be information at http://www.perl.com/perl/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Make sure you trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to <perlbug@perl.com> to be analysed by the Perl porting team.
p5004-SEE ALSO
The Changes file for exhaustive details on what changed.
The INSTALL file for how to build Perl. This file has been significantly updated for 5.004, so even veteran users should look through it.
The README file for general stuff.
The Copying file for copyright information.
p5004-HISTORY
Constructed by Tom Christiansen, grabbing material with permission from innumerable contributors, with kibitzing by more than a few Perl porters.
Last update: Wed May 14 11:14:09 EDT 1997