PERL5280DELTA(1perl)
π perl5280delta β like, what even is new in perl v5.28.0 π
okay bestie, gather round, because this is perl5280delta, the tea on everything that changed between the 5.26.0 release and the 5.28.0 release. it's giving "changelog but make it fashion". π¦
πΈ DESCRIPTION πΈ
so this doc spills ALL the differences between 5.26.0 and 5.28.0. no gatekeeping.
and if you're upgrading from something even more ancient, like 5.24.0, bestie you gotta go read perl5260delta first β that one covers 5.24.0 to 5.26.0, and you don't wanna skip a step. it's a whole journey, not a sprint. π«Ά
β¨ Core Enhancements β¨
π Unicode 10.0 is supported
the whole list of what changed lives at <http://www.unicode.org/versions/Unicode10.0.0>. icon behavior honestly.
π delete on key/value hash slices
you can now use delete on key/value hash slices, and it hands you back the keys along with the deleted values. obsessed. [GH #15982] <https://github.com/Perl/perl5/issues/15982>
π Experimentally, there are now alphabetic synonyms for some regular expression assertions
ok so if you're out here struggling to remember how to write certain pattern assertions β same, honestly β there are now alphabetic synonyms. your brain can finally breathe.
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 them will raise a warning (unless you turn it off) in the experimental::alpha_assertions category.
π Mixed Unicode scripts are now detectable
a mix of scripts in one string β like Cyrillic and Latin chillin' together β is often the sign of a spoofing attack. π and there's a brand-new regular expression construct that makes detecting these easy-peasy. for example, you can say
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. the scam is officially cancelled.
or:
qr/(*sr: \b \w+ \b )/x
which makes sure that all the characters come from the same script.
you can also combine script runs with (?>...) (or *atomic:...)).
so instead of writing:
(*sr:(?<...))
you can now run:
(*asr:...)
# or
(*atomic_script_run:...)
this is considered experimental, so using it will raise a warning (unless turned off) in the experimental::script_run category.
see "Script Runs" in perlre.
π In-place editing with perl -i is now safer
previously, in-place editing (perl -i) would delete or rename the input file the second you started working on a new file. rude, honestly.
without backups, that would result in loss of data if there was an error β like, say, 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.
how does it work? it creates a work file in the same directory, which gets renamed over the input file once the output file is complete. slay.
Incompatibilities:
- since this renaming needs to only happen once, if you create a thread or child process, that renaming will only happen in the original thread or process.
- if you change directories while processing a file, and your operating system doesn't provide the
unlinkat(),renameat()andfchmodat()functions, the final rename step may fail.
[GH #15216] <https://github.com/Perl/perl5/issues/15216>
π Initialisation of aggregate state variables
a persistent lexical array or hash variable can now be initialized, with an expression like state @a = qw(x y z). but heads up: initialization of a list of persistent lexical variables is still not possible. one thing at a time, we're not miracle workers. β¨
π Full-size inode numbers
on platforms where inode numbers are of a type larger than perl's native integer numerical types, stat will preserve the full content of large inode numbers by returning them in the form of strings of decimal digits. so exact comparison of inode numbers can be achieved by comparing with eq rather than ==. comparison with ==, and other numerical operations (which are usually meaningless on inode numbers, ngl), work as well as they did before β which is to say they fall back to floating point, and ultimately operate on a fairly useless rounded inode number if the real inode number is too big for the floating point format. π
π The sprintf %j format size modifier is now available with pre-C99 compilers
the actual size used depends on the platform, so it remains unportable. that's just how it is, bestie.
π Close-on-exec flag set atomically
when opening a file descriptor, perl now generally opens it with its close-on-exec flag already set, on platforms that support doing so. this improves thread safety, because it means an exec initiated by one thread can no longer cause a file descriptor in the process of being opened by another thread to be accidentally passed to the executed program. no accidental leaks, periodt.
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. not anymore. π
π String- and number-specific bitwise ops are no longer experimental
the new string-specific (&. |. ^. ~.) and number-specific (& | ^ ~) bitwise operators introduced in Perl 5.22 β the ones available within the scope of use feature 'bitwise' β are no longer experimental. they've graduated. π
because the number-specific ops are spelled the same way as the existing operators that choose their behaviour based on their operands, these operators must still be enabled via the bitwise feature, in either of these two ways:
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. your old code is safe, don't stress. π«Ά
one caveat that module authors ought to be aware of: 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, ...)
read that twice. it's important. π
π Locales are now thread-safe on systems that support them
these systems include Windows starting with Visual Studio 2005, and in POSIX 2008 systems.
the implication is that you are now free to use locales and change them in a threaded environment. your changes affect only your thread. main character energy, honestly. see "Multi-threaded operation" in perllocale.
π New read-only predefined variable ${^SAFE_LOCALES}
this variable is 1 if the Perl interpreter is operating in an environment where it is safe to use and change locales (see perllocale.) this variable is true when the perl is unthreaded, or compiled in a platform that supports thread-safe locale operation (see previous item). cute, useful, lowkey underrated. π
π₯ Security π₯
π₯ [CVE-2017-12837] Heap buffer overflow in regular expression compiler
compiling certain regular expression patterns with the case-insensitive modifier could cause a heap buffer overflow and crash perl. this has now been fixed. [GH #16021] <https://github.com/Perl/perl5/issues/16021>
π₯ [CVE-2017-12883] Buffer over-read in regular expression parser
for certain types of syntax error in a regular expression pattern, the error message could either contain the contents of a random, possibly large, chunk of memory, or could crash perl. this has now been fixed. [GH #16025] <https://github.com/Perl/perl5/issues/16025>
π₯ [CVE-2017-12814] $ENV{$key} stack buffer overflow on Windows
a possible stack buffer overflow in the %ENV code on Windows has been fixed by removing the buffer completely, since it was superfluous anyway. bye buffer, you will not be missed. [GH #16051] <https://github.com/Perl/perl5/issues/16051>
π₯ Default Hash Function Change
Perl 5.28.0 retires various older hash functions which are not viewed as sufficiently secure for use in Perl. we now support four general purpose hash functions: Siphash (2-4 and 1-3 variants), and Zaphod32, and StadtX hash. in addition we support SBOX32 (a form of tabular hashing) for hashing short strings, in conjunction with any of the other hash functions provided.
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. fr fr. β¨
okay that's part 1 bestie, we are SO not done yet β more delta incoming ππ
π₯ INCOMPATIBLE CHANGES π₯
ok so this is the "we changed stuff and your old code might side-eye you" section. buckle up bestie, it's a long one π«
π Subroutine attribute and signature order
The experimental subroutine signatures feature got flipped: attributes now have to come before the signature, not after. why? because attributes like :lvalue can mess with how the code inside the signature compiles, like:
sub f :lvalue ($a = do { $x = "abc"; return substr($x,0,1)}) { ...}
and yeah, this is literally the second time they've swapped it, so if you're dizzy, that's why, no cap:
sub f :lvalue ($a, $b) { ... }; # 5.20; 5.28 onwards
sub f ($a, $b) :lvalue { ... }; # 5.22 - 5.26
π« Comma-less variable lists in formats are no longer allowed
You can't leave out the commas between variables passed to formats anymore. this has been deprecated since Perl 5.000, so honestly it had a good run π
ποΈ The :locked and :unique attributes have been removed
gone, bestie. they've been no-ops and deprecated since Perl 5.12 and 5.10, respectively. rip πͺ¦
πΈ \N{} with nothing between the braces is now illegal
deprecated since Perl 5.24, now it's just illegal. the empty braces era is over π
π Opening the same symbol as both a file and directory handle is no longer allowed
Using open() and opendir() to attach both a filehandle and a dirhandle to the same symbol (glob or scalar) has been deprecated since Perl 5.10. one symbol, one job, periodt β
π¦ Use of bare << to mean <<"" is no longer allowed
the bare terminator has been deprecated since Perl 5.000. it's giving ancient. it's not giving anymore π
π Setting $/ to a reference to a non-positive integer no longer allowed
this used to behave like setting it to undef, but that's been deprecated since Perl 5.20. no more sneaky shortcut for you β¨
π₯ Unicode code points with values exceeding IV_MAX are now fatal
deprecated since Perl 5.24. now it's a hard stop, not a vibe π
π The B::OP::terse method has been removed
use B::Concise::b_terse instead. that's the whole note. swapping one for the other, slay β¨
π§ Use of inherited AUTOLOAD for non-methods is no longer allowed
deprecated in Perl 5.004. yeah, 5.004. that's how long this has been on notice π
β‘ Use of strings with code points over 0xFF is not allowed for bitwise string operators
Code points over 0xFF do not make sense for bitwise operators, and this kind of operation will now croak, except for a few remaining cases. check perldeprecation for the sexy details.
deprecated in Perl 5.24. π
π Setting ${^ENCODING} to a defined value is now illegal
deprecated since Perl 5.22, and a total no-op since Perl 5.26. it's giving ghost town π»
π€οΈ Backslash no longer escapes colon in PATH for the -S switch
Previously the -S switch incorrectly treated backslash (\) as an escape for colon when traversing the PATH environment variable. [GH #15584] https://github.com/Perl/perl5/issues/15584
ok so it was wrong before, and now it's right. we love growth π
π the -DH (DEBUG_H) misfeature has been removed
On a perl built with debugging support, the H flag to the -D debugging option has been removed. it was supposed to dump hash values, but it's been broken for many years. not me mourning a feature that never worked π
π Yada-yada is now strictly a statement
By the time of its initial stable release in Perl 5.12, the ... (yada-yada) operator was explicitly intended to serve as a statement, not an expression. but the original implementation got confused on this point, which led to inconsistent parsing. the operator was accidentally accepted in a few situations where it didn't serve as a complete statement, like:
... . "foo";
... if $a < $b;
The parsing is now consistent, permitting yada-yada only as a statement. If your code is affected, you can use do{...} to put a yada-yada into an arbitrary expression context. main character gets one role and one role only π
π’ Sort algorithm can no longer be specified
Since Perl 5.8, the sort pragma has had subpragmata _mergesort, _quicksort, and _qsort that let you pick which algorithm perl uses to implement the sort builtin. this was always considered a dubious feature that might not last β hence the underscore spellings β and they were documented as not being portable beyond Perl 5.8. These subpragmata have now been deleted, and any attempt to use them is an error. The sort pragma otherwise remains, and the algorithm-neutral stable subpragma can be used to control sorting behaviour. [GH #13234] https://github.com/Perl/perl5/issues/13234
ngl the underscores were the warning sign and we all ignored them π
π¬ Over-radix digits in floating point literals
Octal and binary floating point literals used to permit any hexadecimal digit to appear after the radix point. Now the digits are restricted to those appropriate for the radix, same as the digits before the radix point always were. consistency is hot β¨
π Return type of unpackstring()
The return types of the C API functions unpackstring() and unpack_str() have changed from I32 to SSize_t, so they can handle datasets of more than two billion items. glow up for big data π
π¬ DEPRECATIONS π¬
this is the "we're telling you now so you're not shocked later" section. consider this your group chat warning π«Ά
π― Use of vec on strings with code points above 0xFF is deprecated
Such strings are represented internally in UTF-8, and vec is a bit-oriented operation that will likely give you unexpected results on those strings. so like, technically it runs, but the answers are lies π
π Some uses of unescaped { in regexes are no longer fatal
Perl 5.26.0 fatalized some uses of an unescaped left brace, but an exception was made at the last minute β specifically crafted to be a minimal change to allow GNU Autoconf to work. That tool is heavily depended upon, and continues to use the deprecated usage. Its use of an unescaped left brace is one where we have no intention of repurposing { to be something other than itself.
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. so it's legal but it's still getting read for filth π’
π¨ Use of unescaped { immediately after a ( in regular expression patterns is deprecated
Using unescaped left braces is officially deprecated everywhere, but it's not enforced in contexts where their use doesn't interfere with expected extensions to the language. A deprecation is added in this release when the brace appears immediately after an opening parenthesis. Before this, even if the brace was part of a legal quantifier, it was not interpreted as such β it was read as the literal characters, unlike other quantifiers that follow a ( which are considered errors. Now, their use will raise a deprecation message, unless turned off.
so like... fix it, or mute it, your call bestie π
β³ Assignment to $[ will be fatal in Perl 5.30
Assigning a non-zero value to $[ has been deprecated since Perl 5.12, but was never given a deadline for removal. That has now been scheduled for Perl 5.30. the countdown is real, put it in your calendar π
π hostname() won't accept arguments in Perl 5.32
Passing arguments to Sys::Hostname::hostname() was already deprecated, but didn't have a removal date. It's now scheduled for Perl 5.32. [GH #14662] https://github.com/Perl/perl5/issues/14662
π¦ Module removals
The following modules will be removed from the core distribution in a future release, and will at that time need to be installed from CPAN. Distributions on CPAN which require these modules will need to list them as prerequisites.
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.
- B::Debug
- Locale::Codes and its associated Country, Currency and Language modules
ok so they're not bad modules, they're just not load-bearing for bootstrapping. no drama, just paperwork π
π PERFORMANCE ENHANCEMENTS π
the part where perl does the same stuff but faster and we all cheer π₯
- The start up overhead for creating regular expression patterns with Unicode properties (
\p{...}) has been greatly reduced in most cases. - Many string concatenation expressions are now considerably faster, thanks to the introduction internally of a
multiconcatopcode which combines multiple concatenations, and optionally a=or.=, into a single action. For example, apart from retrieving$s,$aand$b, this whole expression is now handled as a single op:
$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.
- The
ref()builtin is now much faster in boolean context, since it no longer bothers to construct a temporary string likeFoo=ARRAY(0x134af48). keys()in void and scalar contexts is now more efficient.- The common idiom of comparing the result of
index()with -1 is now specifically optimised, e.g.
if (index(...) != -1) { ... }
for()loops and similar constructs are now more efficient in most cases.- File::Glob has been modified to remove unnecessary backtracking and recursion, thanks to Russ Cox. See
https://research.swtch.com/globfor more details. - The XS-level
SvTRUE()API function is now more efficient. - Various integer-returning ops are now more efficient in scalar/boolean context.
- Slightly improved performance when parsing stash names. [GH #15689]
https://github.com/Perl/perl5/issues/15689 - Calls to
requirefor an already loaded module are now slightly faster. [GH #16175]https://github.com/Perl/perl5/issues/16175 - The performance of pattern matching
[[:ascii:]]and[[:^ascii:]]has been improved significantly except on EBCDIC platforms. - Various optimizations have been applied to matching regular expression patterns, so under the right circumstances, significant performance gains may be noticed. But in an application with many varied patterns, little overall improvement likely will be seen. (real ones know this is the "results may vary" bullet π)
- Other optimizations have been applied to UTF-8 handling, but these are not typically a major factor in most applications.
π¦ MODULES AND PRAGMATA π¦
Key highlights in this release across several modules: β¨
πͺ¦ Removal of use vars
The usage of use vars has been discouraged since the introduction of our in Perl 5.6.0. Where possible the usage of this pragma has now been removed from the Perl source code.
This had a slight effect (for the better) on the output of WARNING_BITS in B::Deparse.
ok so our won, as it should π
β¨ Use of DynaLoader changed to XSLoader in many modules β¨
Okay so besties, here's the tea: XSLoader is the more modern one, and like, basically every module out here already requires perl 5.6 or greater anyway, so switching over loses you literally nothing in the functionality department. In some cases the local implementation got tweaked too, and those tweaks might not show up in the CPAN version because the goal was to keep more backwards compatibility. Slay. π
π¦ Updated Modules and Pragmata π¦
Archive::Tarhas been upgraded from version 2.24 to 2.30.- This update also handled CVE-2018-12015: directory traversal vulnerability. [cpan #125523]
https://rt.cpan.org/Ticket/Display.html?id=125523
- This update also handled CVE-2018-12015: directory traversal vulnerability. [cpan #125523]
arybasehas been upgraded from version 0.12 to 0.15.Attribute::Handlershas been upgraded from version 0.99 to 1.01.attributeshas been upgraded from version 0.29 to 0.33.Bhas been upgraded from version 1.68 to 1.74.B::Concisehas been upgraded from version 0.999 to 1.003.B::Debughas been upgraded from version 1.24 to 1.26.- NOTE:
B::Debugis deprecated and may be removed from a future version of Perl.
- NOTE:
B::Deparsehas been upgraded from version 1.40 to 1.48.- 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;
basehas been upgraded from version 2.25 to 2.27.bignumhas been upgraded from version 0.47 to 0.49.blibhas been upgraded from version 1.06 to 1.07.byteshas been upgraded from version 1.05 to 1.06.Carphas been upgraded from version 1.42 to 1.50.- 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. [GH #9282]
https://github.com/Perl/perl5/issues/9282 - 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. [GH #16407]
https://github.com/Perl/perl5/issues/16407 - 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.
- If a package on the call stack contains a constant named
charnameshas been upgraded from version 1.44 to 1.45.Compress::Raw::Zlibhas been upgraded from version 2.074 to 2.076.- This addresses a security vulnerability in older versions of the 'zlib' library (which is bundled with Compress-Raw-Zlib).
Config::Extensionshas been upgraded from version 0.01 to 0.02.Config::Perl::Vhas been upgraded from version 0.28 to 0.29.CPANhas been upgraded from version 2.18 to 2.20.Data::Dumperhas been upgraded from version 2.167 to 2.170.- Quoting of glob names now obeys the Useqq option [GH #13274]
https://github.com/Perl/perl5/issues/13274. - Attempts to set an option to
"undef"through a combined getter/setter method are no longer mistaken for getter calls [GH #12135]https://github.com/Perl/perl5/issues/12135.
- Quoting of glob names now obeys the Useqq option [GH #13274]
Devel::Peekhas been upgraded from version 1.26 to 1.27.Devel::PPPorthas been upgraded from version 3.35 to 3.40.- 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.
Digest::SHAhas been upgraded from version 5.96 to 6.01.DirHandlehas been upgraded from version 1.04 to 1.05.DynaLoaderhas been upgraded from version 1.42 to 1.45.- Its documentation now shows the use of
"__PACKAGE__"and direct object syntax [GH #16190]https://github.com/Perl/perl5/issues/16190.
- Its documentation now shows the use of
Encodehas been upgraded from version 2.88 to 2.97.encodinghas been upgraded from version 2.19 to 2.22.Errnohas been upgraded from version 1.28 to 1.29.experimentalhas been upgraded from version 0.016 to 0.019.Exporterhas been upgraded from version 5.72 to 5.73.ExtUtils::CBuilderhas been upgraded from version 0.280225 to 0.280230.ExtUtils::Constanthas been upgraded from version 0.23 to 0.25.ExtUtils::Embedhas been upgraded from version 1.34 to 1.35.ExtUtils::Installhas been upgraded from version 2.04 to 2.14.ExtUtils::MakeMakerhas been upgraded from version 7.24 to 7.34.ExtUtils::Miniperlhas been upgraded from version 1.06 to 1.08.ExtUtils::ParseXShas been upgraded from version 3.34 to 3.39.ExtUtils::Typemapshas been upgraded from version 3.34 to 3.38.ExtUtils::XSSymSethas been upgraded from version 1.3 to 1.4.featurehas been upgraded from version 1.47 to 1.52.fieldshas been upgraded from version 2.23 to 2.24.File::Copyhas been upgraded from version 2.32 to 2.33.- It will now use the sub-second precision variant of
utime()supplied by Time::HiRes where available. [GH #16225]https://github.com/Perl/perl5/issues/16225.
- It will now use the sub-second precision variant of
File::Fetchhas been upgraded from version 0.52 to 0.56.File::Globhas been upgraded from version 1.28 to 1.31.File::Pathhas been upgraded from version 2.12_01 to 2.15.File::SpecandCwdhave been upgraded from version 3.67 to 3.74.File::stathas been upgraded from version 1.07 to 1.08.FileCachehas been upgraded from version 1.09 to 1.10.Filter::Simplehas been upgraded from version 0.93 to 0.95.Filter::Util::Callhas been upgraded from version 1.55 to 1.58.GDBM_Filehas been upgraded from version 1.15 to 1.17.- Its documentation now explains that
"each"and"delete"don't mix in hashes tied to this module [GH #12894]https://github.com/Perl/perl5/issues/12894. - It will now retry opening with an acceptable block size if asking gdbm to default the block size failed [GH #13232]
https://github.com/Perl/perl5/issues/13232.
- Its documentation now explains that
Getopt::Longhas been upgraded from version 2.49 to 2.5.Hash::Util::FieldHashhas been upgraded from version 1.19 to 1.20.I18N::Langinfohas been upgraded from version 0.13 to 0.17.- 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 [GH #15131]
https://github.com/Perl/perl5/issues/15131. - 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.
- This module is now available on all platforms, emulating the system
I18N::LangTagshas been upgraded from version 0.42 to 0.43.ifhas been upgraded from version 0.0606 to 0.0608.IOhas been upgraded from version 1.38 to 1.39.IO::Socket::IPhas been upgraded from version 0.38 to 0.39.IPC::Cmdhas been upgraded from version 0.96 to 1.00.JSON::PPhas been upgraded from version 2.27400_02 to 2.97001.- The
"libnet"distribution has been upgraded from version 3.10 to 3.11. List::Utilhas been upgraded from version 1.46_02 to 1.49.Locale::Codeshas been upgraded from version 3.42 to 3.56.- NOTE: Locale::Codes scheduled to be removed from core in Perl 5.30.
Locale::Maketexthas been upgraded from version 1.28 to 1.29.Math::BigInthas been upgraded from version 1.999806 to 1.999811.Math::BigInt::FastCalchas been upgraded from version 0.5005 to 0.5006.Math::BigRathas been upgraded from version 0.2611 to 0.2613.Module::CoreListhas been upgraded from version 5.20170530 to 5.20180622.mrohas been upgraded from version 1.20 to 1.22.Net::Pinghas been upgraded from version 2.55 to 2.62.NEXThas been upgraded from version 0.67 to 0.67_01.ODBM_Filehas been upgraded from version 1.14 to 1.15.Opcodehas been upgraded from version 1.39 to 1.43.overloadhas been upgraded from version 1.28 to 1.30.PerlIO::encodinghas been upgraded from version 0.25 to 0.26.PerlIO::scalarhas been upgraded from version 0.26 to 0.29.PerlIO::viahas been upgraded from version 0.16 to 0.17.Pod::Functionshas been upgraded from version 1.11 to 1.13.Pod::Htmlhas been upgraded from version 1.2202 to 1.24.- 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 [GH #11954]https://github.com/Perl/perl5/issues/11954.
- A title for the HTML document will now be automatically generated by default from a
Pod::Perldochas been upgraded from version 3.28 to 3.2801.- The
"podlators"distribution has been upgraded from version 4.09 to 4.10.- Man page references and function names now follow the Linux man page formatting standards, instead of the Solaris standard.
POSIXhas been upgraded from version 1.76 to 1.84.- Some more cautions were added about using locale-specific functions in threaded applications.
rehas been upgraded from version 0.34 to 0.36.Scalar::Utilhas been upgraded from version 1.46_02 to 1.50.SelfLoaderhas been upgraded from version 1.23 to 1.25.Sockethas been upgraded from version 2.020_03 to 2.027.sorthas been upgraded from version 2.02 to 2.04.Storablehas been upgraded from version 2.62 to 3.08.Sub::Utilhas been upgraded from version 1.48 to 1.49.subshas been upgraded from version 1.02 to 1.03.Sys::Hostnamehas been upgraded from version 1.20 to 1.22.Term::ReadLinehas been upgraded from version 1.16 to 1.17.Testhas been upgraded from version 1.30 to 1.31.Test::Harnesshas been upgraded from version 3.38 to 3.42.Test::Simplehas been upgraded from version 1.302073 to 1.302133.threadshas been upgraded from version 2.15 to 2.22.
Also, bestie, about threads: the docs now do a way better job describing the problems that pop up when you return values from threads, and they've stopped nagging about creating threads inside BEGIN blocks. π
[GH #11563] <https://github.com/Perl/perl5/issues/11563>
threads::sharedβ glow-up from version 1.56 to 1.58. β¨Tie::Arrayβ glow-up from version 1.06 to 1.07.Tie::StdHandleβ glow-up from version 4.4 to 4.5.Time::gmtimeβ glow-up from version 1.03 to 1.04.Time::HiResβ glow-up from version 1.9741 to 1.9759.Time::localtimeβ glow-up from version 1.02 to 1.03.Time::Pieceβ glow-up from version 1.31 to 1.3204.Unicode::Collateβ glow-up from version 1.19 to 1.25.Unicode::Normalizeβ glow-up from version 1.25 to 1.26.Unicode::UCDβ glow-up from version 0.68 to 0.70.
And the num function now takes an optional parameter that helps you figure out what went wrong on error returns. π
User::grentβ glow-up from version 1.01 to 1.02.User::pwentβ glow-up from version 1.00 to 1.01.utf8β glow-up from version 1.19 to 1.21.varsβ glow-up from version 1.03 to 1.04.versionβ glow-up from version 0.9917 to 0.9923.VMS::DCLsymβ glow-up from version 1.08 to 1.09.VMS::Stdioβ glow-up from version 2.41 to 2.44.warningsβ glow-up from version 1.37 to 1.42.
It's got brand new functions with names ending in _at_level, so whoever's calling them can name the exact call frame they mean. [GH #16257] <https://github.com/Perl/perl5/issues/16257> π―
XS::Typemapβ glow-up from version 0.15 to 0.16.XSLoaderβ glow-up from version 0.27 to 0.30.
Its docs now show off __PACKAGE__, plus the direct object syntax for demonstrating DynaLoader usage. [GH #16190] <https://github.com/Perl/perl5/issues/16190>
And platforms that use mod2fname to edit the names of loadable libraries now go looking for bootstrap (.bs) files under the correct, non-edited name. π
π Removed Modules and Pragmata π
- The
VMS::stdiocompatibility shim? Yeah, it's gone. Poof. π
π Documentation π
Changes to Existing Documentation
We tried to update the docs so they actually match all the changes listed in this document. If you catch one we missed, be a doll and send email to perlbug@perl.org <mailto:perlbug@perl.org>. π«Ά
On top of that, here are the selected changes that got made:
perlapi
- The API functions
perl_parse(),perl_run(), andperl_destruct()are now documented comprehensively β before this, the only documentation was basically "go read the perlembed tutorial", which is giving "figure it out yourself bestie". Not anymore. π - The documentation of
newGIVENOP()got belatedly updated to account for the removal of lexical$_. - The API functions
newCONSTSUB()andnewCONSTSUB_flags()are documented much more comprehensively than before. π
perldata
- The section "Truth and Falsehood" in perlsyn has been moved into perldata.
perldebguts
- The description of the conditions under which
DB::sub()will be called has been clarified. [GH #16055] <https://github.com/Perl/perl5/issues/16055>
perldiag
"Variable length lookbehind not implemented in regex m/%s/"in perldiag
This now hands you more ideas for workarounds to the issue introduced back in Perl 5.18 (which, real talk, was never documented explicitly in its perldelta) β the fact that some Unicode /i rules cause a few sequences such as
(?<!st)
to be considered variable length, and therefore disallowed. π
"Use of state $_ is experimental"in perldiag
This entry has been removed, because the experimental support of this construct got removed all the way back in perl 5.24.0. bye boo π
- The diagnostic
"Initialization of state variables in list context currently forbidden"has changed to"Initialization of state variables in list currently forbidden", because list-context initialization of single aggregate state variables is now permitted. slay π₯
perlembed
- The examples in perlembed have been made more portable in the way they exit, and the example that gets an exit code from the embedded Perl interpreter now gets it from the right place. The examples that pass a constructed argv to Perl now show the mandatory null
argv[argc]. β - An example in perlembed used the string value of
ERRSVas a format string when callingcroak(). If that string contains format codes such as%sthis could crash the program. π
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
- There's now a note that warnings generated by built-in functions are documented in perldiag and warnings. [GH #12642] <https://github.com/Perl/perl5/issues/12642>
- The documentation for the
existsoperator no longer says that autovivification behaviour "may be fixed in a future release". We've determined that we're not going to change the default behaviour. It's giving settled. periodt. [GH #15231] <https://github.com/Perl/perl5/issues/15231> - A couple of small details in the documentation for the
blessoperator have been clarified. [GH #14684] <https://github.com/Perl/perl5/issues/14684> - The description of
@INChooks in the documentation forrequirehas been corrected to say that filter subroutines receive a useless first argument. [GH #12569] <https://github.com/Perl/perl5/issues/12569> - The documentation of
refhas been rewritten for clarity. β¨ - The documentation of
usenow explains what syntactically qualifies as a version number for its module version checking feature. - The documentation of
warnhas been updated to reflect that since Perl 5.14 it has treated complex exception objects in a manner equivalent todie. [GH #13641] <https://github.com/Perl/perl5/issues/13641> - The documentation of
dieandwarnhas been revised for clarity. - The documentation of
eachhas been improved, with a slightly more explicit description of the sharing of iterator state, and with caveats regarding the fragility of while-each loops. β οΈ [GH #16334] <https://github.com/Perl/perl5/issues/16334> - Clarification to
requirewas added to explain the differences between
require Foo::Bar;
require "Foo/Bar.pm";
perlgit
- The precise rules for identifying "smoke-me" branches are now stated. π₯
perlguts
- The section on reference counting in perlguts has been heavily revised, so it describes references the way a programmer actually needs to think about them, instead of in terms of the physical data structures. π§ β¨
- Improve documentation related to UTF-8 multibytes.
perlintern
- The internal functions
newXS_len_flags()andnewATTRSUB_x()are now documented.
perlobj
- The documentation about
DESTROYmethods has been corrected, updated, and revised, especially in regard to how they interact with exceptions. [GH #14083] <https://github.com/Perl/perl5/issues/14083>
perlop
- The description of the
xoperator in perlop has been clarified. [GH #16253] <https://github.com/Perl/perl5/issues/16253> - perlop has been updated to note that
qw's whitespace rules differ from that ofsplit's, in that only ASCII whitespace is used. - The general explanation of operator precedence and associativity has been corrected and clarified. [GH #15153] <https://github.com/Perl/perl5/issues/15153>
- The documentation for the
\referencing operator now explains the unusual context that it supplies to its operand. [GH #15932] <https://github.com/Perl/perl5/issues/15932>
perlrequick
- Clarifications on metacharacters and character classes. π
perlretut
- Clarify metacharacters.
perlrun
- Clarify the differences between
-Mand-m. [GH #15998] <https://github.com/Perl/perl5/issues/15998>
perlsec
- The documentation about set-id scripts has been updated and revised. [GH #10289] <https://github.com/Perl/perl5/issues/10289>
- A section about using
sudoto run Perl scripts has been added. π
perlsyn
- The section "Truth and Falsehood" in perlsyn has been removed from that document, where it didn't belong, and merged into the existing paragraph on the same topic in perldata.
- The means to disambiguate between code blocks and hash constructors, already documented in perlref, are now documented in perlsyn too. [GH #15918] <https://github.com/Perl/perl5/issues/15918>
perluniprops
- perluniprops has been updated to note that
\p{Word}now includes code points matching the\p{Join_Control}property. The change to the property was made in Perl 5.18, but not documented until now. There are currently only two code points that match this property: U+200C (ZERO WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER). π¦ - For each binary table or property, the documentation now includes which characters in the range
\x00-\xFFit matches, as well as a list of the first few ranges of code points matched above that. π
perlvar
- The entry for
$+in perlvar has been expanded upon to describe handling of multiply-named capturing groups.
perlfunc, perlop, perlsyn
- In various places, improve the documentation of the special cases in the condition expression of a while loop, such as implicit
definedand assignment to$_. [GH #16334] <https://github.com/Perl/perl5/issues/16334>
π Diagnostics π
okay bestie this is where Perl tells you what you did wrong, and there's some new vocabulary π
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 Diagnostics β¨
πΈ New Errors πΈ
Can't "goto" into a "given" block
(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.
Can't "goto" into a binary or list expression
Use of goto to jump into the parameter of a binary or list operator has been prohibited, to prevent crashes and stack corruption. [GH #15914] <https://github.com/Perl/perl5/issues/15914>
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. [GH #16415] <https://github.com/Perl/perl5/issues/16415>
π New Warnings π
Old package separator used in string
(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").
- The entry
"Locale '%s' contains (at least) the following characters which have unexpected meanings: %s The Perl program will use the expected meanings"now lives inperldiag.
π Changes to Existing Diagnostics π
- A false-positive warning that was issued when using a numerically-quantified sub-pattern in a recursive regex has been silenced. [GH #16106] <https://github.com/Perl/perl5/issues/16106>
- The warning about useless use of a concatenation operator in void context is now generated for expressions with multiple concatenations, such as
"$a.$b.$c", which used to mistakenly not warn. [GH #3990] <https://github.com/Perl/perl5/issues/3990> - Warnings that a variable or subroutine
"masks earlier declaration in same ...", or that an"our"variable has been redeclared, have been moved to a new warnings category"shadow". Previously they were in category"misc". - The deprecation warning from
Sys::Hostname::hostname()saying that it doesn't accept arguments now states the Perl version in which the warning will be upgraded to an error. [GH #14662] <https://github.com/Perl/perl5/issues/14662> - The
perldiagentry for the error regarding a set-id script has been expanded to make clear that the error is reporting a specific security vulnerability, and to advise how to fix it. π¨ - The
"Unable to flush stdout"error message was missing a trailing newline. [debian #875361]
π Utility Changes π
π perlbug π
--helpand--versionoptions have been added. π
βοΈ Configuration and Compilation βοΈ
- C89 requirement
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.
- On GCC,
-Werror=pointer-arithis now enabled by default, disallowing arithmetic on void and function pointers. - Where an HTML version of the documentation is installed, the HTML documents now use relative links to refer to each other. Links from the index page of
perlipcto the individual section documents are now correct. [GH #11941] <https://github.com/Perl/perl5/issues/11941> lib/unicore/mktablesnow correctly canonicalizes the names of the dependencies stored in the files it generates.
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. [GH #16446] <https://github.com/Perl/perl5/issues/16446>
- New probes π§
HAS_BUILTIN_ADD_OVERFLOW
HAS_BUILTIN_MUL_OVERFLOW
HAS_BUILTIN_SUB_OVERFLOW
HAS_THREAD_SAFE_NL_LANGINFO_L
HAS_LOCALECONV_L
HAS_MBRLEN
HAS_MBRTOWC
HAS_MEMRCHR
HAS_NANOSLEEP
HAS_STRNLEN
HAS_STRTOLD_L
I_WCHAR
π§ͺ Testing π§ͺ
- Testing of the
XS-APItestdirectory is now done in parallel, where applicable. β¨ - Perl now includes a default
.travis.ymlfile for Travis CI testing on GitHub mirrors. [GH #14558] <https://github.com/Perl/perl5/issues/14558> - The watchdog timer count in
re/pat_psycho.tcan now be overridden.
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.
harnessno longer waits for 30 seconds when runningt/io/openpid.t. [GH #13535] <https://github.com/Perl/perl5/issues/13535> [GH #16420] <https://github.com/Perl/perl5/issues/16420>
π¦ Packaging π¦
For the past few years we have released perl using three different archive formats: bzip (.bz2), LZMA2 (.xz) and gzip (.gz). Since xz compresses better and decompresses faster, and gzip is more compatible and uses less memory, we have dropped the .bz2 archive format with this release. (If this poses a problem, do let us know; see "Reporting Bugs", below.) rip .bz2, you served us well ποΈ
π Platform Support π
π Discontinued Platforms π
- PowerUX / Power MAX OS
Compiler hints and other support for these apparently long-defunct platforms has been removed.
πΊοΈ Platform-Specific Notes πΊοΈ
- CentOS
Compilation on CentOS 5 is now fixed.
- Cygwin
A build with the quadmath library can now be done on Cygwin.
- Darwin
Perl now correctly uses reentrant functions, like asctime_r, on versions of Darwin that have support for them.
- FreeBSD
FreeBSD's /usr/share/mk/sys.mk specifies -O2 for architectures other than ARM and MIPS. By default, perl is now compiled with the same optimization levels.
- VMS
Several fix-ups for configure.com, marking function VMS has (or doesn't have).
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.
- Windows
- Support for compiling perl on Windows using Microsoft Visual Studio 2017 (containing Visual C++ 14.1) has been added.
- Visual C++ compiler version detection has been improved to work on non-English language systems.
- We now set
$Config{libpth}correctly for 64-bit builds using Visual C++ versions earlier than 14.1.
π Internal Changes π
- okay so bestie, the compiler got a brand-new optimisation phase called
optimize_optree(). It does a top-down scan of a complete optree right before the peephole optimiser runs. And no, you can't hook into it rn β this phase is not currently hookable. periodt. π«Ά - A new op has entered the chat:
OP_MULTICONCAT. Atoptimize_optree()time, a chain ofOP_CONCATandOP_CONSTops β together optionally with anOP_STRINGIFYand/orOP_SASSIGNβ gets combined into one singleOP_MULTICONCATop. The op is of typeUNOP_AUX, and the aux array contains the argument count, plus a pointer to a constant string and a set of segment lengths. For example with
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. slay. π
- Direct access to
PL_keyword_pluginis not safe in the presence of multithreading. A newwrap_keyword_pluginfunction has been added to allow XS modules to safely define custom keywords even when loaded from a thread, analogous toPL_check/wrap_op_checker. iconic tbh. β¨ - The
PL_statbufinterpreter variable has been removed. bye bestie. π - The deprecated function
to_utf8_case(), accessible from XS code, has been removed. it's giving deprecated-and-gone. π - A new function,
is_utf8_invariant_string_loc(), has been added. It's likeis_utf8_invariant_string()but takes an extra pointer parameter into which is stored the location of the first variant character, if any are found. so useful. πΈ - A new function,
Perl_langinfo(), has been added. It is an (almost) drop-in replacement for the systemnl_langinfo(3), but works on platforms that lack that; as well as being more thread-safe, and hiding some gotchas with locale handling from the caller. Code that uses this needn't use"localeconv(3)"(and be affected by the gotchas) to find the decimal point, thousands separator, or currency symbol. See"Perl_langinfo" in perlapi. obsessed. π - A new API function,
sv_rvunweaken(), has been added to complementsv_rvweaken(). The implementation was taken from"unweaken" in Scalar::Util. adorable. π₯° - A new flag,
SORTf_UNSTABLE, has been added. This will allow a future commit to make mergesort unstable when the user specifies βno sort stableβ, since it has been decided that mergesort should remain stable by default. noted. π - XS modules can now automatically get reentrant versions of system functions on threaded perls. 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. fr fr. π
- The
"PERL_NO_OP_PARENT"build define is no longer supported, which means that perl is now always built with"PERL_OP_PARENT"enabled. periodt. π - The format and content of the non-utf8 transliteration table attached to the
"op_pv"field of"OP_TRANS"/"OP_TRANSR"ops has changed. It's now a"struct OPtrans_map". glow-up. β¨ - A new compiler
"#define","dTHX_DEBUGGING". has been added. This is useful for XS or C code that only need the thread context because their debugging statements that get compiled only under"-DDEBUGGING"need one. iykyk. π§ - A new API function,
"Perl_setlocale" in perlapi, has been added. π "sync_locale" in perlapihas been revised to return a boolean as to whether the system was using the global locale or not. β- A new kind of magic scalar, called a
"nonelem"scalar, has been introduced. It is stored in an array to denote a non-existent element, whenever such an element is accessed in a potential lvalue context. It replaces the existing"defelem"(deferred element) magic wherever this is possible, being significantly more efficient. This means thatsome_sub($sparse_array[$nonelem])no longer has to create a new magic defelem scalar each time, as long as the element is within the array. It partially fixes the rare bug of deferred elements getting out of synch with their arrays when the array is shifted or unshifted.[GH #16364]https://github.com/Perl/perl5/issues/16364finally. π¦
π Selected Bug Fixes π
- List assignment (
"aassign") could in some rare cases allocate an entry on the mortals stack and leave the entry uninitialized, leading to possible crashes.[GH #16017]https://github.com/Perl/perl5/issues/16017not the crash. π - Attempting to apply an attribute to an
"our"variable where a function of that name already exists could result in aNULLpointer being supplied where anSVwas expected, crashing perl.[perl #131597]https://rt.perl.org/Ticket/Display.html?id=131597π split ' 'now correctly handles the argument being split when in the scope of the"unicode_strings"feature. Previously, when a string using the single-byte internal representation contained characters that are whitespace by Unicode rules but not by ASCII rules, it treated those characters as part of fields rather than as field separators.[GH #15904]https://github.com/Perl/perl5/issues/15904fixed bestie. πΈ- Several built-in functions previously had bugs that could cause them to write to the internal stack without allocating room for the item being written. In rare situations, this could have led to a crash. These bugs have now been fixed, and if any similar bugs are introduced in future, they will be detected automatically in debugging builds. 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.[GH #16126]https://github.com/Perl/perl5/issues/16126ate. π₯ - Using a symbolic ref with postderef syntax as the key in a hash lookup was yielding an assertion failure on debugging builds.
[GH #16029]https://github.com/Perl/perl5/issues/16029not me finding this. π - Array and hash variables whose names begin with a caret now admit indexing inside their curlies when interpolated into strings, as in
"${^CAPTURE[0]}"to index"@{^CAPTURE}".[GH #16050]https://github.com/Perl/perl5/issues/16050slay. β¨ - Fetching the name of a glob that was previously UTF-8 but wasn't any longer would return that name flagged as UTF-8.
[GH #15971]https://github.com/Perl/perl5/issues/15971fixed. π¦ - The perl
sprintf()function (via the underlying C functionPerl_sv_vcatpvfn_flags()) has been heavily reworked to fix many minor bugs, including the integer wrapping of large width and precision specifiers and potential buffer overruns. It has also been made faster in many cases. ate. π - Exiting from an
"eval", whether normally or via an exception, now always frees temporary values (possibly calling destructors) before setting$@. For example:
sub DESTROY { eval { die "died in DESTROY"; } }
eval { bless []; };
# $@ used to be equal to "died in DESTROY" here; it's now "".
- Fixed a duplicate symbol failure with
-flto -mieee-fpbuilds.pp.cdefined"_LIB_VERSION"which"-lieee"already defines.[GH #16086]https://github.com/Perl/perl5/issues/16086π - The tokenizer no longer consumes the exponent part of a floating point number if it's incomplete.
[GH #16073]https://github.com/Perl/perl5/issues/16073we love that. π₯ - On non-threaded builds, for
"m/$null/"where$nullis an empty string is no longer treated as if the"/o"flag was present when the previous matching match operator included the"/o"flag. The rewriting used to implement this behavior could confuse the interpreter. This matches the behaviour of threaded builds.[GH #14668]https://github.com/Perl/perl5/issues/14668consistent. π§ - Parsing a
"sub"definition could cause a use after free if the"sub"keyword was followed by whitespace including newlines (and comments.)[GH #16097]https://github.com/Perl/perl5/issues/16097π - The tokenizer now correctly adjusts a parse pointer when skipping whitespace in a
"${identifier}"construct.[perl #131949]https://rt.perl.org/Public/Bug/Display.html?id=131949fixed bestie. π - Accesses to
"${^LAST_FH}"no longer assert after using any of a variety of I/O operations on a non-glob.[GH #15372]https://github.com/Perl/perl5/issues/15372obsessed. π - The XS-level
Copy(),Move(),Zero()macros and their variants now assert if the pointers supplied are"NULL". ISO C considers supplyingNULLpointers to the functions these macros are built upon as undefined behaviour even when their count parameters are zero. Based on these assertions and the original bug report three macro calls were made conditional.[GH #16079]https://github.com/Perl/perl5/issues/16079[GH #16112]https://github.com/Perl/perl5/issues/16112β οΈ - Only the
"="operator is permitted for defining defaults for parameters in subroutine signatures. Previously other assignment operators, e.g."+=", were also accidentally permitted.[GH #16084]https://github.com/Perl/perl5/issues/16084no cap. π« - Package names are now always included in
":prototype"warnings[perl #131833]https://rt.perl.org/Public/Bug/Display.html?id=131833π¦ - The
"je_old_stack_hwm"field, previously only found in the"jmpenv"structure on debugging builds, has been added to non-debug builds as well. This fixes an issue with some CPAN modules caused by the size of this structure varying between debugging and non-debugging builds.[GH #16122]https://github.com/Perl/perl5/issues/16122π οΈ - The arguments to the
ninstr()macro are now correctly parenthesized. β - A
NULLpointer dereference in theS_regmatch()function has been fixed.[perl #132017]https://rt.perl.org/Public/Bug/Display.html?id=132017π - Calling
exec PROGRAM LISTwith an empty"LIST"has been fixed. This should callexecvp()with an empty"argv"array (containing only the terminating"NULL"pointer), but was instead just returning false (and not setting$!).[GH #16075]https://github.com/Perl/perl5/issues/16075finally. π€ - The
gv_fetchmeth_svC function straight up stopped working right in Perl 5.22 when you tried to fetch a constant with a UTF-8 name and that constant subroutine was stored in the stash as a plain scalar reference instead of a full typeglob. Yeah. That's fixed now. π - Single-letter debugger commands followed by an argument that starts with punctuation β like
p$^Vandx@ARGVβ work again bestie. They had been wrongly demanding a space between the command and the argument. Rude. [GH #13342] <https://github.com/Perl/perl5/issues/13342> splicenow throws an exception (Modification of a read-only value attempted) when you try to modify a read-only array. Bestie, up until now it had been silently modifying the array. π The new behaviour matches whatpushandunshiftalready do. [GH #15923] <https://github.com/Perl/perl5/issues/15923>stat(),lstat(), and file test operators now fail if you hand them a filename containing a nul character β same energy as howopen()already fails. π«stat(),lstat(), and file test operators now reliably set$!when they fail because you applied them to a closed or otherwise invalid file handle.- File test operators for Unix permission bits that don't even exist on a given platform β like
-k(sticky bit) on Windows β now check that the file being tested actually exists before returning the blanket false, and yield the appropriate errors if the argument doesn't refer to a file. no cap. - Fixed a 'read before buffer' overrun when parsing a range starting with
\N{}at the beginning of the character set for the transliteration operator. [GH #16189] <https://github.com/Perl/perl5/issues/16189> - Fixed a leaked scalar when parsing an empty
\N{}at compile-time. [GH #16189] <https://github.com/Perl/perl5/issues/16189> - Calling
do $pathon a directory or block device now gives you a meaningful error code in$!. [GH #14841] <https://github.com/Perl/perl5/issues/14841> - Regexp substitution using an overloaded replacement value that provides a tainted stringification now correctly taints the resulting string. π [GH #12495] <https://github.com/Perl/perl5/issues/12495>
- Lexical sub declarations inside
doblocks β likedo { my sub lex; 123 }β could corrupt the stack, erasing items already sitting on the stack in the enclosing statement. Genuinely unhinged behaviour. Fixed now. [GH #16243] <https://github.com/Perl/perl5/issues/16243> packandunpackcan now handle repeat counts and lengths that exceed two billion. iconic. [GH #13179] <https://github.com/Perl/perl5/issues/13179>- Digits past the radix point in octal and binary floating point literals now have the correct weight on platforms where a floating point significand doesn't fit into an integer type.
- The canonical truth value no longer has a spurious special meaning as a callable subroutine. It used to be a magic placeholder for a missing
importorunimportmethod, but now it's treated like any other string1. [GH #14902] <https://github.com/Perl/perl5/issues/14902> systemnow reduces its arguments to strings in the parent process, so any effects of stringifying them (like overload methods being called or warnings being emitted) are visible the way the program expects. [GH #13561] <https://github.com/Perl/perl5/issues/13561>- The
readpipe()built-in function now checks at compile time that it has only one parameter expression, and puts it in scalar context β which means it can't corrupt the stack at runtime. π [GH #2793] <https://github.com/Perl/perl5/issues/2793> sortnow does correct reference counting when aliasing$aand$b, so it avoids premature destruction and leakage of scalars if they get re-aliased while the sort comparator is running. [GH #11422] <https://github.com/Perl/perl5/issues/11422>reversewith no operand β you know, the one that reverses$_by default β is no longer in danger of corrupting the stack. [GH #16291] <https://github.com/Perl/perl5/issues/16291>exec,system, et al are no longer liable to have their argument lists corrupted by reentrant calls and by magic like tied scalars. [GH #15660] <https://github.com/Perl/perl5/issues/15660>- Perl's own
mallocno longer gets confused by attempts to allocate more than a gigabyte on a 64-bit platform. [GH #13273] <https://github.com/Perl/perl5/issues/13273> - Stacked file test operators in a sort comparator expression no longer cause a crash. π [GH #15626] <https://github.com/Perl/perl5/issues/15626>
- An identity
tr///transformation on a reference is no longer mistaken for that reference when deciding whether it can be assigned to. [GH #15812] <https://github.com/Perl/perl5/issues/15812> - Lengthy hexadecimal, octal, or binary floating point literals no longer cause undefined behaviour when parsing digits so low in significance that they can't affect the floating point value. [GH #16114] <https://github.com/Perl/perl5/issues/16114>
open $$scalarref...and similar invocations no longer leak the file handle. [GH #12593] <https://github.com/Perl/perl5/issues/12593>- Some convoluted kinds of regexp no longer cause an arithmetic overflow when compiled. [GH #16113] <https://github.com/Perl/perl5/issues/16113>
- The default typemap, by avoiding
newGVgen, now no longer leaks when XSUBs return file handles (PerlIO *orFILE *). [GH #12593] <https://github.com/Perl/perl5/issues/12593> - Creating a
BEGINblock as an XS subroutine with a prototype no longer crashes because of the early freeing of the subroutine. - The
printfformat specifier%.0fno longer rounds incorrectly ([GH #9125] <https://github.com/Perl/perl5/issues/9125>), and now shows the correct sign for a negative zero. β¨ - Fixed an issue where the error
Scalar value @arrayname[0] better written as $arraynamewould give an errorCannot printf Inf with 'c'when arrayname starts withInf. [GH #16335] <https://github.com/Perl/perl5/issues/16335> - The Perl implementation of
getcwd()inCwdin the PathTools distribution now behaves the same as the XS implementation on errors: it returns an error, and sets$!. [GH #16338] <https://github.com/Perl/perl5/issues/16338> - Vivify array elements when putting them on the stack. Fixes [GH #5310] <https://github.com/Perl/perl5/issues/5310> (reported in April 2002). yes bestie, 2002. π«Ά
- Fixed parsing of braced subscript after parens. Fixes [GH #4688] <https://github.com/Perl/perl5/issues/4688> (reported in December 2001).
tr/non_utf8/long_non_utf8/ccould give the wrong results when the length of the replacement character list was greater than0x7fff.tr/non_utf8/non_utf8/cdfailed to add the implied\x{100}-\x{7fffffff}to the search character list.- Compilation failures within
perl-within-perlconstructs β like with string interpolation and the right part ofs///eβ now cause compilation to abort earlier.
Previously compilation could keep going just to report other errors, but the failed sub-parse could leave partly parsed constructs on the parser shift-reduce stack, confusing the parser and leading to perl crashes. π [GH #14739] <https://github.com/Perl/perl5/issues/14739>
- On threaded perls where the decimal point (radix) character isn't a dot, it's been possible for a race to occur between threads when one needs to use the real radix character (like with
sprintf). This is fixed now β by use of a mutex on systems without thread-safe locales. And lowkey, on systems with thread-safe locales, the problem just never comes up. π§ - Errors while compiling a regex character class could sometimes trigger an assertion failure. [GH #16172] <https://github.com/Perl/perl5/issues/16172>
π Acknowledgements π
Perl 5.28.0 represents approximately 13 months of development since Perl 5.26.0 and contains approximately 730,000 lines of changes across 2,200 files from 77 authors. the way that's a whole community of icons? obsessed. π
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, Γvar ArnfjΓΆrΓ° Bjarmason, Alberto SimΓ΅es, Alexandr Savca, Andrew Fresh, Andy Dougherty, Andy Lester, Aristotle Pagaltzis, Ask BjΓΈrn Hansen, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari MannsΓ₯ker, 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 JΓΆrg, 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 MΓΌller, 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.
π Reporting Bugs π
okay bestie, so like β if you find something you think is a bug, first stop is the perl bug database at <https://rt.perl.org/> π . There might also be some info waiting for you at <http://www.perl.org/> , aka the Perl Home Page. Go look, it's literally right there.
If you're like "no bestie, I checked and this is 100% unreported," then pls pls pls run the perlbug program that came with your release. And the key thing here β trim your bug down to a tiny but sufficient test case. Tiny. Sufficient. Both. Your bug report, plus the output of perl -V, gets sent off to perlbug@perl.org so the Perl porting team can analyse it. π
and if the bug you're reporting has security implications that make it inappropriate to send to a publicly archived mailing list, then go read"SECURITY VULNERABILITY CONTACT INFORMATION"inperlsecfor the details on how to report the issue. Don't just yeet it into the public list, bestie, that's not the vibe π
π Give Thanks π
Wanna thank the Perl 5 Porters for all the work they did in Perl 5? You absolutely can, and it's so easy:
perlthanks
That's it. That runs the perlthanks program, and it'll send an email to the Perl 5 Porters list with your show of thanks. wholesome energy fr fr π«Άβ¨
π SEE ALSO π
- The
Changesfile β for an explanation of how to view exhaustive details on what changed. Exhaustive. Exhaustive, bestie. - The
INSTALLfile β for how to build Perl. - The
READMEfile β for general stuff. - The
ArtisticandCopyingfiles β for copyright information.
and that's a wrap on the whole page, bestie π this was perl v5.44.0, dated 2026-10-17, PERL5280DELTA(1perl) β go forth and slay your Perl 5.28.0 upgrade π
π¦
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms