perl5194delta - what is new for perl v5.19.4
This document describes differences between the 5.19.3 release and the 5.19.4 release.
If you are upgrading from an earlier release such as 5.19.2, first read perl5193delta, which describes differences between 5.19.2 and 5.19.3.
rand
now uses a consistent random number generatorPreviously perl would use a platform specific random number generator, varying between the libc rand(), random() or drand48().
This meant that the quality of perl's random numbers would vary from platform to platform, from the 15 bits of rand() on Windows to 48-bits on POSIX platforms such as Linux with drand48().
Perl now uses its own internal drand48() implementation on all platforms.
This does not make perl's rand
cryptographically secure.
[perl #115928]
On 64-bit platforms, the internal array functions now use 64-bit offsets, allowing Perl arrays to hold more than 2**31 elements, if you have the memory available.
The regular expression engine now supports strings longer than 2**31 characters. [perl #112790, #116907]
The functions PerlIO_get_bufsiz, PerlIO_get_cnt, PerlIO_set_cnt and PerlIO_set_ptrcnt now have SSize_t, rather than int, return values and parameters.
The new %hash{...}
and %array[...]
syntax returns a list of key/value (or index/value) pairs.
See "Key/Value Hash Slices" in perldata.
Core Perl now mostly works on EBCDIC platforms. This is not true of many modules, including some which are shipped with this release. If you have resources to help continue this process, including test machines, send email to mailto:perl-mvs@perl.org.
As a result of this, certain XS functions are now deprecated; see "Internal Changes".
use locale
scope (with the exception of $!)This is actually a bug fix,
but some code has come to rely on the bug being present,
so this change is listed here.
The current locale that the program is running under is not supposed to be visible to Perl code except within the scope of a use locale
.
However,
until now under certain circumstances,
the character used for a decimal point (often a comma) leaked outside the scope.
This continues the work released in Perl 5.19.1.
It turns out that that did not catch all the leaks,
including printf
and sprintf
not respecting use locale
.
If your code is affected by this change,
simply add a use locale
.
Now,
the only known place where use locale
is not respected is in the stringification of $!.
In previous versions of Perl, Windows sockets error codes as returned by WSAGetLastError() were assigned to $!, and some constants such as ECONNABORTED, not in errno.h in VC++ (or the various Windows ports of gcc) were defined to corresponding WSAE* values to allow $! to be tested against the E* constants exported by Errno and POSIX.
This worked well until VC++ 2010 and later, which introduced new E* constants with values > 100 into errno.h, including some being (re)defined by perl to WSAE* values. That caused problems when linking XS code against other libraries which used the original definitions of errno.h constants.
To avoid this incompatibility, perl now maps WSAE* error codes to E* values where possible, and assigns those values to $!. The E* constants exported by Errno and POSIX are updated to match so that testing $! against them, wherever previously possible, will continue to work as expected, and all E* constants found in errno.h are now exported from those modules with their original errno.h values
In order to avoid breakage in existing Perl code which assigns WSAE* values to $!, perl now intercepts the assignment and performs the same mapping to E* values as it uses internally when assigning to $! itself.
However, one backwards-incompatibility remains: existing Perl code which compares $! against the numeric values of the WSAE* error codes that were previously assigned to $! will now be broken in those cases where a corresponding E* value has been assigned instead. This is only an issue for those E* values < 100, which were always exported from Errno and POSIX with their original errno.h values, and therefore could not be used for WSAE* error code tests (e.g. WSAEINVAL is 10022, but the corresponding EINVAL is 22). (E* values > 100, if present, were redefined to WSAE* values anyway, so compatibility can be achieved by using the E* constants, which will work both before and after this change, albeit using different numeric values under the hood.)
This deprecation affects things like $\cT, where \cT is a literal control in the source code. Surprisingly, it appears that originally this was intended as the canonical way of accessing variables like $^T, with the caret form only being added as an alternative.
The literal control form is being deprecated for two main reasons. It has what are likely unfixable bugs, such as $\cI not working as an alias for $^I, and their usage not being portable to non-ASCII platforms: While $^T will work everywhere, \cT is whitespace in EBCDIC. [perl #119123]
Numerous improvements have been made, many speed-related. See the Changes file in the CPAN distribution for full details.
The fix for [perl #118525] introduced a regression in the behaviour of B::CV::GV
,
changing the return value from a B::SPECIAL
object on a NULL
CvGV
to undef
.
B::CV::GV
again returns a B::SPECIAL
object in this case.
[perl #119351]
B version 1.44 (Perl 5.19.2) introduced four new B::OP methods,
slabbed
,
savefree
,
static
and folded
,
but these have never actually worked until now.
They used to croak.
The handling of the glob
operator,
broken since Perl 5.17.6,
has been fixed and handling of the new kvaslice and kvhslice operators have been added.
The new kvaslice and kvhslice operators have been added.
overload::StrVal
glob or subroutine or the overload stash.This module now works on EBCDIC platforms.
Numerous updates and bug fixes are incorporated. See the Changes file for full details.
META validation no longer allows a scalar value when a list was required for a field.
No changes have been made to the installed code other than the version bump to keep in sync with the latest CPAN release.
This upgrade is part of a larger change to make the array interface 64-bit safe by using SSize_t instead of I32 for array indices.
In addition, an EBCDIC fix has been applied.
This upgrade is part of a larger change to preserve referential identity when passing undef
to a subroutine by using NULL rather than &PL_sv_undef for non-existent array elements.
In addition,
Dump
with no args was broken in Perl 5.19.3,
but has now been fixed.
=back
is now treated as the end of a warning description,
thus keeping any trailing data in the file from showing up as part of the last warning's description.
[perl #119817]
The documentation now makes it clear,
as has always been the case,
that dl_unload_file
is only called automatically to unload all loaded shared objects if the perl interpreter was built with the C macro DL_UNLOAD_ALL_AT_EXIT defined.
Support for GNU DLD has also been removed.
An erroneous early return in decode_utf8
has been removed,
and a bug in _utf8_on
under COW has been fixed.
Encode also now uses parent rather than base throughout.
The list of E* constants exported on Windows has been updated to reflect the changes made in the assignment of sockets error codes to $! (see "Incompatible Changes").
A number of typos have been corrected in the documentation.
No changes have been made to the installed code other than the version bump to keep in sync with the latest CPAN release.
No changes have been made to the installed code other than the version bump to keep in sync with the latest CPAN release.
Numerous updates and bug fixes are incorporated. See the Changes file for full details.
Unquoted "here-doc" markers for typemaps can now be optionally followed by a semicolon, just like quoted markers. [perl #119761]
The documentation of copy
now makes it clear that trying to copy a file into a non-existent directory is not supported.
[perl #119539]
Better diagnostics are now provided in the case of a failed chdir
.
glob
now warns in the context of use warnings "syscalls";
if the supplied pattern has an internal NUL ("\0"
) character.
This upgrade is part of a larger change to use parent rather than base.
This upgrade is part of a larger change to use parent rather than base.
Encoded data from post_form
now preserves term order if data is provided as an array reference.
(They are still sorted for consistency if provided as a hash reference.)
Bosnian has now joined Croatian and Serbian in the lists of mutually intelligible Slavic languages. [perl #72594]
A minor internals-only change has been made to the XS code.
The connect
method has been updated in the light of changes made in the assignment of sockets error codes to $!
on Windows (see "Incompatible Changes").
This upgrade is part of a larger change to preserve referential identity when passing undef
to a subroutine by using NULL rather than &PL_sv_undef for non-existent array elements.
A precedence issue has been fixed in the return value of a private subroutine.
New codes have been added and the (deprecated) set of FIPS-10 country codes has been removed.
Cleaned up the Math::BigInt and Math::BigFloat documentation to be more consistent with other Perl documentation. [perl #86686]
Added a bint
method for rounding towards zero.
[perl #85296]
This upgrade is part of a larger change to make the array interface 64-bit safe by using SSize_t instead of I32 for array indices.
The list of Perl versions covered has been updated.
A function is_core
has been added,
which returns true if the specified module was bundled with Perl.
Optionally you can specify a minimum version of the module,
and the specific version of Perl you're interested in (defaults to $^V,
the running version of Perl).
requires
has been made more robust.
[cpan #83728]
The module's DESCRIPTION has been re-worded regarding safety/security to satisfy CVE-2013-1437. Also, versions are now detainted if needed. [cpan #88576]
This upgrade is part of a larger change to make the array interface 64-bit safe by using SSize_t instead of I32 for array indices.
The new kvaslice and kvhslice operators have been added.
No changes have been made to the installed code other than the version bump to keep in sync with the latest CPAN release.
No changes have been made to the installed code other than the version bump to keep in sync with the latest CPAN release.
The Unix OSType 'bitrig' has been added.
The use of gensym
in a number of examples has been removed,
the use of &
in subroutine calls is now clarified and several new questions have been answered.
This upgrade is part of a larger change to use parent rather than base.
The list of E* constants exported on Windows has been updated to reflect the changes made in the assignment of sockets error codes to $! (see "Incompatible Changes").
This upgrade is part of a larger change to support 64-bit string lengths in the regular expression engine.
The documentation of blessed
has been improved to mention the fact that package "0" is defined but false.
Syntax errors when building on the WinCE platform have been fixed. [cpan #87389]
This upgrade is part of a larger change to preserve referential identity when passing undef
to a subroutine by using NULL rather than &PL_sv_undef for non-existent array elements.
Term::ReadLine::EditLine support has been added.
A precedence issue has been fixed in the return value of a private subroutine in Test::Builder.
Day of year parsing (like "%y%j") has been fixed.
By default,
out-of-range values are replaced with U+FFFD (REPLACEMENT CHARACTER) when UCA_Version
>= 22,
or ignored when UCA_Version
<= 20.
When UCA_Version
>= 22,
the weights of out-of-range values can be overridden.
This module now works on EBCDIC platforms.
No changes have been made to the installed code other than the version bump to keep in sync with the latest CPAN release.
The syscalls
warnings category has been added to check for embedded NUL ("\0"
) characters in pathnames and string arguments to other system calls.
[perl #117265]
This upgrade is part of the change to remove the uninitialized warnings exemption for uninitialized values returned by XSUBs (see the "Selected Bug Fixes" section).
This document was removed (actually, renamed perlgit and given a major overhaul) in Perl 5.13.10, causing Perl documentation websites to show the now out of date version in Perl 5.12 as the latest version. It has now been restored in stub form, directing readers to current information.
DB::goto
and DB::lsub
debugger subroutines are now documented.
[perl #77680]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) You used index/value array slice syntax (%array[...]
) as the argument to delete
.
You probably meant @array[...]
with an @ symbol instead.
(F) You used key/value hash slice syntax (%hash{...}
) as the argument to delete
.
You probably meant @hash{...}
with an @ symbol instead.
(W syscalls) Embedded \0 characters in pathnames or other system call arguments produce a warning as of 5.20. The parts after the \0 were formerly ignored by system calls.
(W syntax) There is a possible problem with the mixing of a control flow operator (e.g.
return
) and a low-precedence operator like or
.
Consider:
sub { return $a or $b; }
This is parsed as:
sub { (return $a) or $b; }
Which is effectively just:
sub { return $a; }
Either use parentheses or the high-precedence variant of the operator.
Note this may be also triggered for constructs like:
sub { 1 if die; }
(W syntax) In scalar context, you've used an array index/value slice (indicated by %) to select a single element of an array. Generally it's better to ask for a scalar value (indicated by $). The difference is that $foo[&bar]
always behaves like a scalar, both in the value it returns and when evaluating its argument, while %foo[&bar]
provides a list context to its subscript, which can do weird things if you're expecting only one subscript. When called in list context, it also returns the index (what &bar
returns) in addition to the value.
(W syntax) In scalar context, you've used a hash key/value 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 in the value it returns and when evaluating its argument, while @foo{&bar}
and provides a list context to its subscript, which can do weird things if you're expecting only one subscript. When called in list context, it also returns the key in addition to the value.
(D deprecated) Using literal control characters in the source to refer to the ^FOO variables, like $^X and ${^GLOBAL_PHASE} is now deprecated. This only affects code like $\cT, where \cT is a control in the source code: ${"\cT"} and $^T remain valid.
(?(foo))
conditional. The error message used to read:
Unknown switch condition (?(%s in regex;
But what %s could be was mostly up to luck. For (?(foobar))
, you might have seen "fo" or "f". For Unicode characters, you would generally get a corrupted string. The message has been changed to read:
Unknown switch condition (?(...)) in regex;
Additionally, the '<-- HERE'
marker in the error will now point to the correct spot in the regex.
?
wildcards correctly. [perl #113054]Strictly only for a build where build files such as Makefile.SH have not been updated by git
in an already configured and built tree.
die
, last
, goto
and exit
triggering DESTROY
are now tested by the new test script t/op/rt119311.t.Support has been added for FreeMiNT, a free open-source OS for the Atari ST system and its successors, based on the original MiNT that was officially adopted by Atari.
Compile support has been added for Bitrig, a fork of OpenBSD.
Configure hints and conditional code for several very old platforms has been removed. We have not received reports for these in many years, typically not since Perl 5.6.0.
Configure support for the 3b1, also known as the AT&T Unix PC (and the similar AT&T 7300), has been removed.
The PERL_ENV_TABLES
feature to control the population of %ENV at perl start-up was broken in Perl 5.16.0 but has now been fixed.
rename
and link
on Win32 now set $! to ENOSPC and EDQUOT when appropriate. [perl #119857]
Perl now builds again on WinCE, following locale-related breakage (WinCE has non-existent locale support) introduced around 5.19.1. [perl #119443]
The building of XS modules has largely been restored. Several still cannot (yet) be built but it is now possible to build Perl on WinCE with only a couple of further patches (to Socket and ExtUtils::MakeMaker), hopefully to be incorporated soon.
The BSD compatibility library libbsd
is no longer required for builds.
$array[0] = anything
will croak and \$array[0]
will compare equal to \undef
.utf8n_to_uvuni
(use utf8_to_uvchr_buf
instead), utf8_to_uni_buf
(use utf8_to_uvchr_buf
instead), valid_utf8_to_uvuni
(use utf8_to_uvchr_buf
instead), uvuni_to_utf8
(use uvchr_to_utf8
instead), NATIVE_TO_NEED
(this did not work properly anyway), and ASCII_TO_NEED
(this did not work properly anyway).
Starting in this release, almost never does application code need to distinguish between the platform's character set and Latin1, on which the lowest 256 characters of Unicode are based.
open my $fh...
) is usually given a name based on the current package and the name of the variable, e.g. "main::$fh". Under recursion, the filehandle was losing the "$fh" part of the name. This has been fixed.elsif ("")
no longer erroneously produces a warning about void context. [perl #118753]undef
to a subroutine now causes @_ to contain the same read-only undefined scalar that undef
returns. Furthermore, exists $_[0]
will now return true if undef
was the first argument. [perl #7508, #109726]1 unless 1;
This has been fixed. [perl #118931]
__DATA__
now puts the DATA
handle in the right package, even if the current package has been renamed through glob assignment.pos
could shift if the string changed representation internally to or from utf8. This could happen, e.g., with references to objects with string overloading.pos
calls with the same argument, and then assigning a reference to one and undef
to the other, could result in assertion failures or memory leaks.$ref = \$-[1]
) could refer to the wrong match after subsequent matches.die
, last
, next
, redo
, goto
and exit
unwind the scope, it is possible for DESTROY
recursively to call a subroutine or format that is currently being exited. It that case, sometimes the lexical variables inside the sub would start out having values from the outer call, instead of being undefined as they should. This has been fixed. [perl #119311](caller)[2]
. [perl #115768]#line
directives inside code embedded in quote-like operators are now respected.=>
occurred at the beginning of a line and the previous line ended with a keyword. This is now fixed.$dbline[0]
in the debugger.my(...)
list might fail to be cleared on scope exit.&xsub
and goto &xsub
calls now allow the called subroutine to autovivify elements of @_.&xsub
and goto &xsub
no longer crash if *_ has been undefined and has no ARRAY entry (i.e. @_ does not exist).&xsub
and goto &xsub
now work with tied @_.@hash{+function_returning_a_list}
and @hash{ qw "foo bar baz" }
no longer warn. The same applies to array slices. [perl #28380, #114024]$! = EINVAL; waitpid(0, WNOHANG);
no longer goes into an internal infinite loop. [perl #85228]\(1+2)
to return a reference to the same mutable scalar each time, so that modifications affect future evaluations. This has been fixed. [perl #119501]Perl 5.19.4 represents approximately 4 weeks of development since Perl 5.19.3 and contains approximately 31,000 lines of changes across 580 files from 42 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.19.4:
Andy Dougherty, Brian Fraser, Chris 'BinGOs' Williams, Christian Millour, Craig A. Berry, Daniel Dragan, David Golden, David Leadbeater, David Mitchell, Father Chrysostomos, Florian Ragwitz, François Perrad, H.Merijn Brand, James E Keenan, John Goodyear, John P. Linderman, John Peacock, Karl Williamson, kevin dawson, Leon Timmermans, Marco Peereboom, Matthew Horsfall, Nathan Glenn, Neil Bowers, Nicholas Clark, Niels Thykier, Niko Tyni, Owain G. Ainsworth, Peter John Acklam, Reini Urban, Ricardo Signes, Ruslan Zakirov, Slaven Rezic, Smylers, Steve Hay, Sullivan Beck, Toby Inkster, Tokuhiro Matsuno, Tony Cook, Victor Efimov, Zefram, Zsbán Ambrus.
The list above is almost certainly incomplete as it is automatically generated from version control history. In particular, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker.
Many of the changes included in this version originated in the CPAN modules included in Perl's core. We're grateful to the entire CPAN community for helping Perl to flourish.
For a more complete list of all of Perl's historical contributors, please see the AUTHORS file in the Perl source distribution.
If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.
If you believe you have an unreported bug, please run the perlbug program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V
, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who will be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.
The Changes file for an explanation of how to view exhaustive details on what changed.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.