PERL5260DELTA(1)
β¨ NAME β¨
perl5260delta β the tea on what's new for perl v5.26.0 π
(it's a PERL5260DELTA(1) situation, Perl Programmers Reference Guide, and bestie it is packed)
π DESCRIPTION π
This doc spills everything that changed between the 5.24.0 release and the 5.26.0 release. Buckle up. π¦
π¨ Notice π¨
okay so this release has three updates with widespread effects and you genuinely need to know about them, no skipping:
.is no longer in@INCπ
For security reasons, the current directory (".") is no longer included by default at the end of the module search path (@INC). This may have widespread implications for the building, testing and installing of modules, and for the execution of scripts. Full details live in the section "Removal of the current directory (".") from @INC".
domay now warn π
do now gives a deprecation warning when it fails to load a file which it would have loaded had "." been in @INC.
- In regular expression patterns, a literal left brace
{should be escaped π
Go read "Unescaped literal "{" characters in regular expression patterns are no longer permissible".
π Core Enhancements π
π§ Lexical subroutines are no longer experimental
Using the lexical_subs feature introduced in v5.18 no longer emits a warning. Existing code that disables the experimental::lexical_subs warning category that the feature previously used will continue to work. The lexical_subs feature has no effect; all Perl code can use lexical subroutines, regardless of what feature declarations are in scope. it's giving graduated, honestly. π
π Indented Here-documents
This adds a new modifier ~ to here-docs that tells the parser that it should look for /^\s*$DELIM\n/ as the closing delimiter.
These syntaxes are all supported, and yes you can mix and match:
<<~EOF;
<<~\EOF;
<<~'EOF';
<<~"EOF";
<<~`EOF`;
<<~ 'EOF';
<<~ "EOF";
<<~ `EOF`;
The ~ modifier will strip, from each line in the here-doc, the same whitespace that appears before the delimiter.
Newlines will be copied as-is, and lines that don't include the proper beginning whitespace will cause perl to croak. πΈ
For example:
if (1) {
print <<~EOF;
Hello there
EOF
}
prints "Hello there\n" with no leading whitespace. slay. β¨
πΈ New regular expression modifier /xx
Specifying two x characters to modify a regular expression pattern does everything that a single one does, but additionally TAB and SPACE characters within a bracketed character class are generally ignored and can be added to improve readability, like /[ ^ A-Z d-f p-x ]/xx. Details are at "/x and /xx" in perlre. lowkey obsessed with how readable this gets. π«Ά
π @{^CAPTURE}, %{^CAPTURE}, and %{^CAPTURE_ALL}
@{^CAPTURE} exposes the capture buffers of the last match as an array. So $1 is ${^CAPTURE}[0]. This is a more efficient equivalent to code like substr($matched_string,$-[0],$+[0]-$-[0]), and you don't have to keep track of the $matched_string either. This variable has no single character equivalent. Note that, like the other regex magic variables, the contents of this variable is dynamic; if you wish to store it beyond the lifetime of the match you must copy it to another array. π
%{^CAPTURE} is equivalent to %+ (i.e., named captures). Other than being more self-documenting there is no difference between the two forms.
%{^CAPTURE_ALL} is equivalent to %- (i.e., all named captures). Other than being more self-documenting there is no difference between the two forms.
π¦ Declaring a reference to a variable
As an experimental feature, Perl now allows the referencing operator to come after my(), state(), our(), or local(). This syntax must be enabled with use feature 'declared_refs'. It is experimental, and will warn by default unless no warnings 'experimental::refaliasing' is in effect. It is intended mainly for use in assignments to references. For example:
use experimental 'refaliasing', 'declared_refs';
my \$a = \$b;
See "Assigning to References" in perlref for more details.
β Unicode 9.0 is now supported
A list of changes is at <http://www.unicode.org/versions/Unicode9.0.0/>. Modules that are shipped with core Perl but not maintained by p5p do not necessarily support Unicode 9.0. Unicode::Normalize does work on 9.0. π
π Use of \p{script} uses the improved Script_Extensions property
Unicode 6.0 introduced an improved form of the Script (sc) property, and called it Script_Extensions (scx). Perl now uses this improved version when a property is specified as just \p{script}. This should make programs more accurate when determining if a character is used in a given script, but there is a slight chance of breakage for programs that very specifically needed the old behavior. The meaning of compound forms, like \p{sc=script} are unchanged. See "Scripts" in perlunicode.
π Perl can now do default collation in UTF-8 locales on platforms that support it
Some platforms natively do a reasonable job of collating and sorting in UTF-8 locales. Perl now works with those. For portability and full control, Unicode::Collate is still recommended, but now you may not need to do anything special to get good-enough results, depending on your application. See "Category "LC_COLLATE": Collation: Text Comparisons and Sorting" in perllocale.
π Better locale collation of strings containing embedded NUL characters
In locales that have multi-level character weights, NULs are now ignored at the higher priority ones. There are still some gotchas in some strings, though. See "Collation of strings containing embedded "NUL" characters" in perllocale.
π CORE subroutines for hash and array functions callable via reference
The hash and array functions in the CORE namespace (keys, each, values, push, pop, shift, unshift and splice) can now be called with ampersand syntax (&CORE::keys(\%hash) and via reference (my $k = \&CORE::keys; $k->(\%hash)). Previously they could only be used when inlined. icon behavior, fr fr. π₯
π₯ New Hash Function For 64-bit Builds
We have switched to a hybrid hash function to better balance performance for short and long keys.
For short keys, 16 bytes and under, we use an optimised variant of One At A Time Hard, and for longer keys we use Siphash 1-3. For very long keys this is a big improvement in performance. For shorter keys there is a modest improvement. π
β¨ SECURITY β¨
okay bestie, security section time π this is where perl said βnot todayβ to some truly cursed vibes, and honestly? iconic.
π« Removal of the current directory (".") from @INC
The perl binary includes a default set of paths in @INC. Historically it has also included the current directory (".") as the final entry, unless run with taint mode enabled (perl -T). While convenient, this has security implications: for example, where a script attempts to load an optional module when its current directory is untrusted (such as /tmp), it could load and execute code from under that directory. lowkey terrifying, fr fr. π
Starting with v5.26, "." is always removed by default, not just under tainting. This has major implications for installing modules and executing scripts. main character plot twist energy.
The following new features have been added to help ameliorate these issues.
Configure -Udefault_inc_excludes_dotβ There is a new Configure option,default_inc_excludes_dot(enabled by default) which builds a perl executable without"."; unsetting this option using-Ureverts perl to the old behaviour. This may fix your path issues but will reintroduce all the security concerns, so don't build a perl executable like this unless you're really confident that such issues are not a concern in your environment. bestie, pls be careful. π¨PERL_USE_UNSAFE_INCβ There is a new environment variable recognised by the perl interpreter. If this variable has the value1when the perl interpreter starts up, then"."will be automatically appended to@INC(except under tainting).
This allows you restore the old perl interpreter behaviour on a case-by-case basis. But note that this is intended to be a temporary crutch, and this feature will likely be removed in some future perl version. It is currently set by the cpan utility and Test::Harness to ease installation of CPAN modules which have not been updated to handle the lack of dot. Once again, don't use this unless you are sure that this will not reintroduce any security concerns. it's giving βtemporary fix that overstays its welcome.β π
- A new deprecation warning issued by
do. β While it is well-known thatuseandrequireuse@INCto search for the file to load, many people don't realise thatdo "file"also searches@INCif the file is a relative path. With the removal of".", a simpledo "file.pl"will fail to read in and executefile.plfrom the current directory. Since this is commonly expected behaviour, a new deprecation warning is now issued wheneverdofails to load a file which it otherwise would have found if a dot had been in@INC. the way thatdowas quietly doing all thatβ¦ π³
Here are some things script and module authors may need to do to make their software work in the new regime.
- Script authors β If the issue is within your own code (rather than within included modules), then you have two main options. Firstly, if you are confident that your script will only be run within a trusted directory (under which you expect to find trusted files and modules), then add
"."back into the path; e.g.:
BEGIN {
my $dir = "/some/trusted/directory";
chdir $dir or die "Can't chdir to $dir: $!\n";
# safe now
push @INC, '.';
}
use "Foo::Bar"; # may load /some/trusted/directory/Foo/Bar.pm
do "config.pl"; # may load /some/trusted/directory/config.pl
On the other hand, if your script is intended to be run from within untrusted directories (such as /tmp), then your script suddenly failing to load files may be indicative of a security issue. You most likely want to replace any relative paths with full paths; for example,
do "foo_config.pl"
might become
do "$ENV{HOME}/foo_config.pl"
If you are absolutely certain that you want your script to load and execute a file from the current directory, then use a ./ prefix; for example:
do "./foo_config.pl"
- Installing and using CPAN modules β If you install a CPAN module using an automatic tool like
cpan, then this tool will itself set thePERL_USE_UNSAFE_INCenvironment variable while building and testing the module, which may be sufficient to install a distribution which hasn't been updated to be dot-aware. If you want to install such a module manually, then you'll need to replace the traditional invocation:
perl Makefile.PL && make && make test && make install
with something like
(export PERL_USE_UNSAFE_INC=1; \
perl Makefile.PL && make && make test && make install)
Note that this only helps build and install an unfixed module. It's possible for the tests to pass (since they were run under PERL_USE_UNSAFE_INC=1), but for the module itself to fail to perform correctly in production. In this case, you may have to temporarily modify your script until a fixed version of the module is released. For example:
use Foo::Bar;
{
local @INC = (@INC, '.');
# assuming read_config() needs '.' in @INC
$config = Foo::Bar->read_config();
}
This is only rarely expected to be necessary. Again, if doing this, assess the resultant risks first. risk assessment before the vibes, always.
- Module Authors β If you maintain a CPAN distribution, it may need updating to run in a dotless environment. Although
cpanand other such tools will currently set thePERL_USE_UNSAFE_INCduring module build, this is a temporary workaround for the set of modules which rely on"."being in@INCfor installation and testing, and this may mask deeper issues. It could result in a module which passes tests and installs, but which fails at run time. the audacity. π
During build, test, and install, it will normally be the case that any perl processes will be executing directly within the root directory of the untarred distribution, or a known subdirectory of that, such as t/. It may well be that Makefile.PL or t/foo.t will attempt to include local modules and configuration files using their direct relative filenames, which will now fail.
However, as described above, automatic tools like cpan will (for now) set the PERL_USE_UNSAFE_INC environment variable, which introduces dot during a build.
This makes it likely that your existing build and test code will work, but this may mask issues with your code which only manifest when used after install. It is prudent to try and run your build process with that variable explicitly disabled:
(export PERL_USE_UNSAFE_INC=0; \
perl Makefile.PL && make && make test && make install)
This is more likely to show up any potential problems with your module's build process, or even with the module itself. Fixing such issues will ensure both that your module can again be installed manually, and that it will still build once the PERL_USE_UNSAFE_INC crutch goes away.
When fixing issues in tests due to the removal of dot from @INC, reinsertion of dot into @INC should be performed with caution, for this too may suppress real errors in your runtime code. You are encouraged wherever possible to apply the aforementioned approaches with explicit absolute/relative paths, or to relocate your needed files into a subdirectory and insert that subdirectory into @INC instead.
If your runtime code has problems under the dotless @INC, then the comments above on how to fix for script authors will mostly apply here too. Bear in mind though that it is considered bad form for a module to globally add a dot to @INC, since it introduces both a security risk and hides issues of accidentally requiring dot in @INC, as explained above. globally adding dot? not the serve. π
π Escaped colons and relative paths in PATH
On Unix systems, Perl treats any relative paths in the PATH environment variable as tainted when starting a new process. Previously, it was allowing a backslash to escape a colon (unlike the OS), consequently allowing relative paths to be considered safe if the PATH was set to something like "/\:.". The check has been fixed to treat "." as tainted in that example. fixed the loophole, periodt. β¨
π New -Di switch is now required for PerlIO debugging output
This is used for debugging of code within PerlIO to avoid recursive calls. Previously this output would be sent to the file specified by the PERLIO_DEBUG environment variable if perl wasn't running setuid and the -T or -t switches hadn't been parsed yet.
If perl performed output at a point where it hadn't yet parsed its switches this could result in perl creating or overwriting the file named by PERLIO_DEBUG even when the -T switch had been supplied. not the accidental overwrite arc. π
Perl now requires the -Di switch to be present before it will produce PerlIO debugging output. By default this is written to stderr, but can optionally be redirected to a file by setting the PERLIO_DEBUG environment variable.
If perl is running setuid or the -T switch was supplied, PERLIO_DEBUG is ignored and the debugging output is sent to stderr as for any other -D switch. stderr stays winning. π«Ά
π Incompatible Changes
π Unescaped literal "{" characters in regular expression patterns are no longer permissible
Okay bestie, listen. You literally have to say "\\{" or "[{]" now if you want to match a LEFT CURLY BRACKET. Otherwise it's a fatal pattern compilation error, no cap. The reason? It opens the door for future extensions to the language. Slay.
These have been deprecated since v5.16, with a deprecation message raised for some uses starting in v5.22. Tragically, the code added to raise the message was buggy and failed to warn in some cases where it should have. So enforcement of this ban for these cases is deferred until Perl 5.30, but the code has been fixed to raise a default-on deprecation message for them in the meantime.
Some uses of literal "{" occur in contexts where we do not foresee the meaning ever being anything but the literal, like the very first character in the pattern, or after a "|" meaning alternation. So:
qr/{fee|{fie/
matches either of the strings "{fee" or "{fie". To avoid forcing unnecessary code changes, these uses do not need to be escaped, and no warning is raised about them, and there are no current plans to change this.
But it is always correct to escape "{", and the simple rule to remember is to always do so. Periodt.
See Unescaped left brace in regex is illegal here.
πͺ£ scalar(%hash) return signature changed
The value returned for scalar(%hash) will no longer show information about the buckets allocated in the hash. It will simply return the count of used keys. It is thus equivalent to "0+keys(%hash)".
A form of backward compatibility is provided via Hash::Util::bucket_ratio() which provides the same behavior as scalar(%hash) provided in Perl 5.24 and earlier. π«Ά
π "keys" returned from an lvalue subroutine
"keys" returned from an lvalue subroutine can no longer be assigned to in list context.
sub foo : lvalue { keys(%INC) }
(foo) = 3; # death
sub bar : lvalue { keys(@_) }
(bar) = 3; # also an error
This makes the lvalue sub case consistent with "(keys %hash) = ..." and "(keys @_) = ...", which are also errors. [GH #15339] <https://github.com/Perl/perl5/issues/15339>
π« The "${^ENCODING}" facility has been removed
The special behaviour associated with assigning a value to this variable has been removed. As a consequence, the encoding pragma's default mode is no longer supported. If you still need to write your source code in encodings other than UTF-8, use a source filter such as Filter::Encoding on CPAN or encoding's "Filter" option.
π POSIX::tmpnam() has been removed
The fundamentally unsafe tmpnam() interface was deprecated in Perl 5.22 and has now been removed. In its place, you can use, for example, the File::Temp interfaces.
π require ::Foo::Bar is now illegal
Formerly, "require ::Foo::Bar" would try to read /Foo/Bar.pm. Now any bareword require which starts with a double colon dies instead.
π§ Literal control character variable names are no longer permissible
A variable name may no longer contain a literal control character under any circumstances. These previously were allowed in single-character names on ASCII platforms, but have been deprecated there since Perl 5.20. This affects things like "$\cT", where \cT is a literal control (such as a "NAK" or "NEGATIVE ACKNOWLEDGE" character) in the source code.
β "NBSP" is no longer permissible in "\N{...}"
The name of a character may no longer contain non-breaking spaces. It has been deprecated to do so since Perl 5.22.
β οΈ Deprecations
π String delimiters that aren't stand-alone graphemes are now deprecated
For Perl to eventually allow string delimiters to be Unicode grapheme clusters (which look like a single character, but may be a sequence of several ones), we have to stop allowing a single character delimiter that isn't a grapheme by itself. These are unlikely to exist in actual code, as they would typically display as attached to the character in front of them.
π "\cX" that maps to a printable is no longer deprecated
This means we have no plans to remove this feature. It still raises a warning, but only if syntax warnings are enabled. The feature was originally intended to be a way to express non-printable characters that don't have a mnemonic ("\t" and "\n" are mnemonics for two non-printable characters, but most non-printables don't have a mnemonic.) But the feature can be used to specify a few printable characters, though those are more clearly expressed as the printable itself. See <http://www.nntp.perl.org/group/perl.perl5.porters/2017/02/msg242944.html>.
β‘ Performance Enhancements
- A hash in boolean context is now sometimes faster, e.g.
if (!%h) { ... }
This was already special-cased, but some cases were missed (such as "grep %$_, @AoH"), and even the ones which weren't have been improved.
- New Faster Hash Function on 64 bit builds
We use a different hash function for short and long keys. This should improve performance and security, especially for long keys.
readlineis faster
Reading from a file line-by-line with readline() or "<>" should now typically be faster due to a better implementation of the code that searches for the next newline character.
- Assigning one reference to another, e.g.
"$ref1 = $ref2"has been optimized in some cases. - Remove some exceptions to creating Copy-on-Write strings. The string buffer growth algorithm has been slightly altered so that you're less likely to encounter a string which can't be COWed.
- Better optimise array and hash assignment: where an array or hash appears in the LHS of a list assignment, such as
"(..., @a) = (...);", it's likely to be considerably faster, especially if it involves emptying the array/hash. For example, this code runs about a third faster compared to Perl 5.24.0:
my @a;
for my $i (1..10_000_000) {
@a = (1,2,3);
@a = ();
}
- Converting a single-digit string to a number is now substantially faster.
- The
"split"builtin is now slightly faster in many cases: in particular for the two specially-handled forms
my @a = split ...;
local @a = split ...;
- The rather slow implementation for the experimental subroutine signatures feature has been made much faster; it is now comparable in speed with the traditional
"my ($a, $b, @c) = @_". - Bareword constant strings are now permitted to take part in constant folding. They were originally exempted from constant folding in August 1999, during the development of Perl 5.6, to ensure that
"use strict "subs""would still apply to bareword constants. That has now been accomplished a different way, so barewords, like other constants, now gain the performance benefits of constant folding.
This also means that void-context warnings on constant expressions of barewords now report the folded constant operand, rather than the operation; this matches the behaviour for non-bareword constants.
π¦ Modules and Pragmata
β¨ Updated Modules and Pragmata
IO::Compresshas been upgraded from version 2.069 to 2.074.Archive::Tarhas been upgraded from version 2.04 to 2.24.arybasehas been upgraded from version 0.11 to 0.12.attributeshas been upgraded from version 0.27 to 0.29.
The deprecation message for the ":unique" and ":locked" attributes now mention that they will disappear in Perl 5.28.
Bhas been upgraded from version 1.62 to 1.68.B::Concisehas been upgraded from version 0.996 to 0.999.
Its output is now more descriptive for "op_private" flags.
B::Debughas been upgraded from version 1.23 to 1.24.B::Deparsehas been upgraded from version 1.37 to 1.40.B::Xrefhas been upgraded from version 1.05 to 1.06.
It now uses 3-arg open() instead of 2-arg open(). [GH #15721] <https://github.com/Perl/perl5/issues/15721>
basehas been upgraded from version 2.23 to 2.25.bignumhas been upgraded from version 0.42 to 0.47.Carphas been upgraded from version 1.40 to 1.42.charnameshas been upgraded from version 1.43 to 1.44.Compress::Raw::Bzip2has been upgraded from version 2.069 to 2.074.Compress::Raw::Zlibhas been upgraded from version 2.069 to 2.074.Config::Perl::Vhas been upgraded from version 0.25 to 0.28.CPANhas been upgraded from version 2.11 to 2.18.CPAN::Metahas been upgraded from version 2.150005 to 2.150010.Data::Dumperhas been upgraded from version 2.160 to 2.167.
The XS implementation now supports Deparse.
DB_Filehas been upgraded from version 1.835 to 1.840.Devel::Peekhas been upgraded from version 1.23 to 1.26.Devel::PPPorthas been upgraded from version 3.32 to 3.35.Devel::SelfStubberhas been upgraded from version 1.05 to 1.06.
It now uses 3-arg open() instead of 2-arg open(). [GH #15721] <https://github.com/Perl/perl5/issues/15721>
diagnosticshas been upgraded from version 1.34 to 1.36.
It now uses 3-arg open() instead of 2-arg open(). [GH #15721] <https://github.com/Perl/perl5/issues/15721>
Digesthas been upgraded from version 1.17 to 1.17_01.Digest::MD5has been upgraded from version 2.54 to 2.55.Digest::SHAhas been upgraded from version 5.95 to 5.96.DynaLoaderhas been upgraded from version 1.38 to 1.42.Encodehas been upgraded from version 2.80 to 2.88.encodinghas been upgraded from version 2.17 to 2.19.
This module's default mode is no longer supported. It now dies when imported, unless the "Filter" option is being used.
encoding::warningshas been upgraded from version 0.12 to 0.13.
This module is no longer supported. It emits a warning to that effect and then does nothing.
Errnohas been upgraded from version 1.25 to 1.28.
It now documents that using "%!" automatically loads Errno for you.
It now uses 3-arg open() instead of 2-arg open(). [GH #15721] <https://github.com/Perl/perl5/issues/15721>
ExtUtils::Embedhas been upgraded from version 1.33 to 1.34.
It now uses 3-arg open() instead of 2-arg open(). [GH #15721] <https://github.com/Perl/perl5/issues/15721>
ExtUtils::MakeMakerhas been upgraded from version 7.10_01 to 7.24.ExtUtils::Miniperlhas been upgraded from version 1.05 to 1.06.ExtUtils::ParseXShas been upgraded from version 3.31 to 3.34.ExtUtils::Typemapshas been upgraded from version 3.31 to 3.34.featurehas been upgraded from version 1.42 to 1.47.File::Copyhas been upgraded from version 2.31 to 2.32.File::Fetchβ glow-up from0.48to0.52. β¨File::Globβ glow-up from1.26to1.28. π¦- bestie it now issues a deprecation message for
File::Glob::glob(). consider yourself warned π
- bestie it now issues a deprecation message for
File::Specβ glow-up from3.63to3.67. πΈFileHandleβ glow-up from2.02to2.03. πFilter::Simpleβ glow-up from0.92to0.93. β¨- it no longer treats
no MyFilterimmediately followinguse MyFilteras end-of-file. [GH #11853] <https://github.com/Perl/perl5/issues/11853> π
- it no longer treats
Getopt::Longβ glow-up from2.48to2.49. πGetopt::Stdβ glow-up from1.11to1.12. πHash::Utilβ glow-up from0.19to0.22. π₯HTTP::Tinyβ glow-up from0.056to0.070. π- internal 599-series errors now include the redirect history. receipts included fr fr π§Ύ
I18N::LangTagsβ glow-up from0.40to0.42. πΈ- it now uses 3-arg
open()instead of 2-argopen(). [GH #15721] <https://github.com/Perl/perl5/issues/15721> π«Ά
- it now uses 3-arg
IOβ glow-up from1.36to1.38. πIO::Socket::IPβ glow-up from0.37to0.38. π¦IPC::Cmdβ glow-up from0.92to0.96. β¨IPC::SysVβ glow-up from2.06_01to2.07. πJSON::PPβ glow-up from2.27300to2.27400_02. π₯libβ glow-up from0.63to0.64. πΈ- it now uses 3-arg
open()instead of 2-argopen(). [GH #15721] <https://github.com/Perl/perl5/issues/15721> π«Ά
- it now uses 3-arg
List::Utilβ glow-up from1.42_02to1.46_02. πLocale::Codesβ glow-up from3.37to3.42. πLocale::Maketextβ glow-up from1.26to1.28. β¨Locale::Maketext::Simpleβ glow-up from0.21to0.21_01. πMath::BigIntβ glow-up from1.999715to1.999806. π’Math::BigInt::FastCalcβ glow-up from0.40to0.5005. π’Math::BigRatβ glow-up from0.260802to0.2611. π’Math::Complexβ glow-up from1.59to1.5901. π’Memoizeβ glow-up from1.03to1.03_01. πModule::CoreListβ glow-up from5.20170420to5.20170530. πModule::Load::Conditionalβ glow-up from0.64to0.68. π¦Module::Metadataβ glow-up from1.000031to1.000033. πΈmroβ glow-up from1.18to1.20. πNet::Pingβ glow-up from2.43to2.55. π₯- IPv6 addresses and
"AF_INET6"sockets are now supported, along with several other enhancements. it's giving modern networking π
- IPv6 addresses and
NEXTβ glow-up from0.65to0.67. β¨Opcodeβ glow-up from1.34to1.39. πopenβ glow-up from1.10to1.11. π«ΆOS2::Processβ glow-up from1.11to1.12. π¦- it now uses 3-arg
open()instead of 2-argopen(). [GH #15721] <https://github.com/Perl/perl5/issues/15721> πΈ
- it now uses 3-arg
overloadβ glow-up from1.26to1.28. π- its compilation speed has been improved slightly. a lil speed boost, we love to see it β‘
parentβ glow-up from0.234to0.236. πperl5db.plβ glow-up from1.50to1.51. π- it now ignores
/dev/ttyon non-Unix systems. [GH #12244] <https://github.com/Perl/perl5/issues/12244> π
- it now ignores
Perl::OSTypeβ glow-up from1.009to1.010. πperlfaqβ glow-up from5.021010to5.021011. βPerlIOβ glow-up from1.09to1.10. πPerlIO::encodingβ glow-up from0.24to0.25. β¨PerlIO::scalarβ glow-up from0.24to0.26. β¨Pod::Checkerβ glow-up from1.60to1.73. πPod::Functionsβ glow-up from1.10to1.11. πPod::Htmlβ glow-up from1.22to1.2202. πPod::Perldocβ glow-up from3.25_02to3.28. πPod::Simpleβ glow-up from3.32to3.35. πPod::Usageβ glow-up from1.68to1.69. πPOSIXβ glow-up from1.65to1.76. π₯- this remedies several defects in making its symbols exportable. [GH #15260] <https://github.com/Perl/perl5/issues/15260> π«Ά
- the
POSIX::tmpnam()interface has been removed, see "POSIX::tmpnam() has been removed". π - the following deprecated functions have been removed:
POSIX::isalnum
POSIX::isalpha
POSIX::iscntrl
POSIX::isdigit
POSIX::isgraph
POSIX::islower
POSIX::isprint
POSIX::ispunct
POSIX::isspace
POSIX::isupper
POSIX::isxdigit
POSIX::tolower
POSIX::toupper
- trying to import POSIX subs that have no real implementations (like
POSIX::atend()) now fails at import time, instead of waiting until runtime. no more surprise explosions later, it tells you immediately π€
reβ glow-up from0.32to0.34. π¦- this adds support for the new
"/xx"regular expression pattern modifier, and a change to theuse re 'strict'experimental feature. Whenre 'strict'is enabled, a warning now will be generated for all unescaped uses of the two characters"}"and"]"in regular expression patterns (outside bracketed character classes) that are taken literally. This brings them more in line with the")"character which is always a metacharacter unless escaped. Being a metacharacter only sometimes, depending on an action at a distance, can lead to silently having the pattern mean something quite different than was intended, which the"re 'strict'"mode is intended to minimize. basically: no more sneak-attack regex lore bestie π
- this adds support for the new
Safeβ glow-up from2.39to2.40. πScalar::Utilβ glow-up from1.42_02to1.46_02. β¨Storableβ glow-up from2.56to2.62. π₯- fixes [GH #15714] <https://github.com/Perl/perl5/issues/15714>. π«Ά
Symbolβ glow-up from1.07to1.08. πSys::Syslogβ glow-up from0.33to0.35. πΈTerm::ANSIColorβ glow-up from4.04to4.06. πTerm::ReadLineβ glow-up from1.15to1.16. π- it now uses 3-arg
open()instead of 2-argopen(). [GH #15721] <https://github.com/Perl/perl5/issues/15721> π«Ά
- it now uses 3-arg
Testβ glow-up from1.28to1.30. π§ͺ- it now uses 3-arg
open()instead of 2-argopen(). [GH #15721] <https://github.com/Perl/perl5/issues/15721> π«Ά
- it now uses 3-arg
Test::Harnessβ glow-up from3.36to3.38. π§ͺTest::Simpleβ glow-up from1.001014to1.302073. π§ͺThread::Queueβ glow-up from3.09to3.12. π§΅Thread::Semaphoreβ glow-up from2.12to2.13. π§΅- added the
"down_timed"method. new method dropped β¨
- added the
threadsβ glow-up from2.07to2.15. π§΅threads::sharedβ glow-up from1.51to1.56. π§΅Tie::Hash::NamedCaptureβ glow-up from0.09to0.10. πTime::HiResβ glow-up from1.9733to1.9741. β±οΈ- it now builds on systems with C++11 compilers (such as G++ 6 and Clang++ 3.9). π₯
- now uses
"clockid_t". π°οΈ
Time::Localβ glow-up from1.2300to1.25. β±οΈUnicode::Collateβ glow-up from1.14to1.19. πΈUnicode::UCDβ glow-up from0.64to0.68. πΈ- it now uses 3-arg
open()instead of 2-argopen(). [GH #15721] <https://github.com/Perl/perl5/issues/15721> π«Ά
- it now uses 3-arg
versionβ glow-up from0.9916to0.9917. πVMS::DCLsymβ glow-up from1.06to1.08. π¦- it now uses 3-arg
open()instead of 2-argopen(). [GH #15721] <https://github.com/Perl/perl5/issues/15721> π«Ά
- it now uses 3-arg
warningsβ glow-up from1.36to1.37. β οΈXS::Typemapβ glow-up from0.14to0.15. πXSLoaderβ glow-up from0.21to0.27. π₯- fixed a security hole in which binary files could be loaded from a path outside of
@INC. π¨ bestie this one is serious, patch it, no cap. - it now uses 3-arg
open()instead of 2-argopen(). [GH #15721] <https://github.com/Perl/perl5/issues/15721> π«Ά
- fixed a security hole in which binary files could be loaded from a path outside of
β¨ Documentation β¨
πΈ New Documentation πΈ
perldeprecation
okay bestie, so perldeprecation is literally the file that spills all the tea about deprecations that are coming up, plus some that already got yeeted. Its whole purpose is two-fold: (1) document what's gonna disappear and in which version, and (2) be a guide for people whose code has features that no longer work after they upgrade their perl. periodt. π
π Changes to Existing Documentation π
We tried to update the docs to match the changes listed in this document. If you spot anything we missed, send an email to perlbug@perl.org <mailto:perlbug@perl.org>. π§
Also, all references to Usenet have been removed, and here are the selected changes we made:
perlfunc
- Removed obsolete text about
defined()on aggregates that should have been deleted earlier, back when the feature was removed. ποΈ - Corrected the documentation of
eval()andevalbytes(). - Clarified docs for
seek(),tell()andsysseek(), emphasizing that positions are in bytes, not characters.[GH #15438] <https://github.com/Perl/perl5/issues/15438> - Clarified docs for
sort()about the variables$aand$b. - In
split(), noted that certain pattern modifiers are legal, and added a caution about using it in Perls before v5.11. - Removed obsolete docs for
study(), noting that it's now a no-op. - Noted that
vec()doesn't work well when the string contains characters whose code points are above 255.
perlguts
- Added advice on formatted printing of operands of
"Size_t"and"SSize_t".
perlhack
- Clarified what editor tab stop rules to use, and noted that we're migrating away from tabs, replacing them with sequences of SPACE characters.
perlhacktips
- Gave another reason to use
cBOOLto cast an expression to boolean. - Noted that the macros
"TRUE"and"FALSE"are available to express boolean values.
perlinterp
perlinterphas been expanded to give a more detailed example of how to hunt around in the parser for how a given operator is handled.
perllocale
- Some locales aren't compatible with Perl. Note that these can cause core dumps. π
perlmod
- Various clarifications have been added.
perlmodlib
- Updated the site mirror list.
perlobj
- Added a section on calling methods using their fully qualified names.
- Do not discourage manual
@ISA.
perlootut
- Mention
"Moo"more.
perlop
- Note that white space must be used for quoting operators if the delimiter is a word character (i.e., matches
"\w"). - Clarify that in regular expression patterns delimited by single quotes, no variable interpolation is done.
perlre
- The first part was extensively rewritten to incorporate various basic points that in earlier versions were mentioned in sort of an appendix on Version 8 regular expressions.
- Note that it's common to have the
"/x"modifier and forget that this means that"#"has to be escaped.
perlretut
- Add introductory material.
- Note that a metacharacter occurring in a context where it can't mean that silently loses its meta-ness and matches literally.
"use re 'strict'"can catch some of these.
perlunicode
- Corrected the text about Unicode BYTE ORDER MARK handling.
- Updated the text to correspond with changes in Unicode UTS#18, concerning regular expressions, and Perl compatibility with what it says.
perlvar
- Document
@ISA. It was documented in other places, but not inperlvar.
π Diagnostics π
okay so bestie, we're in the diagnostics era and it's lowkey a whole vibe. Every error and warning got a glow-up, and some of them are straight-up iconic. Let's get into it. π
π©Ί New Diagnostics
π New Errors
These are the new error messages, and they are not here to play. If you see one, it's giving fix me now. β¨
A signature parameter must start with '$', '@' or '%'β periodt. Your signature param has to start with'$','@', or'%'. No cap. πBareword in require contains "%s"β bestie, your bareword inrequireis carrying"%s"and that's not the move. πBareword in require maps to empty filenameβ it maps to an empty filename. Empty. Like my will to live during finals. πBareword in require maps to disallowed filename "%s"β it maps to"%s"and that filename is disallowed. So no. π«Bareword in require must not start with a double-colon: "%s"β"%s"starts with a double-colon and it must not. Periodt. π%s: command not foundβ (A) You've accidentally run your script throughbashor another shell instead of Perl. Check the"#!"line, or manually feed your script into Perl yourself. The"#!"line at the top of your file could look like:
#!/usr/bin/perl
bestie, that shebang is the moment. Don't skip it. π«Ά
%s: command not found: %sβ (A) You've accidentally run your script throughzshor another shell instead of Perl. Check the"#!"line, or manually feed your script into Perl yourself. The"#!"line at the top of your file could look like:
#!/usr/bin/perl
zsh girlies, this one's for you. πΈ
The experimental declared_refs feature is not enabledβ (F) To declare references to variables, as in"my \%x", you must first enable the feature:
no warnings "experimental::declared_refs";
use feature "declared_refs";
See "Declaring a reference to a variable". It's experimental, so it's giving risky business. π
Illegal character following sigil in a subroutine signatureβ illegal character after a sigil in a subroutine signature. Jail. Immediately. π¨Indentation on line %d of here-doc doesn't match delimiterβ line%dof your here-doc is not matching the delimiter. The indentation is not giving what it needs to give. πInfinite recursion via empty pattern.β Using the empty pattern (which re-executes the last successfully-matched pattern) inside a code block in another regex, as in"/(?{ s!!new! })/", has always previously yielded a segfault. It now produces this error. So it used to just crash, and now it's like "bestie, no." πMalformed UTF-8 string in "%s"β malformed UTF-8 in"%s". It's giving encoding chaos. πMultiple slurpy parameters not allowedβ multiple slurpy parameters? Not allowed. One slurpy is enough. π'#' not allowed immediately following a sigil in a subroutine signatureβ'#'immediately after a sigil in a subroutine signature is not allowed. Put the'#'down. πpanic: unknown OA_*: %xβ panic! unknownOA_*:%x. This is a panic. We don't know her. πUnescaped left brace in regex is illegal hereβ Unescaped left braces are now illegal in some contexts in regular expression patterns. In other contexts, they are still just deprecated; they will be illegal in Perl 5.30. So in some places it's already illegal, in others it's deprecated but will be illegal in 5.30. The countdown is on. β³Version control conflict markerβ (F) The parser found a line starting with"<<<<<<<",">>>>>>>", or"=======". These may be left by a version control system to mark conflicts after a failed merge operation. bestie, you forgot to resolve your merge conflict. We've all been there. π
π New Warnings
These are the new warnings, and they're just trying to keep you safe. Mostly. π
Can't determine class of operator %s, assuming "BASEOP"β can't figure out the class of operator%s, so it's assuming"BASEOP". It's guessing. It's giving "we'll see." π€·Declaring references is experimentalβ (S experimental::declared_refs) This warning is emitted if you use a reference constructor on the right-hand side ofmy(),state(),our(), orlocal(). Simply suppress the warning if you want to use the feature, but know that in doing so you are taking the risk of using an experimental feature which may change or be removed in a future Perl version:
no warnings "experimental::declared_refs";
use feature "declared_refs";
$fooref = my \$foo;
See "Declaring a reference to a variable". It's experimental, so it might ghost you in a future Perl. π
do "%s" failed, '.' is no longer in @INCβ Since"."is now removed from@INCby default,"do"will now trigger a warning recommending to fix the"do"statement. So fix your"do". It's for your own good. π«ΆFile::Glob::glob() will disappear in perl 5.30. Use File::Glob::bsd_glob() instead.βFile::Glob::glob()is leaving the chat in perl 5.30. UseFile::Glob::bsd_glob()instead. It's giving upgrade era. πUnescaped literal '%c' in regex; marked by <-- HERE in m/%s/β unescaped literal'%c'in regex, marked by<-- HEREinm/%s/. It's literally pointing at it. πUse of unassigned code point or non-standalone grapheme for a delimiter will be a fatal error starting in Perl 5.30β See"Deprecations". So if you're using an unassigned code point or non-standalone grapheme as a delimiter, it's gonna be fatal in Perl 5.30. Fix it now. β οΈ
π©Ή Changes to Existing Diagnostics
These diagnostics got a glow-up, a removal, or a whole new attitude. Let's get into the changes. β¨
- When a
"require"fails, we now do not provide@INCwhen the"require"is for a file instead of a module. So no more@INCspam in that case. π - When
@INCis not scanned for a"require"call, we no longer display@INCto avoid confusion. Confusion? Gone. Periodt. π Attribute "locked" is deprecated, and will disappear in Perl 5.28β This existing warning has had theand will disappeartext added in this release. So it's deprecated and it's leaving in 5.28. πAttribute "unique" is deprecated, and will disappear in Perl 5.28β This existing warning has had theand will disappeartext added in this release. Same energy. πCalling POSIX::%s() is deprecatedβ This warning has been removed, as the deprecated functions have been removed from POSIX. So the warning is gone because the functions are gone. Bye. πConstants from lexical variables potentially modified elsewhere are deprecated. This will not be allowed in Perl 5.32β This existing warning has had thethis will not be allowedtext added in this release. So it's deprecated now, not allowed in 5.32. Mark your calendars. πDeprecated use of my() in false conditional. This will be a fatal error in Perl 5.30β This existing warning has had thethis will be a fatal errortext added in this release. Fatal in 5.30. That's soon. πdump() better written as CORE::dump(). dump() will no longer be available in Perl 5.30β This existing warning has had theno longer be availabletext added in this release. So writeCORE::dump()and stop playing. πExperimental %s on scalar is now forbiddenβ This message is now followed by more helpful text.[GH #15291] <https://github.com/Perl/perl5/issues/15291>. Helpful text? We love to see it. π«ΆExperimental "%s" subs not enabledβ This warning has been removed, as lexical subs are no longer experimental. Lexical subs are free now. πHaving more than one /%c regexp modifier is deprecatedβ This deprecation warning has been removed, since"/xx"now has a new meaning. So that warning ghosted us. π%s() is deprecated on ":utf8" handles. This will be a fatal error in Perl 5.30 .- where
"%s"is one of"sysread","recv","syswrite", or"send". - This existing warning has had the
this will be a fatal errortext added in this release. - This warning is now enabled by default, as all
"deprecated"category warnings should be. So it's on by default now. No hiding. β¨
- where
$* is no longer supported. Its use will be fatal in Perl 5.30β This existing warning has had theits use will be fataltext added in this release.$*is not the moment. π«$# is no longer supported. Its use will be fatal in Perl 5.30β This existing warning has had theits use will be fataltext added in this release.$#is also not the moment. πMalformed UTF-8 character%sβ Details as to the exact problem have been added at the end of this message. So now it tells you exactly what's wrong. Helpful queen. πMissing or undefined argument to %sβ This warning used to warn about"require", even if it was actually"do"which being executed. It now gets the operation name right. It's giving accuracy. πNO-BREAK SPACE in a charnames alias definition is deprecatedβ This warning has been removed as the behavior is now an error. So it leveled up from warning to error. Glow-up. β¨Odd name/value argument for subroutine '%s'β This warning now includes the name of the offending subroutine. Now it names names. πOpening dirhandle %s also as a file. This will be a fatal error in Perl 5.28β This existing warning has had thethis will be a fatal errortext added in this release. Fatal in 5.28. So don't. πOpening filehandle %s also as a directory. This will be a fatal error in Perl 5.28β This existing warning has had thethis will be a fatal errortext added in this release. Same. Don't do it. πpanic: ck_split, type=%uandpanic: pp_split, pm=%p, s=%pβ These panic errors have been removed. They're gone. Bye. πPassing malformed UTF-8 to "%s" is deprecatedβ This warning has been changed to the fatalMalformed UTF-8 string in "%s". So it's not a warning anymore, it's fatal. The stakes are high. π₯Setting $/ to a reference to %s as a form of slurp is deprecated, treating as undef. This will be fatal in Perl 5.28β This existing warning has had thethis will be fataltext added in this release. So don't set$/to a reference like that. It's deprecated now, fatal in 5.28. β οΈ"${^ENCODING}" is no longer supported. Its use will be fatal in Perl 5.28- This warning used to be:
"Setting "${^ENCODING}" is deprecated". - The special action of the variable
"${^ENCODING}"was formerly used to implement the"encoding"pragma. As of Perl 5.26, rather than being deprecated, assigning to this variable now has no effect except to issue the warning. So it's not deprecated, it just does nothing but warn. It's giving "I'm not mad, I'm just disappointed." π
- This warning used to be:
Too few arguments for subroutine '%s'β This warning now includes the name of the offending subroutine. Names names. πToo many arguments for subroutine '%s'β This warning now includes the name of the offending subroutine. Same. πUnescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/%s/β This existing warning has had thehere (and will be fatal...)text added in this release. So it's deprecated here, fatal in 5.30, and marked with<-- HERE. The drama. β¨Unknown charname '' is deprecated. Its use will be fatal in Perl 5.28β This existing warning has had theits use will be fataltext added in this release. Unknown charname is on thin ice. π§Use of bare << to mean <<"" is deprecated. Its use will be fatal in Perl 5.28β This existing warning has had theits use will be fataltext added in this release. So use the quotes. Periodt. πUse of code point 0x%s is deprecated; the permissible max is 0x%s. This will be fatal in Perl 5.28β This existing warning has had thethis will be fataltext added in this release. Max is0x%s. Respect the max. π«Use of comma-less variable list is deprecated. Its use will be fatal in Perl 5.28β This existing warning has had theits use will be fataltext added in this release. Commas are your friend. π«ΆUse of inherited "AUTOLOAD" for non-method %s() is deprecated. This will be fatal in Perl 5.28β This existing warning has had thethis will be fataltext added in this release. Inherited"AUTOLOAD"for non-method%s()? Deprecated now, fatal in 5.28. πUse of strings with code points over 0xFF as arguments to %s operator is deprecated. This will be a fatal error in Perl 5.28β This existing warning has had thethis will be a fatal errortext added in this release. So code points over0xFF? Not for long. β οΈ
π οΈ Utility Changes π οΈ
The utilities got a little makeover. Some left, some got tidied, and one got unit tests. Let's go. π
c2ph and pstruct
- These old utilities have long since superceded by
h2xs, and are now gone from the distribution. So they're not here anymore. They've left the building. π
Porting/pod_lib.pl
- Removed spurious executable bit. No more random executable energy. π«
- Account for the possibility of DOS file endings. So it handles DOS endings now. π
Porting/sync-with-cpan
- Many improvements. Many. Improvements. Periodt. β¨
perf/benchmarks
- Tidy file, rename some symbols. It's giving organized. π
Porting/checkAUTHORS.pl
- Replace obscure character range with
"\w". So it's using"\w"now. Slay. π
t/porting/regen.t
- Try to be more helpful when tests fail. So when tests fail, it's more helpful. We love a supportive test. π«Ά
utils/h2xs.PL
- Avoid infinite loop for enums. No more infinite loop for enums. That's a win. π
perlbug
- Long lines in the message body are now wrapped at 900 characters, to stay well within the 1000-character limit imposed by SMTP mail transfer agents. This is particularly likely to be important for the list of arguments to Configure, which can readily exceed the limit if, for example, it names several non-default installation paths. This change also adds the first unit tests for perlbug.
[perl #128020] <https://rt.perl.org/Public/Bug/Display.html?id=128020>. So 900 characters, 1000 limit, SMTP, Configure args, non-default installation paths, first unit tests. All the tea. β
β¨ Configuration and Compilation β¨
okay bestie, buckle up, this is the part where we talk about building perl and all the little knobs you can twist π
-Ddefault_inc_excludes_dotwas added, and it's enabled by default. yes queen, it's just... on now π- the
dtracebuild process has more changes [GH #15718] β like, several, and they're all lowkey important:- if
-xnolibsis available, use it, so a dtrace perl can be built inside a FreeBSD jail π - on systems that build a dtrace object file (FreeBSD, Solaris, and SystemTap's dtrace emulation), copy the input objects to a separate directory, process them there, and use those objects in the link β because
dtrace -Galso modifies these objects, and we are not about to let it mess with the originals π€ - add libelf to the build on FreeBSD 10.x, since dtrace adds references to libelf symbols
- generate a dummy
dtrace_main.oifdtrace -Gfails to build it. here's the tea: a default build on Solaris generates probes from the unused inline functions, but on FreeBSD they don't, which causesdtrace -Gto fail. so, dummy file. problem solved π«Ά
- if
- you can now disable perl's use of the
PERL_HASH_SEEDandPERL_PERTURB_KEYSenvironment variables by configuring perl with-Accflags=NO_PERL_HASH_ENV - you can now disable perl's use of the
PERL_HASH_SEED_DEBUGenvironment variable by configuring perl with-Accflags=-DNO_PERL_HASH_SEED_DEBUG - Configure now zeroes out the alignment bytes when calculating the bytes for 80-bit
NaNandInf, so builds are more reproducible. [GH #15725] slay, reproducibility β¨ - since v5.18 we'd been shipping support for building perl with a whole bunch of non-standard, non-recommended hash functions β for testing purposes only, bestie, they were never the vibe. since we don't recommend them, they're gone, along with their build options. specifically, these build options are removed:
PERL_HASH_FUNC_SDBM
PERL_HASH_FUNC_DJB2
PERL_HASH_FUNC_SUPERFAST
PERL_HASH_FUNC_MURMUR3
PERL_HASH_FUNC_ONE_AT_A_TIME
PERL_HASH_FUNC_ONE_AT_A_TIME_OLD
PERL_HASH_FUNC_MURMUR_HASH_64A
PERL_HASH_FUNC_MURMUR_HASH_64B
- remove
Warning: perl appears in your pathβ this install warning is more or less obsolete anyway, since most platforms already have a/usr/bin/perlor similar handed to you by the OS π - reduce verbosity of
make install.manβ previously you got two progress messages per manpage: one from installman itself, and one from the function in install_lib.pl that it calls to actually install the file. killing the second one saves over 750 lines of unhelpful output. no cap, 750 π - cleanup for
clang -Weverythingsupport. [GH #15683] - Configure: the signbit scan was assuming too much β stop assuming negative 0. it's giving humble now π
- various compiler warnings have been silenced π€«
- several smaller changes have been made to remove impediments to compiling under C++11
- builds using
USE_PAD_RESETnow work again; this configuration had bit-rotted π - a probe for
gai_strerrorwas added to Configure that checks if thegai_strerror()routine is available and can be used to translate error codes returned bygetaddrinfo()into human readable strings π¦ - Configure now aborts if both
-Duselongdoubleand-Dusequadmathare requested. pick one, bestie. [GH #14944] - fixed a bug where Configure could append
-quadmathto the archname even if it was already there. [GH #15423] - Clang builds with
-DPERL_GLOBAL_STRUCTor-DPERL_GLOBAL_STRUCT_PRIVATEhave been fixed β by disabling Thread Safety Analysis for these configurations make_ext.plno longer updates a module'spm_to_blibfile when no files require updates. this could cause dependencies,perlmain.cin particular, to be rebuilt unnecessarily. [GH #15060]- the output of
perl -Vhas been reformatted so that each configuration and compile-time option is now listed one per line, for readability. finally, we can read it π - Configure now builds
miniperlandgenerate_uudmapif you invoke it with-Dusecrosscompilerbut not-Dtargethost=somehost. this means you can supply your target platformconfig.sh, generate the headers, and proceed to build your cross-target perl. [GH #15126] - perl built with
-Accflags=-DPERL_TRACE_OPSnow only dumps the operator counts when the environment variablePERL_TRACE_OPSis set to a non-zero integer. this letsmake testpass on such a build π - when building with GCC 6 and link-time optimization (the
-fltooption togcc), Configure was treating all probed symbols as present on the system, regardless of whether they actually exist. that has been fixed. [GH #15322] - the
t/test.pllibrary is used for internal testing of Perl itself, and also copied by several CPAN modules. some of those modules must work on older versions of Perl, sot/test.plmust in turn avoid newer Perl features. compatibility with Perl 5.8 was inadvertently removed some time ago; it has now been restored. [GH #15302] - the build process no longer emits an extra blank line before building each "simple" extension (those with only
*.pmand*.podfiles). bye blank line π
π§ͺ Testing π§ͺ
tests were added and changed to reflect all the other additions and changes in this release. and fr fr, these substantive changes were made too:
- a new test script,
comp/parser_run.t, has been added β it's likecomp/parser.tbut withtest.plincluded, so thatrunperl()and the like are available for use - tests for locales were erroneously using locales incompatible with Perl π¬
- some parts of the test suite that try to exhaustively test edge cases in the regex implementation have been restricted to running for a maximum of five minutes. on slow systems they could otherwise take several hours, without significantly improving our understanding of the correctness of the code under test. five minutes, that's the limit, periodt β±οΈ
- a new internal facility lets you analyse the time taken by the individual tests in Perl's own test suite; see
Porting/harness-timer-report.pl t/re/regexp_nonull.thas been added to test that the regular expression engine can handle scalars that do not have a null byte just past the end of the string- a new test script,
t/op/decl-refs.t, has been added to test the new feature "Declaring a reference to a variable" π«Ά - a new test script,
t/re/keep_tabs.t, has been added to contain tests where"\t"characters should not be expanded into spaces - a new test script,
t/re/anyof.t, has been added to test that the ANYOF nodes generated by bracketed character classes are as expected - there is now more extensive testing of the Unicode-related API macros and functions π
- several of the longer running API test files have been split into multiple test files so they can be run in parallel
t/harnessnow tries really hard not to run tests which are located outside of the Perl source tree. [GH #14578]- prevent debugger tests (
lib/perl5db.t) from failing due to the contents of$ENV{PERLDB_OPTS}. [GH #15782]
π₯οΈ Platform Support π₯οΈ
Okay bestie, this is where Perl gets cozy on literally every platform. Buckle up. π«Ά
π± New Platforms π±
NetBSD/VAX
Perl now compiles under NetBSD on VAX machines. That's iconic. But lowkey there's a catch: it's not possible for that platform to implement floating-point infinities and NaNs compatible with most modern systems, which implement the IEEE-754 floating point standard. The hexadecimal floating point ("0x...p[+-]n" literals, "printf %a") is not implemented, either. The "make test" passes 98% of tests. Not perfect, but slay.
- Test fixes and minor updates. β¨
- Account for lack of
"inf","nan", and-0.0support. π
π§ Platform-Specific Notes π§
Darwin
- Don't treat
-Dprefix=/usras special: instead require an extra option-Ddarwin_distributionto produce the same results. - OS X El Capitan doesn't implement the
clock_gettime()orclock_getres()APIs; emulate them as necessary. - Deprecated
syscall(2)on macOS 10.12.
EBCDIC
Several tests have been updated to work (or be skipped) on EBCDIC platforms. π
HP-UX
The Net::Ping UDP test is now skipped on HP-UX.
Hurd
The hints for Hurd have been improved, enabling malloc wrap and reporting the GNU libc used (previously it was an empty string when reported).
VAX
VAX floating point formats are now supported on NetBSD. π
VMS
- The path separator for the
PERL5LIBandPERLLIBenvironment entries is now a colon (:) when running under a Unix shell. There is no change when running under DCL (it's still|). configure.comnow recognizes the VSI-branded C compiler and no longer recognizes theDEC-branded C compiler (as there hasn't been such a thing for 15 or more years).
Windows
- Support for compiling perl on Windows using Microsoft Visual Studio 2015 (containing Visual C++ 14.0) has been added.
This version of VC++ includes a completely rewritten C run-time library, some of the changes in which mean that work done to resolve a socket close() bug in perl #120091 and perl #118059 is not workable in its current state with this version of VC++. Therefore, we have effectively reverted that bug fix for VS2015 onwards on the basis that being able to build with VS2015 onwards is more important than keeping the bug fix. We may revisit this in the future to attempt to fix the bug again in a way that is compatible with VS2015.
These changes do not affect compilation with GCC or with Visual Studio versions up to and including VS2013, i.e., the bug fix is retained (unchanged) for those compilers.
Note that you may experience compatibility problems if you mix a perl built with GCC or VS <= VS2013 with XS modules built with VS2015, or if you mix a perl built with VS2015 with XS modules built with GCC or VS <= VS2013. Some incompatibility may arise because of the bug fix that has been reverted for VS2015 builds of perl, but there may well be incompatibility anyway because of the rewritten CRT in VS2015 (e.g., see discussion at <http://stackoverflow.com/questions/30412951>).
- It now automatically detects GCC versus Visual C and sets the VC version number on Win32.
Linux
Drop support for Linux a.out executable format. Linux has used ELF for over twenty years. π§
OpenBSD 6
OpenBSD 6 still does not support returning pid, gid, or uid with SA_SIGINFO. Make sure to account for it.
FreeBSD
t/uni/overload.t: Skip hanging test on FreeBSD.
DragonFly BSD
DragonFly BSD now has support for setproctitle(). [GH #15703] <https://github.com/Perl/perl5/issues/15703>.
π Internal Changes π
Okay bestie, this is the guts section. The plumbing. The behind-the-scenes. And honestly? It ate. π
- A brand-new API function
sv_setpv_bufsize()is here, and it lets you set the length and the allocated size of the buffer inside anSVat the same time β and it'll grow the buffer if it needs to. Convenient fr fr. - A new API macro
SvPVCLEAR()sets itsSVargument to an empty string β think Perl-space$x = ''β but with a bunch of optimisations baked in. β¨ - Several new macros and functions for dealing with Unicode and UTF-8-encoded strings got added to the API, plus some changes in how existing functions behave. (Go read "Unicode Support" in perlapi for the full tea.) Here's the rundown:
- New versions of API macros like
isALPHA_utf8andtoLOWER_utf8exist now, each rocking a_safesuffix β likeisSPACE_utf8_safe. These take an extra parameter telling them the upper limit of how far into the string it's safe to read. Using the old versions could make you read past the end of the input buffer if the UTF-8 isn't well-formed, and using them now throws a deprecation warning. Full details live at "Character classification" in perlapi. - Macros like
isALPHA_utf8andtoLOWER_utf8now die if they catch their input UTF-8 being malformed. A deprecation warning had been getting issued about this since Perl 5.18, so likeβ¦ it's been building up to this. π - Several new macros for analysing whether utf8 sequences are valid. Behold:
- New versions of API macros like
UTF8_GOT_ABOVE_31_BIT UTF8_GOT_CONTINUATION UTF8_GOT_EMPTY UTF8_GOT_LONG UTF8_GOT_NONCHAR UTF8_GOT_NON_CONTINUATION UTF8_GOT_OVERFLOW UTF8_GOT_SHORT UTF8_GOT_SUPER UTF8_GOT_SURROGATE UTF8_IS_INVARIANT UTF8_IS_NONCHAR UTF8_IS_SUPER UTF8_IS_SURROGATE UVCHR_IS_INVARIANT isUTF8_CHAR_flags isSTRICT_UTF8_CHAR isC9_STRICT_UTF8_CHAR
- Then there's a whole squad of functions that are all extensions of the
is_utf8_string_*()functions, each applying different restrictions to what UTF-8 counts as valid:
is_strict_utf8_string, is_strict_utf8_string_loc, is_strict_utf8_string_loclen,
is_c9strict_utf8_string, is_c9strict_utf8_string_loc, is_c9strict_utf8_string_loclen,
is_utf8_string_flags, is_utf8_string_loc_flags, is_utf8_string_loclen_flags,
is_utf8_fixed_width_buf_flags, is_utf8_fixed_width_buf_loc_flags, is_utf8_fixed_width_buf_loclen_flags.
is_utf8_invariant_string. is_utf8_valid_partial_char. is_utf8_valid_partial_char_flags.
- The functions
utf8n_to_uvchrand its derivatives have had several behaviour changes:
Calling them while passing a string length of 0 is now asserted against in DEBUGGING builds, and otherwise it returns the Unicode REPLACEMENT CHARACTER. Basically: if you have nothing to decode, bestie, don't call the decode function. π
They now return the Unicode REPLACEMENT CHARACTER if they're called with UTF-8 that has the overlong malformation and that malformation is allowed by the input parameters. Overlong is when the UTF-8 looks syntactically valid, but a shorter sequence exists that yields the same code point. This has been forbidden since Unicode version 3.1, periodt.
They now accept an input flag to allow the overflow malformation. That's when the UTF-8 may be syntactically valid, but the code point it represents can't actually be represented in the word length on the platform. What "allowed" means here: the function doesn't return an error, and it advances the parse pointer past the UTF-8 in question, but it returns the Unicode REPLACEMENT CHARACTER as the value of the code point β because the real value just isn't representable. π
They no longer abandon the search for other malformations the moment they hit the first one. So a single call to one of these functions can generate multiple diagnostics instead of just one. She's thorough now. π
valid_utf8_to_uvchr()has been added to the API (though it was already hanging around in core earlier). It's likeutf8_to_uvchr_buf(), but it assumes the next character is well-formed. Use with caution, okay? π«Ά- A new function,
utf8n_to_uvchr_error, has been added for modules that need to know the details of UTF-8 malformations beyond just pass/fail. Before this, the only ways to find out why a sequence was ill-formed were to capture and parse the generated diagnostics, or to do your own analysis. Exhausting. - There's now a safer version of
utf8_hop(), calledutf8_hop_safe(). Unlikeutf8_hop(),utf8_hop_safe()won't navigate before the beginning or after the end of the supplied buffer. Boundaries! We love them. π - Two new functions,
utf8_hop_forward()andutf8_hop_back(), are similar toutf8_hop_safe()but exist for when you already know which direction you want to travel. - Two new macros which return useful utf8 byte sequences:
BOM_UTF8
REPLACEMENT_CHARACTER_UTF8
- Perl is now built with the
PERL_OP_PARENTcompiler define enabled by default. Want it off? Use thePERL_NO_OP_PARENTcompiler define. This flag alters how theop_siblingfield is used inOPstructures, and it's been available optionally since perl 5.22.
See "Internal Changes" in perl5220delta for more details on what this build option actually does.
- Three new ops β
OP_ARGELEM,OP_ARGDEFELEM, andOP_ARGCHECKβ have been added. They're intended principally to implement the individual elements of a subroutine signature, plus any overall checking required. Signatures are getting the glow-up they deserve. β¨ - The
OP_PUSHREop has been eliminated, and theOP_SPLITop has changed from classLISTOPtoPMOP.
Formerly, the first child of a split would be a pushre, with the split's regex attached to it. Now the regex is attached directly to the split op, and the pushre is gone. Cleanup era. π§
- The
op_class()API function has been added. It's like the existingOP_CLASS()macro, but it can more accurately determine what struct an op has been allocated as. For example,OP_CLASS()might return"OA_BASEOP_OR_UNOP", indicating that ops of this type are usually allocated as anOPorUNOP; whileop_class()will return"OPclass_BASEOP"or"OPclass_UNOP"as appropriate. Precision. π - All parts of the internals now agree that the
sassignop is aBINOP. Previously it was listed as aBASEOPinregen/opcodes, which meant several parts of the internals had to be special-cased just to accommodate it. That oddity's original motivation was to handle code like$x ||= 1; that's now handled in a simpler way. Character development. π± - The output format of the
op_dump()function (as used byperl -Dx) has changed: it now displays an "ASCII-art" tree structure, and shows more low-level details about each op, such as its address and class. It's giving art installation, honestly. π¨ - The
PADOFFSETtype has changed from being unsigned to signed, and several pad-related variables such asPL_padixhave changed from being of typeI32to typePADOFFSET. - The
DEBUGGING-mode output for regex compilation and execution has been enhanced. π₯ - Several obscure SV flags have been eliminated, sometimes along with the macros which manipulate them:
SVpbm_VALID,SVpbm_TAIL,SvTAIL_on,SvTAIL_off,SVrepl_EVAL,SvEVALED. Gone. Not invited to the function anymore. - An OP
op_privateflag has been eliminated:OPpRUNTIME. This used to often get set onPMOPops, but had become meaningless over time. RIP bozo, you meant nothing anymore. π
πΈ Selected Bug Fixes πΈ
The glow-up receipts. Every single one, no skips. π«Ά
- Perl no longer panics when switching into some locales on machines with buggy
strxfrm()implementations in their libc. [GH #13768]https://github.com/Perl/perl5/issues/13768 " $-{$name} "would leak anAVon each access if the regular expression had no named captures. Same deal applies to access to any hash tied withTie::Hash::NamedCaptureandall => 1. [GH #15882]https://github.com/Perl/perl5/issues/15882- Attempting to use the deprecated variable
$#as the object in an indirect object method call could cause a heap use after free or a buffer overflow. [GH #15599]https://github.com/Perl/perl5/issues/15599 - When checking for an indirect object method call, in some rare cases the parser could reallocate the line buffer but then keep using pointers into the old buffer. Rude. [GH #15585]
https://github.com/Perl/perl5/issues/15585 - Supplying a glob as the format argument to
formlinewould cause an assertion failure. [GH #15862]https://github.com/Perl/perl5/issues/15862 - Code like
" $value1 =~ qr/.../ ~~ $value2 "would have the match converted into aqr//operator, leaving extra elements on the stack to confuse any surrounding expression. [GH #15859]https://github.com/Perl/perl5/issues/15859 - Since v5.24, in some obscure cases, a regex which included code blocks from multiple sources (e.g., embedded via
qr//objects) could end up with the wrong current pad and crash or give weird results. [GH #15657]https://github.com/Perl/perl5/issues/15657 - Occasionally
local()s in a code block within a pattern weren't being undone when the pattern matching backtracked over the code block. [GH #15056]https://github.com/Perl/perl5/issues/15056 - Using
substr()to modify a magic variable could access freed memory in some cases. [GH #15871]https://github.com/Perl/perl5/issues/15871 - Under
use utf8, the entire source code is now checked for being UTF-8 well formed β not just quoted strings like before. [GH #14973]https://github.com/Perl/perl5/issues/14973. - The range operator
..on strings now handles its arguments correctly when in the scope of theunicode_stringsfeature. The previous behaviour was so unexpected that we believe no correct program could have made use of it. Like, nobody was relying on that, bestie. - The
splitoperator did not ensure enough space was allocated for its return value in scalar context. It could then write a single pointer immediately beyond the end of the memory block allocated for the stack. π [GH #15749]https://github.com/Perl/perl5/issues/15749 - Using a large code point with the
Wpack template character with the current output position aligned at just the right point could cause a write of a single zero byte immediately beyond the end of an allocated buffer. The audacity. [GH #15572]https://github.com/Perl/perl5/issues/15572
- bestie if you supply a format's picture argument as part of the format argument list, and that picture specifies modifying the argument, you could end up touching the newly-freed compiled format. access-after-free, we don't stan.
[GH #15566]<https://github.com/Perl/perl5/issues/15566> - the
sort()operator's built-in numeric comparison function was NOT handling big integers that a double can't represent exactly. it now uses the exact same code that implements the<=>operator, so it's giving consistency.[GH #15768]<https://github.com/Perl/perl5/issues/15768> - fixed the issues with
/(?{ ... <<EOF })/that were breaking Method::Signatures. Method::Signatures said "not today" and honestly valid.[GH #15779]<https://github.com/Perl/perl5/issues/15779> - fixed an assertion failure with
chopandchomp, which you could trigger withchop(@x =~ tr/1/1/). cursed one-liner, iconic energy.[GH #15738]<https://github.com/Perl/perl5/issues/15738>. - fixed a comment-skipping error in patterns under
/xβ it could stop skipping one byte too early, and that byte could land smack in the middle of a UTF-8 character. π[GH #15790]<https://github.com/Perl/perl5/issues/15790>. perldbnow ignores/dev/ttyon non-Unix systems.[GH #12244]<https://github.com/Perl/perl5/issues/12244>;- fixed an assertion failure for
{}->$xwhen$xisn't defined.[GH #15791]<https://github.com/Perl/perl5/issues/15791>. - fixed an assertion error that could be triggered when a lookahead string in patterns exceeded a minimum length.
[GH #15796]<https://github.com/Perl/perl5/issues/15796>. - you now only get warned once per literal number about a misplaced
_. not ten times. we're healed.[GH #9989]<https://github.com/Perl/perl5/issues/9989>. - the
tr///parse code could be looking at uninitialized data after a parse error. no ma'am.[GH #15624]<https://github.com/Perl/perl5/issues/15624>. - in a pattern match, a back-reference (
\1) to an unmatched capture could read back beyond the start of the string being matched. that's a big yikes.[GH #15634]<https://github.com/Perl/perl5/issues/15634>. - so
use re 'strict'is supposed to warn you if you use a range (like/(?[ [ X-Y ] ])/) whose start and end digit aren't from the same group of 10. it just⦠wasn't doing that for five groups of mathematical digits starting atU+1D7E. now it does. justice for the math digits - a sub containing a
forwarddeclaration with the same name (likesub c { sub c; }) could sometimes crash or loop infinitely.[GH #15557]<https://github.com/Perl/perl5/issues/15557> - a crash in executing a regex with a non-anchored UTF-8 substring against a target string that also used UTF-8? fixed.
[GH #15628]<https://github.com/Perl/perl5/issues/15628> - previously a shebang line like
#!perl -i ucould be erroneously read as requesting the-uoption. fixed now.[GH #15623]<https://github.com/Perl/perl5/issues/15623> - the regex engine was producing incorrect results in some rare situations when backtracking past an alternation that matches only one thing. it showed up as capture buffers (
$1,$2, etc.) erroneously holding data from regex execution paths that weren't actually executed for the final match. ghost data fr.[GH #15666]<https://github.com/Perl/perl5/issues/15666> - certain regexes using the experimental
regex_setsfeature could trigger an assertion failure. fixed.[GH #15620]<https://github.com/Perl/perl5/issues/15620> - invalid assignments to a reference constructor (e.g.
\eval=time) could sometimes crash on top of giving a syntax error. double homicide.[GH #14815]<https://github.com/Perl/perl5/issues/14815> - the parser could sometimes crash if a bareword came after
evalbytes.[GH #15586]<https://github.com/Perl/perl5/issues/15586> - autoloading via a method call would erroneously warn ("Use of inherited AUTOLOAD for non-method") if there was a stub present in the package into which the invocant had been blessed. that warning is no longer emitted in such circumstances.
[GH #9094]<https://github.com/Perl/perl5/issues/9094> - using
spliceon arrays with non-existent elements could cause other operators to crash. the audacity.[GH #15577]<https://github.com/Perl/perl5/issues/15577> - a possible buffer overrun when a pattern contains a fixed utf8 substring.
[GH #15534]<https://github.com/Perl/perl5/issues/15534> - fixed two possible use-after-free bugs in perl's lexer. two!!
[GH #15549]<https://github.com/Perl/perl5/issues/15549> - fixed a crash with
s///lwhere it thought it was dealing with UTF-8 when it wasn't. delulu.[GH #15543]<https://github.com/Perl/perl5/issues/15543> - fixed a place where the regex parser was not setting the syntax error correctly on a syntactically incorrect pattern.
[GH #15565]<https://github.com/Perl/perl5/issues/15565> - the
&.operator (and the&operator, when it treats its arguments as strings) were failing to append a trailing null byte if at least one string was marked as utf8 internally. and here's the thing β lots of code paths (system calls, regexp compilation) still expect there to be a null byte in the string buffer just past the end of the logical string. so the result was an assertion failure.[GH #15606]<https://github.com/Perl/perl5/issues/15606> - avoided a heap-after-use error in the parser when creating an error message for a syntactically invalid heredoc.
[GH #15527]<https://github.com/Perl/perl5/issues/15527> - fixed a segfault when run with
-DCoptions on DEBUGGING builds.[GH #15563]<https://github.com/Perl/perl5/issues/15563> - fixed the parser error handling in subroutine attributes for an
":attr(foo"that does not have an ending")". - fixed the perl lexer to correctly handle a backslash as the last char in quoted-string context. this actually fixed two bugs,
[GH #15546]<https://github.com/Perl/perl5/issues/15546>and[GH #15582]<https://github.com/Perl/perl5/issues/15582>. - in the API function
gv_fetchmethod_pvn_flags, reworked the separator parsing to prevent a possible string overrun with an invalidlenargument.[GH #15598]<https://github.com/Perl/perl5/issues/15598> - problems with in-place array sorts: code like
@a = sort { ... } @a, where the source and destination of the sort are the same plain array, gets optimised to do less copying around. two side-effects of that optimisation were (1) the contents of@aas seen by sort routines were partially sorted, and (2) under some circumstances accessing@aduring the sort could crash the interpreter. both are fixed now, and sort functions see the original value of@a.[GH #15387]<https://github.com/Perl/perl5/issues/15387> - non-ASCII string delimiters are now reported correctly in error messages for unterminated strings.
[GH #15469]<https://github.com/Perl/perl5/issues/15469> pack("p", ...)used to emit its warning ("Attempt to pack pointer to temporary value") erroneously in some cases. fixed.@DB::argsis now exempt from "used once" warnings. ngl those warnings only ever happened under-w, because warnings.pm itself uses@DB::argsmultiple times.@DB::argswas being profiled for no reason.[GH #15469]-adjacent behaviour, but honestly the exemption is the moment.- using built-in arrays or hash slices in a double-quoted string no longer issues a warning ("Possible unintended interpolation...") if the variable has not been mentioned before. this affected code like
qq|@DB::args|andqq|@SIG{'CHLD', 'HUP'}|. (the special variables@-and@+were already exempt from the warning.) π«Ά gethostentand similar functions now perform a null check internally, to avoid crashing with the torsocks library. this was a regression from v5.22.[GH #15478]<https://github.com/Perl/perl5/issues/15478>defined *{'!'},defined *{'['}, anddefined *{'-'}no longer leak memory if the typeglob in question has never been accessed before. β¨- mentioning the same constant twice in a row (which is a syntax error) no longer fails an assertion under debugging builds. this was a regression from v5.20.
[GH #15017]<https://github.com/Perl/perl5/issues/15017> - many issues relating to
printf "%a"of hexadecimal floating point were fixed. also, the "subnormals" (formerly known as "denormals") floating point numbers are now supported both with the plain IEEE 754 floating point numbers (64-bit or 128-bit) and the x86 80-bit "extended precision". note that subnormal hexadecimal floating point literals will give a warning about "exponent underflow".[GH #15495]<https://github.com/Perl/perl5/issues/15495>[GH #15503]<https://github.com/Perl/perl5/issues/15503>[GH #15504]<https://github.com/Perl/perl5/issues/15504>[GH #15505]<https://github.com/Perl/perl5/issues/15505>[GH #15510]<https://github.com/Perl/perl5/issues/15510>[GH #15512]<https://github.com/Perl/perl5/issues/15512> - a regression in v5.24 with
tr/\N{U+...}/foo/when the code point was between 128 and 255 has been fixed.[GH #15475]<https://github.com/Perl/perl5/issues/15475>. - use of a string delimiter whose code point is above
2**31now works correctly on platforms that allow this. previously, certain characters, due to truncation, would get confused with other delimiter characters that have special meaning (such as?inm?...?), resulting in inconsistent behaviour. note that this is non-portable, and is based on Perl's extension to UTF-8, and is probably not displayable nor enterable by any editor.[GH #15477]<https://github.com/Perl/perl5/issues/15477> @{xfollowed by a newline, wherexrepresents a control or non-ASCII character, no longer produces a garbled syntax error message or a crash.[GH #15518]<https://github.com/Perl/perl5/issues/15518>- an assertion failure with
%: = 0has been fixed.[GH #15358]<https://github.com/Perl/perl5/issues/15358> - okay history lesson: in Perl 5.18, the parsing of
$foo::$barwas accidentally changed, such that it would be treated as$foo."::".$bar. the previous behavior β parsing it as$foo:: . $barβ has been restored.[GH #15408]<https://github.com/Perl/perl5/issues/15408> - and since Perl 5.20, line numbers had been off by one when perl is invoked with the
-xswitch. fixed. one whole line. every time.[GH #15413]<https://github.com/Perl/perl5/issues/15413> - Vivifying a subroutine stub in a deleted stash (e.g.,
delete $My::{"Foo::"}; \&My::Foo::foo) no longer crashes. It had begun crashing in Perl 5.18.[GH #15420] <https://github.com/Perl/perl5/issues/15420>π - Some obscure cases of subroutines and file handles being freed at the same time could result in crashes, but have been fixed. The crash was introduced in Perl 5.22.
[GH #15435] <https://github.com/Perl/perl5/issues/15435>π«Ά - Code that looks for a variable name associated with an uninitialized value could cause an assertion failure in cases where magic is involved, such as
"$ISA[0][0]". This has now been fixed.[GH #15364] <https://github.com/Perl/perl5/issues/15364>β¨ - A crash caused by code generating the warning
"Subroutine STASH::NAME redefined"in cases such assub P::f{} undef *P::; *P::f =sub{};has been fixed. In these cases, where the STASH is missing, the warning will now appear as"Subroutine NAME redefined".[GH #15368] <https://github.com/Perl/perl5/issues/15368>π - Fixed an assertion triggered by some code that handles deprecated behavior in formats, e.g., in cases like this:
format STDOUT =
@
0"$x"
[GH #15366] <https://github.com/Perl/perl5/issues/15366> π
- A possible divide by zero in string transformation code on Windows has been avoided, fixing a crash when collating an empty string.
[GH #15439] <https://github.com/Perl/perl5/issues/15439>π₯ - Some regular expression parsing glitches could lead to assertion failures with regular expressions such as
"/(?<=/"and"/(?<!/". This has now been fixed.[GH #15332] <https://github.com/Perl/perl5/issues/15332>πΈ " until ($x = 1) { ... } "and" ... until $x = 1 "now properly warn when syntax warnings are enabled.[GH #15138] <https://github.com/Perl/perl5/issues/15138>πsocket()now leaves the error code returned by the system in$!on failure.[GH #15383] <https://github.com/Perl/perl5/issues/15383>π- Assignment variants of any bitwise ops under the
"bitwise"feature would crash if the left-hand side was an array or hash.[GH #15346] <https://github.com/Perl/perl5/issues/15346>π¦ "require"followed by a single colon (as in"foo() ? require : ...") is now parsed correctly as"require"with implicit$_, rather than"require """.[GH #15380] <https://github.com/Perl/perl5/issues/15380>π- Scalar
"keys %hash"can now be assigned to consistently in all scalar lvalue contexts. Previously it worked for some contexts but not others. π - List assignment to
"vec"or"substr"with an array or hash for its first argument used to result in crashes or"Can't coerce"error messages at run time, unlike scalar assignment, which would give an error at compile time. List assignment now gives a compile-time error, too.[GH #15370] <https://github.com/Perl/perl5/issues/15370>β - Expressions containing an
"&&"or"||"operator (or their synonyms"and"and"or") were being compiled incorrectly in some cases. If the left-hand side consisted of either a negated bareword constant or a negated"do {}"block containing a constant expression, and the right-hand side consisted of a negated non-foldable expression, one of the negations was effectively ignored. The same was true of"if"and"unless"statement modifiers, though with the left-hand and right-hand sides swapped. This long-standing bug has now been fixed.[GH #15285] <https://github.com/Perl/perl5/issues/15285>π "reset"with an argument no longer crashes when encountering stash entries other than globs.[GH #15314] <https://github.com/Perl/perl5/issues/15314>π§- Assignment of hashes to, and deletion of, typeglobs named
*::::::no longer causes crashes.[GH #15307] <https://github.com/Perl/perl5/issues/15307>π - Perl wasn't correctly handling true/false values in the LHS of a list assign; specifically the truth values returned by boolean operators. This could trigger an assertion failure in something like the following:
for ($x > $y) {
($_, ...) = (...); # here $_ is aliased to a truth value
}
This was a regression from v5.24. [GH #15690] <https://github.com/Perl/perl5/issues/15690> π
- Assertion failure with user-defined Unicode-like properties.
[GH #15696] <https://github.com/Perl/perl5/issues/15696>π - Fix error message for unclosed
"\N{"in a regex. An unclosed"\N{"could give the wrong error message:"\N{NAME} must be resolved by the lexer". π οΈ - List assignment in list context where the LHS contained aggregates and where there were not enough RHS elements, used to skip scalar lvalues. Previously,
"(($a,$b,@c,$d) = (1))"in list context returned"($a)"; now it returns"($a,$b,$d)"."(($a,$b,$c) = (1))"is unchanged: it still returns"($a,$b,$c)". This can be seen in the following:
sub inc { $_++ for @_ }
inc(($a,$b,@c,$d) = (10))
Formerly, the values of "($a,$b,$d)" would be left as "(11,undef,undef)"; now they are "(11,1,1)". β¨
- Code like this:
"/(?{ s!!! })/"could trigger infinite recursion on the C stack (not the normal perl stack) when the last successful pattern in scope is itself. We avoid the segfault by simply forbidding the use of the empty pattern when it would resolve to the currently executing pattern.[GH #15669] <https://github.com/Perl/perl5/issues/15669>π₯ - Avoid reading beyond the end of the line buffer in perl's lexer when there's a short UTF-8 character at the end.
[GH #15531] <https://github.com/Perl/perl5/issues/15531>πΈ - Alternations in regular expressions were sometimes failing to match a utf8 string against a utf8 alternate.
[GH #15680] <https://github.com/Perl/perl5/issues/15680>π¦ - Make
"do "a\0b""fail silently (and return"undef"and set$!) instead of throwing an error.[GH #15676] <https://github.com/Perl/perl5/issues/15676>π "chdir"with no argument didn't ensure that there was stack space available for returning its result.[GH #15569] <https://github.com/Perl/perl5/issues/15569>π- All error messages related to
"do"now refer to"do"; some formerly claimed to be from"require"instead. π - Executing
"undef $x"where$xis tied or magical no longer incorrectly blames the variable for an uninitialized-value warning encountered by the tied/magical code. π§ - Code like
"$x = $x . "a""was incorrectly failing to yield a use of uninitialized value warning when$xwas a lexical variable with an undefined value. That has now been fixed.[GH #15269] <https://github.com/Perl/perl5/issues/15269>β "undef *_; shift"or"undef *_; pop"inside a subroutine, with no argument to"shift"or"pop", began crashing in Perl 5.14, but has now been fixed. π"string$scalar->$*"now correctly prefers concatenation overloading to string overloading if"$scalar->$*"returns an overloaded object, bringing it into consistency with$$scalar. π"/@0{0*->@*/*0"and similar contortions used to crash, but no longer do, but merely produce a syntax error.[GH #15333] <https://github.com/Perl/perl5/issues/15333>π"do"or"require"with an argument which is a reference or typeglob which, when stringified, contains a null character, started crashing in Perl 5.20, but has now been fixed.[GH #15337] <https://github.com/Perl/perl5/issues/15337>π₯- Improve the error message for a missing
tie()package/method. This brings the error messages in line with the ones used for normal method calls. π - Parsing bad POSIX charclasses no longer leaks memory.
[GH #15382] <https://github.com/Perl/perl5/issues/15382>π
π¨ Known Problems π¨
- G++ 6 handles subnormal (denormal) floating point values differently than gcc 6 or g++ 5 resulting in
"flush-to-zero". The end result is that if you specify very small values using the hexadecimal floating point format, like"0x1.fffffffffffffp-1022", they become zeros.[GH #15990] <https://github.com/Perl/perl5/issues/15990>π
π Errata From Previous Releases π
- Fixed issues with recursive regexes. The behavior was fixed in Perl 5.24.
[GH #14935] <https://github.com/Perl/perl5/issues/14935>β¨
ποΈ Obituary ποΈ
Jon Portnoy (AVENJ), a prolific Perl author and admired Gentoo community member, has passed away on August 10, 2016. He will be remembered and missed by all those who he came in contact with, and enriched with his intellect, wit, and spirit. ποΈπ
It is with great sadness that we also note Kip Hampton's passing. Probably best known as the author of the Perl & XML column on XML.com, he was a core contributor to AxKit, an XML server platform that became an Apache Foundation project. He was a frequent speaker in the early days at OSCON, and most recently at YAPC::NA in Madison. He was frequently on irc.perl.org as ubu, generally in the #axkit-dahut community, the group responsible for YAPC::NA Asheville in 2011. π
Kip and his constant contributions to the community will be greatly missed. π
π Acknowledgements π
okay bestie, sit down for this one because the numbers are stunning. Perl 5.26.0 represents approximately 13 months of development since Perl 5.24.0 and contains approximately 360,000 lines of changes across 2,600 files from 86 authors. that's not a release, that's a movement. β¨
Excluding auto-generated files, documentation and release tools, there were approximately 230,000 lines of changes to 1,800 .pm, .t, .c and .h files. no cap. that's so much code. π
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.26.0:
Aaron Crane, Abigail, Γvar ArnfjΓΆrΓ° Bjarmason, Alex Vandiver, Andreas KΓΆnig, Andreas Voegele, Andrew Fresh, Andy Lester, Aristotle Pagaltzis, Chad Granum, Chase Whitener, Chris 'BinGOs' Williams, Chris Lamb, Christian Hansen, Christian Millour, Colin Newell, Craig A. Berry, Dagfinn Ilmari MannsΓ₯ker, Dan Collins, Daniel Dragan, Dave Cross, Dave Rolsky, David Golden, David H. Gutteridge, David Mitchell, Dominic Hargreaves, Doug Bell, E. Choroba, Ed Avis, Father Chrysostomos, FranΓ§ois Perrad, Hauke D, H.Merijn Brand, Hugo van der Sanden, Ivan Pozdeev, James E Keenan, James Raspass, Jarkko Hietaniemi, Jerry D. Hedden, Jim Cromie, J. Nick Koston, John Lightsey, Karen Etheridge, Karl Williamson, Leon Timmermans, Lukas Mai, Matthew Horsfall, Maxwell Carey, Misty De Meo, Neil Bowers, Nicholas Clark, Nicolas R., Niko Tyni, Pali, Paul Marquess, Peter Avalos, Petr PΓsaΕ, Pino Toscano, Rafael Garcia-Suarez, Reini Urban, Renee Baecker, Ricardo Signes, Richard Levitte, Rick Delaney, Salvador FandiΓ±o, Samuel Thibault, Sawyer X, SΓ©bastien Aperghis-Tramoni, Sergey Aleynikov, Shlomi Fish, Smylers, Stefan Seifert, Steffen MΓΌller, Stevan Little, Steve Hay, Steven Humphrey, Sullivan Beck, Theo Buehler, Thomas Sibley, Todd Rinaldo, Tomasz Konojacki, Tony Cook, Unicode Consortium, Yaroslav Kuzmin, Yves Orton, Zefram.
look at that list. literal icons, every single one. π
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. π (if that's you: we see you, we love you, you're the main character fr)
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 π
If you find what you think is a bug, you might check the perl bug database at <https://rt.perl.org/>. There may also be information at <http://www.perl.org/>, the Perl Home Page. go lurk, it's fine, everyone does it
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.
bestie. tiny but sufficient test case. that's the whole assignment. a 400-line dump of your app is not it, and a one-liner that doesn't reproduce is also not it. give them the little one that still breaks. π
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. security stuff does NOT go in the public tracker, periodt. π
π«Ά Give Thanks π«Ά
If you wish to thank the Perl 5 Porters for the work we had done in Perl 5, you can do so by running the perlthanks program:
perlthanks
This will send an email to the Perl 5 Porters list with your show of thanks. it's giving gratitude, it's giving community, it's giving "you ate and I'm telling you" π
β¨ SEE ALSO β¨
- The
Changesfile for an explanation of how to view exhaustive details on what changed. - The
INSTALLfile for how to build Perl. - The
READMEfile for general stuff. - The
ArtisticandCopyingfiles for copyright information.
and that's a wrap on PERL5260DELTA(1), bestie!! π this lil doc is perl v5.42.3, dated 2026-08-03 β so if you're reading it, you're reading something that's been lovingly maintained way past the release it's talking about, which is honestly so on brand for Perl. π go write something weird in Perl. I believe in you. mwah. π
πΈ
π¦ where this page comes from
- fedora 43: perl-doc 5.42.3-524.fc43 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND Unicode-3.0 AND LicenseRef-Fedora-UltraPermissive
- fedora 44: perl-doc 5.42.3-525.fc44 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND Unicode-3.0 AND LicenseRef-Fedora-UltraPermissive
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms