PERL5280DELTA(1) | Perl Programmers Reference Guide | PERL5280DELTA(1) |
If you are upgrading from an earlier release such as 5.24.0, first read perl5260delta, which describes differences between 5.24.0 and 5.26.0.
CURRENT NEW SYNONYMS ------ ------------ (?=...) (*pla:...) or (*positive_lookahead:...) (?!...) (*nla:...) or (*negative_lookahead:...) (?<=...) (*plb:...) or (*positive_lookbehind:...) (?<!...) (*nlb:...) or (*negative_lookbehind:...) (?>...) (*atomic:...)
These are considered experimental, so using any of these will raise (unless turned off) a warning in the "experimental::alpha_assertions" category.
qr/(*script_run: \d+ \b )/x
And the digits matched will all be from the same set of 10. You won't get a look-alike digit from a different script that has a different value than what it appears to be.
Or:
qr/(*sr: \b \w+ \b )/x
makes sure that all the characters come from the same script.
You can also combine script runs with "(?>...)" (or "*atomic:...)").
Instead of writing:
(*sr:(?<...))
you can now run:
(*asr:...) # or (*atomic_script_run:...)
This is considered experimental, so using it will raise (unless turned off) a warning in the "experimental::script_run" category.
See "Script Runs" in perlre.
Without backups this would result in loss of data if there was an error, such as a full disk, when writing to the output file.
This has changed so that the input file isn't replaced until the output file has been completely written and successfully closed.
This works by creating a work file in the same directory, which is renamed over the input file once the output file is complete.
Incompatibilities:
[perl #127663] <https://rt.perl.org/Public/Bug/Display.html?id=127663>
Additionally, perl now sets the close-on-exec flag more reliably, whether it does so atomically or not. Most file descriptors were getting the flag set, but some were being missed.
use feature "bitwise"; use v5.28; # "bitwise" now included
They are also now enabled by the -E command-line switch.
The "bitwise" feature no longer emits a warning. Existing code that disables the "experimental::bitwise" warning category that the feature previously used will continue to work.
One caveat that module authors ought to be aware of is that the numeric operators now pass a fifth TRUE argument to overload methods. Any methods that check the number of operands may croak if they do not expect so many. XS authors in particular should be aware that this:
SV * bitop_handler (lobj, robj, swap)
may need to be changed to this:
SV * bitop_handler (lobj, robj, swap, ...)
The implication is that you are now free to use locales and change them in a threaded environment. Your changes affect only your thread. See "Multi-threaded operation" in perllocale
By default Perl is configured to support SBOX hashing of strings up to 24 characters, in conjunction with StadtX hashing on 64 bit builds, and Zaphod32 hashing for 32 bit builds.
You may control these settings with the following options to Configure:
-DPERL_HASH_FUNC_SIPHASH -DPERL_HASH_FUNC_SIPHASH13 -DPERL_HASH_FUNC_STADTX -DPERL_HASH_FUNC_ZAPHOD32
To disable SBOX hashing you can use
-DPERL_HASH_USE_SBOX32_ALSO=0
And to set the maximum length to use SBOX32 hashing on with:
-DSBOX32_MAX_LEN=16
The maximum length allowed is 256. There probably isn't much point in setting it higher than the default.
sub f :lvalue ($a = do { $x = "abc"; return substr($x,0,1)}) { ...}
Note that this the second time they have been flipped:
sub f :lvalue ($a, $b) { ... }; # 5.20; 5.28 onwards sub f ($a, $b) :lvalue { ... }; # 5.22 - 5.26
This was deprecated in Perl 5.24.
... . "foo"; ... if $a < $b;
The parsing has now been made consistent, permitting yada-yada only as a statement. Affected code can use "do{...}" to put a yada-yada into an arbitrary expression context.
That exception is now generalized to include various other such cases where the "{" will not be repurposed.
Note that these uses continue to raise a deprecation message.
The core versions of these modules will now issue "deprecated"-category warnings to alert you to this fact. To silence these deprecation warnings, install the modules in question from CPAN.
Note that these are (with rare exceptions) fine modules that you are encouraged to continue to use. Their disinclusion from core primarily hinges on their necessity to bootstrapping a fully functional, CPAN-capable Perl installation, not usually on concerns over their design.
$s .= "a=$a b=$b\n"
As a special case, if the LHS of an assignment is a lexical variable or "my $s", the op itself handles retrieving the lexical variable, which is faster.
In general, the more the expression includes a mix of constant strings and variable expressions, the longer the expression, and the more it mixes together non-utf8 and utf8 strings, the more marked the performance improvement. For example on a "x86_64" system, this code has been benchmarked running four times faster:
my $s; my $a = "ab\x{100}cde"; my $b = "fghij"; my $c = "\x{101}klmn"; for my $i (1..10_000_000) { $s = "\x{100}wxyz"; $s .= "foo=$a bar=$b baz=$c"; }
In addition, "sprintf" expressions which have a constant format containing only %s and "%%" format elements, and which have a fixed number of arguments, are now also optimised into a "multiconcat" op.
if (index(...) != -1) { ... }
This had a slight effect (for the better) on the output of WARNING_BITS in B::Deparse.
This update also handled CVE-2018-12015: directory traversal vulnerability. [cpan #125523] <https://rt.cpan.org/Ticket/Display.html?id=125523>
NOTE: B::Debug is deprecated and may be removed from a future version of Perl.
It includes many bug fixes, and in particular, it now deparses variable attributes correctly:
my $x :foo; # used to deparse as # 'attributes'->import('main', \$x, 'foo'), my $x;
If a package on the call stack contains a constant named "ISA", Carp no longer throws a "Not a GLOB reference" error.
Carp, when generating stack traces, now attempts to work around longstanding bugs resulting from Perl's non-reference-counted stack. [perl #52610] <https://rt.perl.org/Ticket/Display.html?id=52610>
Carp has been modified to avoid assuming that objects cannot be overloaded without the overload module loaded (this can happen with objects created by XS modules). Previously, infinite recursion would result if an XS-defined overload method itself called Carp. [perl #132828] <https://rt.perl.org/Ticket/Display.html?id=132828>
Carp now avoids using "overload::StrVal", partly because older versions of overload (included with perl 5.14 and earlier) load Scalar::Util at run time, which will fail if Carp has been invoked after a syntax error.
This addresses a security vulnerability in older versions of the 'zlib' library (which is bundled with Compress-Raw-Zlib).
Quoting of glob names now obeys the Useqq option [perl #119831] <https://rt.perl.org/Ticket/Display.html?id=119831>.
Attempts to set an option to "undef" through a combined getter/setter method are no longer mistaken for getter calls [perl #113090] <https://rt.perl.org/Ticket/Display.html?id=113090>.
Devel::PPPort has moved from cpan-first to perl-first maintenance
Primary responsibility for the code in Devel::PPPort has moved into core perl. In a practical sense there should be no change except that hopefully it will stay more up to date with changes made to symbols in perl, rather than needing to be updated after the fact.
Its documentation now shows the use of "__PACKAGE__" and direct object syntax [perl #132247] <https://rt.perl.org/Ticket/Display.html?id=132247>.
It will now use the sub-second precision variant of utime() supplied by Time::HiRes where available. [perl #132401] <https://rt.perl.org/Ticket/Display.html?id=132401>.
Its documentation now explains that "each" and "delete" don't mix in hashes tied to this module [perl #117449] <https://rt.perl.org/Ticket/Display.html?id=117449>.
It will now retry opening with an acceptable block size if asking gdbm to default the block size failed [perl #119623] <https://rt.perl.org/Ticket/Display.html?id=119623>.
This module is now available on all platforms, emulating the system nl_langinfo(3) on systems that lack it. Some caveats apply, as detailed in its documentation, the most severe being that, except for MS Windows, the "CODESET" item is not implemented on those systems, always returning "".
It now sets the UTF-8 flag in its returned scalar if the string contains legal non-ASCII UTF-8, and the locale is UTF-8 [perl #127288] <https://rt.perl.org/Ticket/Display.html?id=127288>.
This update also fixes a bug in which the underlying locale was ignored for the "RADIXCHAR" (always was returned as a dot) and the "THOUSEP" (always empty). Now the locale-appropriate values are returned.
NOTE: Locale::Codes scheduled to be removed from core in Perl 5.30.
A title for the HTML document will now be automatically generated by default from a "NAME" section in the POD document, as it used to be before the module was rewritten to use Pod::Simple::XHTML to do the core of its job [perl #110520] <https://rt.perl.org/Ticket/Display.html?id=110520>.
Man page references and function names now follow the Linux man page formatting standards, instead of the Solaris standard.
Some more cautions were added about using locale-specific functions in threaded applications.
The documentation now better describes the problems that arise when returning values from threads, and no longer warns about creating threads in "BEGIN" blocks. [perl #96538] <https://rt.perl.org/Ticket/Display.html?id=96538>
The function "num" now accepts an optional parameter to help in diagnosing error returns.
It now includes new functions with names ending in "_at_level", allowing callers to specify the exact call frame. [perl #132468] <https://rt.perl.org/Ticket/Display.html?id=132468>
Its documentation now shows the use of "__PACKAGE__", and direct object syntax for example "DynaLoader" usage [perl #132247] <https://rt.perl.org/Ticket/Display.html?id=132247>.
Platforms that use "mod2fname" to edit the names of loadable libraries now look for bootstrap (.bs) files under the correct, non-edited name.
Additionally, the following selected changes have been made:
perlapi
perldata
perldebguts
perldiag
This now gives more ideas as to workarounds to the issue that was introduced in Perl 5.18 (but not documented explicitly in its perldelta) for the fact that some Unicode "/i" rules cause a few sequences such as
(?<!st)
to be considered variable length, and hence disallowed.
This entry has been removed, as the experimental support of this construct was removed in perl 5.24.0.
perlembed
This has been changed to a call to croak_sv().
An alternative could have been to supply a trivial format string:
croak("%s", SvPV_nolen(ERRSV));
or as a special case for "ERRSV" simply:
croak(NULL);
perlfunc
require Foo::Bar; require "Foo/Bar.pm";
perlgit
perlguts
perlintern
perlobj
perlop
perlrequick
perlretut
perlrun
perlsec
perlsyn
perluniprops
perlvar
perlfunc, perlop, perlsyn
(F) A "goto" statement was executed to jump into the middle of a "given" block. You can't get there from here. See "goto" in perlfunc.
Use of "goto" to jump into the parameter of a binary or list operator has been prohibited, to prevent crashes and stack corruption. [perl #130936] <https://rt.perl.org/Ticket/Display.html?id=130936>
You may only enter the first argument of an operator that takes a fixed number of arguments, since this is a case that will not cause stack corruption. [perl #132854] <https://rt.perl.org/Ticket/Display.html?id=132854>
New Warnings
(W syntax) You used the old package separator, "'", in a variable named inside a double-quoted string; e.g., "In $name's house". This is equivalent to "In $name::s house". If you meant the former, put a backslash before the apostrophe ("In $name\'s house").
Perl has been documented as requiring a C89 compiler to build since October 1998. A variety of simplifications have now been made to Perl's internals to rely on the features specified by the C89 standard. We believe that this internal change hasn't altered the set of platforms that Perl builds on, but please report a bug if Perl now has new problems building on your platform.
regen/mk_invlists.pl, unlike the other regen/*.pl scripts, used $0 to name itself in the dependencies stored in the files it generates. It now uses a literal so that the path stored in the generated files doesn't depend on how regen/mk_invlists.pl is invoked.
This lack of canonical names could cause test failures in t/porting/regen.t. [perl #132925] <https://rt.perl.org/Ticket/Display.html?id=132925>
This test can take a long time to run, so there is a timer to keep this in check (currently, 5 minutes). This commit adds checking the environment variable "PERL_TEST_TIME_OUT_FACTOR"; if set, the time out setting is multiplied by its value.
CRTL features can now be set by embedders before invoking Perl by using the "decc$feature_set" and "decc$feature_set_value" functions. Previously any attempt to set features after image initialization were ignored.
my $x = "foo=$foo, bar=$bar\n";
the constant string would be "foo=, bar=\n" and the segment lengths would be (4,6,1). If the string contains characters such as "\x80", whose representation changes under utf8, two sets of strings plus lengths are precomputed and stored.
By adding
#define PERL_REENTRANT
near the beginning of an "XS" file, it will be compiled so that whatever reentrant functions perl knows about on that system will automatically and invisibly be used instead of the plain, non-reentrant versions. For example, if you write "getpwnam()" in your code, on a system that has "getpwnam_r()" all calls to the former will be translated invisibly into the latter. This does not happen except on threaded perls, as they aren't needed otherwise. Be aware that which functions have reentrant versions varies from system to system.
It partially fixes the rare bug of deferred elements getting out of synch with their arrays when the array is shifted or unshifted. [perl #132729] <https://rt.perl.org/Ticket/Display.html?id=132729>
These internal stack usage checks introduced are also done by the "entersub" operator when calling XSUBs. This means we can report which XSUB failed to allocate enough stack space. [perl #131975] <https://rt.perl.org/Public/Bug/Display.html?id=131975>
sub DESTROY { eval { die "died in DESTROY"; } } eval { bless []; }; # $@ used to be equal to "died in DESTROY" here; it's now "".
Previously compilation could continue in order to report other errors, but the failed sub-parse could leave partly parsed constructs on the parser shift-reduce stack, confusing the parser, leading to perl crashes. [perl #125351] <https://rt.perl.org/Ticket/Display.html?id=125351>
Excluding auto-generated files, documentation and release tools, there were approximately 580,000 lines of changes to 1,300 .pm, .t, .c and .h files.
Perl continues to flourish into its fourth decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.28.0:
Aaron Crane, Abigail, AEvar Arnfjoerd` Bjarmason, Alberto Simo~es, Alexandr Savca, Andrew Fresh, Andy Dougherty, Andy Lester, Aristotle Pagaltzis, Ask Bjorn Hansen, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari Mannsaaker, Dan Collins, Daniel Dragan, David Cantrell, David Mitchell, Dmitry Ulanov, Dominic Hargreaves, E. Choroba, Eric Herman, Eugen Konkov, Father Chrysostomos, Gene Sullivan, George Hartzell, Graham Knop, Harald Joerg, H.Merijn Brand, Hugo van der Sanden, Jacques Germishuys, James E Keenan, Jarkko Hietaniemi, Jerry D. Hedden, J. Nick Koston, John Lightsey, John Peacock, John P. Linderman, John SJ Anderson, Karen Etheridge, Karl Williamson, Ken Brown, Ken Cotterill, Leon Timmermans, Lukas Mai, Marco Fontani, Marc-Philip Werner, Matthew Horsfall, Neil Bowers, Nicholas Clark, Nicolas R., Niko Tyni, Pali, Paul Marquess, Peter John Acklam, Reini Urban, Renee Baecker, Ricardo Signes, Robin Barker, Sawyer X, Scott Lanning, Sergey Aleynikov, Shirakata Kentaro, Shoichi Kaji, Slaven Rezic, Smylers, Steffen Mueller, Steve Hay, Sullivan Beck, Thomas Sibley, Todd Rinaldo, Tomasz Konojacki, Tom Hukins, Tom Wyant, Tony Cook, Vitali Peil, Yves Orton, Zefram.
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 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 see "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec for details of how to report the issue.
perlthanks
This will send an email to the Perl 5 Porters list with your show of thanks.
The INSTALL file for how to build Perl.
The README file for general stuff.
The Artistic and Copying files for copyright information.
2019-10-21 | perl v5.30.3 |