PERL5360DELTA(1)
π NAME π
perl5360delta β what is new for perl v5.36.0. Also, bestie, this is the Perl Programmers Reference Guide page, so you're in the right place.
πΈ DESCRIPTION πΈ
This document describes differences between the 5.34.0 release and the 5.36.0 release.
β¨ Core Enhancements β¨
π
"use v5.36"
As always, "use v5.36" turns on the feature bundle for that version of Perl.
The 5.36 bundle enables the "signatures" feature. Introduced in Perl version 5.20.0, and modified several times since, the subroutine signatures feature is now no longer considered experimental. It is now considered a stable language feature and no longer prints a warning.
use v5.36;
sub add ($x, $y) {
return $x + $y;
}
Despite this, certain elements of signatured subroutines remain experimental; see below.
The 5.36 bundle enables the "isa" feature. Introduced in Perl version 5.32.0, this operator has remained unchanged since then. The operator is now considered a stable language feature. For more detail see "Class Instance Operator" in perlop.
The 5.36 bundle also disables the features "indirect", and "multidimensional". These will forbid, respectively: the use of "indirect" method calls (like $x = new Class;); the use of a list expression as a hash key to simulate sparse multidimensional arrays. The specifics of these changes can be found in feature, but the short version is: this is a bit like having more "use strict" turned on, disabling features that cause more trouble than they're worth.
Furthermore, "use v5.36" will also enable warnings as if you'd written "use warnings".
Finally, with this release, the experimental "switch" feature, present in every feature bundle since they were introduced in v5.10, has been removed from the v5.36 bundle. If you want to use it (against our advice), you'll have to enable it explicitly.
π -g command-line flag
A new command-line flag, -g, is available. It is a simpler alias for -0777.
For more information, see "-g" in perlrun.
π Unicode 14.0 is supported
See https://www.unicode.org/versions/Unicode14.0.0/ for details.
π¦ regex sets are no longer considered experimental
Prior to this release, the regex sets feature (officially named "Extended Bracketed Character Classes") was considered experimental. Introduced in Perl version 5.18.0, and modified several times since, this is now considered a stable language feature and its use no longer prints a warning. See "Extended Bracketed Character Classes" in perlrecharclass.
π§ Variable length lookbehind is mostly no longer considered experimental
Prior to this release, any form of variable length lookbehind was considered experimental. With this release the experimental status has been reduced to cover only lookbehind that contains capturing parenthesis. This is because it is not clear if
"aaz"=~/(?=z)(?<=(a|aa))/
should match and leave $1 equaling "a" or "aa". Currently it will match the longest possible alternative, "aa". While we are confident that the overall construct will now match only when it should, we are not confident that we will keep the current "longest match" behavior.
π₯ SIGFPE no longer deferred
Floating-point exceptions are now delivered immediately, in the same way as other "fault"-like signals such as SIGSEGV. This means one has at least a chance to catch such a signal with a $SIG{FPE} handler, e.g. so that "die" can report the line in perl that triggered it.
π Stable boolean tracking
The "true" and "false" boolean values, often accessed by constructions like "!!0" and "!!1", as well as being returned from many core functions and operators, now remember their boolean nature even through assignment into variables. The new function is_bool() in builtin can check whether a value has boolean nature.
This is likely to be useful when interoperating with other languages or data-type serialisation, among other places.
π iterating over multiple values at a time (experimental)
You can now iterate over multiple values at a time by specifying a list of lexicals within parentheses. For example,
for my ($key, $value) (%hash) { ... }
for my ($left, $right, $gripping) (@moties) { ... }
Prior to perl v5.36, attempting to specify a list after "for my" was a syntax error.
This feature is currently experimental and will cause a warning of category "experimental::for_list". For more detail see "Compound Statements" in perlsyn. See also "builtin::indexed" in this document, which is a handy companion to n-at-a-time foreach.
π builtin functions (experimental)
A new core module builtin has been added, which provides documentation for new always-present functions that are built into the interpreter.
say "Reference type of arrays is ", builtin::reftype([]);
It also provides a lexical import mechanism for providing short name versions of these functions.
use builtin 'reftype';
say "Reference type of arrays is ", reftype([]);
This builtin function mechanism and the functions it provides are all currently experimental. We expect that "builtin" itself will cease to be experimental in the near future, but that individual functions in it may become stable on an ongoing basis. Other functions will be added to "builtin" over time.
For details, see builtin, but here's a summary of builtin functions in v5.36:
πΈ builtin::trim
This function treats its argument as a string, returning the result of removing all white space at its beginning and ending.
π builtin::indexed
This function returns a list twice as big as its argument list, where each item is preceded by its index within that list. This is primarily useful for using the new "foreach" syntax with multiple iterator variables to iterate over an array or list, while also tracking the index of each item:
use builtin 'indexed';
foreach my ($index, $val) (indexed @array) {
...
}
π« builtin::true, builtin::false, builtin::is_bool
"true" and "false" return boolean true and false values. Perl is still perl, and doesn't have strict typing of booleans, but these values will be known to have been created as booleans. "is_bool" will tell you whether a value was known to have been created as a boolean.
π«Ά builtin::weaken, builtin::unweaken, builtin::is_weak
These functions will, respectively: weaken a reference; strengthen a reference; and return whether a reference is weak. (A weak reference is not counted for garbage collection purposes. See perlref.) These can take the place of some similar routines in Scalar::Util.
π builtin::blessed, builtin::refaddr, builtin::reftype
These functions provide more data about references (or non-references, actually!) and can take the place of similar routines found in Scalar::Util.
β¨ builtin::ceil, builtin::floor
"ceil" returns the smallest integer greater than or equal to its argument. "floor" returns the largest integer less than or equal to its argument. These can take the place of similar routines found in POSIX.
π¦ "defer" blocks (experimental)
This release adds support for "defer" blocks, which are blocks of code prefixed by the "defer" modifier. They provide a section of code which runs at a later time, during scope exit.
In brief, when a "defer" block is reached at runtime, its body is set aside to be run when the enclosing scope is exited. It is unlike a UNITCHECK (among other reasons) in that if the block containing the "defer" block is exited before the block is reached, it will not be run.
"defer" blocks can be used to take the place of "scope guard" objects where an object is passed a code block to be run by its destructor.
For more information, see "defer blocks" in perlsyn.
π try/catch can now have a "finally" block (experimental)
The experimental "try"/"catch" syntax has been extended to support an optional third block introduced by the "finally" keyword.
try {
attempt();
print "Success\n";
}
catch ($e) {
print "Failure\n";
}
finally {
print "This happens regardless\n";
}
This provides code which runs at the end of the "try"/"catch" construct, even if aborted by an exception or control-flow keyword. They are similar to "defer" blocks.
For more information, see "Try Catch Exception Handling" in perlsyn.
π§ non-ASCII delimiters for quote-like operators (experimental)
Perl traditionally has allowed just four pairs of string/pattern delimiters: "( )" "{ }" "[ ]" and "< >", all in the ASCII range. Unicode has hundreds more possibilities, and using this feature enables many of them. When enabled, you can say "qrΒ« Β»" for example, or "use utf8; qπstringπ". See "The 'extra_paired_delimiters' feature" in feature for details.
π @_ is now experimental within signatured subs
Even though subroutine signatures are now stable, use of the legacy arguments array (@_) with a subroutine that has a signature remains experimental, with its own warning category. Silencing the "experimental::signatures" warning category is not sufficient to dismiss this. The new warning is emitted with the category name "experimental::args_array_with_signatures".
Any subroutine that has a signature and tries to make use of the defaults argument array or an element thereof (@_ or $_[INDEX]), either explicitly or implicitly (such as "shift" or "pop" with no argument) will provoke a warning at compile-time:
use v5.36;
sub f ($x, $y = 123) {
say "The first argument is $_[0]";
}
Use of @_ in array element with signatured subroutine is experimental
at file.pl line 4.
The behaviour of code which attempts to do this is no longer specified, and may be subject to change in a future version.
π₯ Incompatible Changes π₯
π¨ A physically empty sort is now a compile-time error
@a = sort @empty; # unaffected
@a = sort; # now a compile-time error
@a = sort (); # also a compile-time error
A bare sort used to be a weird way to create an empty list; now it croaks at compile time. This change is intended to free up some of the syntax space for possible future enhancements to "sort".
π DEPRECATIONS π
π "use VERSION" (where VERSION is below v5.11) after "use v5.11" is deprecated π
Okay bestie, listen up. When you're in the scope of use v5.11 or later, and then you hit a use vX line where X is lower than v5.11? It's gonna warn you now. Like:
Downgrading a use VERSION declaration to below v5.11 is deprecated
For example:
use v5.14;
say "The say statement is permitted";
use v5.8; # This will print a warning
print "We must use print\n";
Why tho? Because the Perl team is literally planning to change how this works. Since Perl v5.12 (and some bits of v5.11), strict is enabled unless it was previously disabled. In other words:
no strict;
use v5.12; # will not enable strict, because "no strict" preceded it
$x = 1; # permitted, despite no "my" declaration
In the future, this behavior will be eliminated and use VERSION will always enable strict for versions v5.12 and later. Periodt.
So if you're out here mixing versions like that, you should use lexical scoping with block syntax to keep those differently versioned regions lexically isolated. Like this:
{
use v5.14;
say "The say statement is permitted";
}
{
use v5.8; # No warning is emitted
print "We must use print\n";
}
And honestly? This is probably not something you ever need to do! If the first block compiles, it means you're using perl v5.14.0 or later. So slay, but also chill.
β‘ PERFORMANCE ENHANCEMENTS β‘
- We now probe for compiler support for C11 thread local storage, and where available use this for
"implicit context"for XS extensions making API calls for a threaded Perl build. This requires fewer function calls at the C level than POSIX thread specific storage. We continue to use the pthreads approach if the C11 approach is not available.
Configure run with the defaults will build an unthreaded Perl (which is slightly faster), but most operating systems ship a threaded Perl.
- Perl can now be configured to no longer allocate keys for large hashes from the shared string table.
The same internal datatype (PVHV) is used for all of
- Symbol tables
- Objects (by default)
- Associative arrays
The shared string table was originally added to improve performance for blessed hashes used as objects, because every object instance has the same keys, so it is an optimisation to share memory between them. It also makes sense for symbol tables, where derived classes will have the same keys (typically method names), and the OP trees built for method calls can also share memory. The shared string table behaves roughly like a cache for hash keys.
But for hashes actually used as associative arrays β mapping keys to values β typically the keys are not re-used in other hashes. For example, "seen" hashes are keyed by object IDs (or addresses), and logically these keys won't repeat in other hashes.
Storing these "used just once" keys in the shared string table increases CPU and RAM use for no gain. For such keys the shared string table behaves as a cache with a 0% hit rate. Storing all the keys there increases the total size of the shared string table, as well as increasing the number of times it is resized as it grows. Worse β in any environment that has "copy on write" memory for child process (such as a pre-forking server), the memory pages used for the shared string table rapidly need to be copied as the child process manipulates hashes. Hence if most of the shared string table is such that keys are used only in one place, there is no benefit from re-use within the perl interpreter, but a high cost due to more pages for the OS to copy.
The perl interpreter can now be Configured to disable shared hash keys for "large" hashes (that are neither objects nor symbol tables). To do so, add -Accflags='-DPERL_USE_UNSHARED_KEYS_IN_LARGE_HASHES' to your Configure options. "Large" is a heuristic β currently the heuristic is that sharing is disabled when adding a key to a hash triggers allocation of more storage, and the hash has more than 42 keys.
This might cause slightly increased memory usage for programs that create (unblessed) data structures that contain multiple large hashes that share the same keys. But generally our testing suggests that for the specific cases described it is a win, and other code is unaffected.
- In certain scenarios, creation of new scalars is now noticeably faster.
For example, the following code is now executing ~30% faster:
$str = "A" x 64;
for (0..1_000_000) {
@svs = split //, $str
}
(You can read more about this one in [perl #19414] <https://github.com/Perl/perl5/pull/19414>.)
β¨ okay that's the tea for this part, more coming bestie β¨
π Modules and Pragmata π
Okay bestie, this is the part where literally everything in the toolbox got a glow-up. Strap in, it's a long one, but every single one of these slays in its own way. π
β¨ Updated Modules and Pragmata β¨
Archive::Tarβ upgraded from version2.38to2.40πAttribute::Handlersβ upgraded from version1.01to1.02attributesβ upgraded from version0.33to0.34Bβ upgraded from version1.82to1.83B::Conciseβ upgraded from version1.004to1.006B::Deparseβ upgraded from version1.56to1.64bignumβ upgraded from version0.51to0.65charnamesβ upgraded from version1.48to1.50Compress::Raw::Bzip2β upgraded from version2.101to2.103Compress::Raw::Zlibβ upgraded from version2.101to2.105CPANβ upgraded from version2.28to2.33Data::Dumperβ upgraded from version2.179to2.184DB_Fileβ upgraded from version1.855to1.857Devel::Peekβ upgraded from version1.30to1.32Devel::PPPortβ upgraded from version3.62to3.68diagnosticsβ upgraded from version1.37to1.39Digestβ upgraded from version1.19to1.20DynaLoaderβ upgraded from version1.50to1.52Encodeβ upgraded from version3.08to3.17Errnoβ upgraded from version1.33to1.36experimentalβ upgraded from version0.024to0.028Exporterβ upgraded from version5.76to5.77ExtUtils::MakeMakerβ upgraded from version7.62to7.64ExtUtils::Miniperlβ upgraded from version1.10to1.11ExtUtils::ParseXSβ upgraded from version3.43to3.45ExtUtils::Typemapsβ upgraded from version3.43to3.45Fcntlβ upgraded from version1.14to1.15featureβ upgraded from version1.64to1.72File::Compareβ upgraded from version1.1006to1.1007File::Copyβ upgraded from version2.35to2.39File::Fetchβ upgraded from version1.00to1.04File::Findβ upgraded from version1.39to1.40File::Globβ upgraded from version1.33to1.37File::Specβ upgraded from version3.80to3.84File::statβ upgraded from version1.09to1.12FindBinβ upgraded from version1.52to1.53GDBM_Fileβ upgraded from version1.19to1.23Hash::Utilβ upgraded from version0.25to0.28Hash::Util::FieldHashβ upgraded from version1.21to1.26HTTP::Tinyβ upgraded from version0.076to0.080I18N::Langinfoβ upgraded from version0.19to0.21ifβ upgraded from version0.0609to0.0610IOβ upgraded from version1.46to1.50IO-Compressβ upgraded from version2.102to2.106IPC::Open3β upgraded from version1.21to1.22JSON::PPβ upgraded from version4.06to4.07libnetβ upgraded from version3.13to3.14Locale::Maketextβ upgraded from version1.29to1.31Math::BigIntβ upgraded from version1.999818to1.999830Math::BigInt::FastCalcβ upgraded from version0.5009to0.5012Math::BigRatβ upgraded from version0.2614to0.2621Module::CoreListβ upgraded from version5.20210520to5.20220520mroβ upgraded from version1.25_001to1.26(yes the underscore version was real, don't @ me)NEXTβ upgraded from version0.68to0.69Opcodeβ upgraded from version1.50to1.57openβ upgraded from version1.12to1.13overloadβ upgraded from version1.33to1.35perlfaqβ upgraded from version5.20210411to5.20210520PerlIOβ upgraded from version1.11to1.12Pod::Functionsβ upgraded from version1.13to1.14Pod::Htmlβ upgraded from version1.27to1.33Pod::Simpleβ upgraded from version3.42to3.43POSIXβ upgraded from version1.97to2.03π₯reβ upgraded from version0.41to0.43Scalar::Utilβ upgraded from version1.55to1.62sigtrapβ upgraded from version1.09to1.10Socketβ upgraded from version2.031to2.033sortβ upgraded from version2.04to2.05Storableβ upgraded from version3.23to3.26Sys::Hostnameβ upgraded from version1.23to1.24Test::Harnessβ upgraded from version3.43to3.44Test::Simpleβ upgraded from version1.302183to1.302190Text::ParseWordsβ upgraded from version3.30to3.31Text::Tabsβ upgraded from version2013.0523to2021.0814Text::Wrapβ upgraded from version2013.0523to2021.0814threadsβ upgraded from version2.26to2.27threads::sharedβ upgraded from version1.62to1.64Tie::Handleβ upgraded from version4.2to4.3Tie::Hashβ upgraded from version1.05to1.06Tie::Scalarβ upgraded from version1.05to1.06Tie::SubstrHashβ upgraded from version1.00to1.01Time::HiResβ upgraded from version1.9767to1.9770Unicode::Collateβ upgraded from version1.29to1.31Unicode::Normalizeβ upgraded from version1.28to1.31Unicode::UCDβ upgraded from version0.75to0.78UNIVERSALβ upgraded from version1.13to1.14versionβ upgraded from version0.9928to0.9929VMS::Filespecβ upgraded from version1.12to1.13VMS::Stdioβ upgraded from version2.45to2.46warningsβ upgraded from version1.51to1.58Win32β upgraded from version0.57to0.59XS::APItestβ upgraded from version1.16to1.22XS::Typemapβ upgraded from version0.18to0.19XSLoaderβ upgraded from version0.30to0.31
π Documentation π
π New Documentation
Porting/vote_admin_guide.pod
This document provides the process for administering an election or vote within the Perl Core Team. π³οΈ Like, democracy but make it Perl.
π« Changes to Existing Documentation
We have attempted to update the documentation to reflect the changes listed in this document. If you find any we have missed, open an issue at <https://github.com/Perl/perl5/issues>. (bestie if you spot a typo pls pls pls file it, we're begging π₯Ί)
Additionally, the following selected changes have been made:
perlapi
- This has been cleaned up some, and more than 80% of the (previously many) undocumented functions have now either been documented or deemed to have been inappropriately marked as API.
As always, Patches Welcome! π«Ά
perldeprecation
- notes the new location for functions moved from
Pod::HtmltoPod::Html::Utilthat are no longer intended to be used outside of core. iykyk.
perlexperiment
- notes the
":win32"IO pseudolayer is removed (this happened in5.35.2). rip bozo π
perlgov
- The election process has been finetuned to allow the vote to be skipped if there are no more candidates than open seats. (no contestants? no contest. iconic β¨)
- A special election is now allowed to be postponed for up to twelve weeks, for example until a normal election.
perlop
- now notes that an invocant only needs to be an object or class name for method calls, not for subroutine references.
perlre
- Updated to discourage the use of the
/dregexp modifier. π« (it's giving deprecated, lowkey)
perlrun
-?is now a synonym for-h-gis now a synonym for-0777
π Diagnostics π
So bestie, here's the tea on all the new error messages, warnings, and glow-ups to the ones we already had. For the complete list of diagnostic messages, go peek at perldiag. π
π New Diagnostics π
π New Errors π
Can't "%s" out of a "defer" blockβ this one's a big fat (F) (fatal). Somebody tried to yeet themselves out of adeferblock's scope with a control-flow statement likereturn,goto, or a loop control. Nope, not permitted, absolutely not, the audacity. π ββοΈCan't modify %s in %s (for scalar assignment to "undef")β okay so if you try to do a scalar assignment toundef, like withundef = $foo;, that used to blow up at runtime with a fatal error sayingModification of a read-only value attempted.But like, catching it earlier is way more helpful, so now it's a compile time error, and the message you get isCan't modify undef operator in scalar assignment. Glow-up moment. β¨panic: newFORLOOP, %sβ the parser failed an internal consistency check while trying to parse aforeachloop. That's a genuine π panic, not a vibe.
πΈ New Warnings πΈ
Built-in function '%s' is experimentalβ you're calling something in thebuiltin::namespace, and that whole thing is currently experimental. Lowkey iconic, highkey risky. π§ͺdefer is experimentalβ thedeferblock modifier is experimental, bestie. If you really wanna use it, you can silence the warning withno warnings 'experimental::defer', but know that in doing so you are taking the risk that your code may break in a future Perl version. That's the deal, take it or leave it. π«ΆDowngrading a use VERSION declaration to below v5.11 is deprecatedβ this warning shows up on ause VERSIONstatement that requests a version below v5.11 (that's the zone where the effects ofuse strictwould get disabled), and only after you'd previously declared one with a larger number (which would have enabled those effects). Downgrade behavior, honestly. πfor my (...) is experimentalβ you usedforto iterate multiple values at a time. This syntax is currently experimental and its behaviour may change in future releases of Perl. Cute but unstable. πImplicit use of @_ in %s with signatured subroutine is experimentalβ an expression that implicitly involves the@_arguments array got found in a subroutine that uses a signature. Rude of it, honestly.Use of @_ in %s with signatured subroutine is experimentalβ same energy, but this time the expression involving the@_arguments array was found in a subroutine that uses a signature. π«£Wide character in $0β trying to shove wide characters into the program name ($0) now provokes this warning. Respect the name field's boundaries, bestie. π
π¦ Changes to Existing Diagnostics π¦
'/' does not take a repeat count in %sβ this warning used to not include thein %spart. Now it does. Inclusive queen. πSubroutine %s redefinedβ localized subroutine redefinitions no longer trigger this warning. Peace and quiet, finally. πunexpected constant lvalue entersub entry via type/targ %d:%dnow has apanicprefix β this makes it consistent with the other internal-consistency checks that happen when compiling a subroutine. Consistency is the moment. β¨Useless use of sort in scalar contextis now chillin' in the brand newscalarcategory. Here's the lore: whensortis used in scalar context, it provokes a warning that doing this is not useful. That warning used to live in thevoidcategory. A whole new category for warnings about scalar context has been added now, calledscalar. New home, same chaos. π‘- Removed a number of diagnostics β so many diagnostics that got removed from the perl core across many years have now also been removed from the documentation. Spring cleaning fr fr. π§Ή
βοΈ Configuration and Compilation βοΈ
- The Perl C source code now uses some C99 features, which we have verified are supported by all compilers we target. This means that Perl's headers now contain some code that is legal in C99 but not C89.
This may cause problems for some XS modules that unconditionally add -Werror=declaration-after-statement to their C compiler flags if compiling with gcc or clang. Earlier versions of Perl support long obsolete compilers that are strict in rejecting certain C99 features, particularly mixed declarations and code, and hence it makes sense for XS module authors to audit that their code does not violate this. However, doing this is now only possible on these earlier versions of Perl, hence these modules need to be changed to only add this flag for $] < 5.035005. π
- The makedepend step is now run in parallel by using make. When using
MAKEFLAGS=-j8, this significantly reduces the time required for:
sh ./makedepend MAKE=make cflags
Speed, we love to see it. ποΈπ¨
- Configure now tests whether
#include <xlocale.h>is required to use the POSIX 1003 thread-safe locale functions or some related extensions. This prevents problems where a non-publicxlocale.his removed in a library update, orxlocale.hisn't intended for public use. (github #18936 <https://github.com/Perl/perl5/pull/18936>) π§
π§ͺ Testing π§ͺ
Tests were added and changed to reflect the other additions and changes in this release. Gotta keep the receipts accurate, y'know? β
π₯οΈ Platform Support π₯οΈ
πͺ Windows πͺ
- Support for old MSVC++ (pre-VC12) has been removed. These did not support C99 and hence can no longer be used to compile perl. Sorry to that compiler but it had to go. π
- Support for compiling perl on Windows using Microsoft Visual Studio 2022 (containing Visual C++ 14.3) has been added. New era unlocked. π
- The
:win32IO layer has been removed. This experimental replacement for the:unixlayer never reached maturity in its nearly two decades of existence. It's giving "tried for 20 years, still not ready," and we respect the attempt but it's over. ποΈ
π¦ VMS π¦
keys %ENV on VMS returns consistent results
On VMS, entries in the %ENV hash are loaded from the OS environment on first access, hence the first iteration of %ENV requires the entire environment to be scanned to find all possible keys. This initialisation had always been done correctly for full iteration, but previously was not happening for %ENV in scalar context, meaning that scalar %ENV would return 0 if called before any other %ENV access, or would only return the count of keys accessed if there had been no iteration. π΅βπ«
These bugs are now fixed β %ENV and keys %ENV in scalar context now return the correct result β the count of all keys in the environment. Slay. π«Ά
πͺ¦ Discontinued Platforms πͺ¦
AT&T UWIN
UWIN is a UNIX compatibility layer for Windows. It was last released in 2012 and has been superseded by Cygwin these days. Rip bozo, Cygwin ate. π½οΈ
DOS/DJGPP
DJGPP is a port of the GNU toolchain to 32-bit x86 systems running DOS. The last known attempt to build Perl on it was on 5.20, which only got as far as building miniperl. So close and yet so far, bestie. π
NetWare
Support code for Novell NetWare has been removed. NetWare was a server operating system by Novell. The port was last updated in July 2002, and the platform itself in May 2009.
And here's the wild part: unrelated changes accidentally broke the build for the NetWare port in September 2009, and in 12 years no-one has reported this. Twelve. Years. Not one person noticed. πππ
π Platform-Specific Notes π
z/OS
This update enables us to build EBCDIC static/dynamic and 31-bit/64-bit addressing mode Perl. The number of tests that pass is consistent with the baseline before these updates. π
These changes also provide the base support to be able to provide ASCII static/dynamic and 31-bit/64-bit addressing mode Perl. π
The z/OS (previously called OS/390) README was updated to describe ASCII and EBCDIC builds. Documentation glow-up, we love to see it. β¨
π§ Internal Changes π§
Okay bestie, gather round, because the internals got a whole glow-up. β¨
- Since
PERL_OBJECTgot removed back in Perl 5.8,PERL_IMPLICIT_CONTEXTandMULTIPLICITYhave been synonymous and used interchangeably. To simplify the code, all instances ofPERL_IMPLICIT_CONTEXThave been replaced withMULTIPLICITY.
PERL_IMPLICIT_CONTEXT will remain defined for compatibility with XS modules. So like, don't panic, your old XS still vibes. π
- The API constant formerly named
G_ARRAY, indicating list context, has now been renamed to a more accurateG_LIST. A compatibility macroG_ARRAYhas been added to allow existing code to work unaffected. New code should be written using the new constant instead. This is supported byDevel::PPPortversion3.63. - Macros have been added to
perl.hto facilitate version comparisons:PERL_GCC_VERSION_GE,PERL_GCC_VERSION_GT,PERL_GCC_VERSION_LEandPERL_GCC_VERSION_LT.
Inline functions have been added to embed.h to determine the position of the least significant 1 bit in a word: lsbit_pos32 and lsbit_pos64.
Perl_ptr_table_clearhas been deleted. This has been marked as deprecated since v5.14.0 (released in 2011), and is not used by any code on CPAN. It's giving ancient history, periodt.- Added new boolean macros and functions. See "Stable boolean tracking" for related information and
perlapifor documentation.sv_setboolsv_setbool_mgSvIsBOOL
- Added 4 missing functions for dealing with RVs:
sv_setrv_noincsv_setrv_noinc_mgsv_setrv_incsv_setrv_inc_mg
xs_handshake()'s two failure modes now provide distinct messages. No more which one is it energy. π- Memory for hash iterator state (
struct xpvhv_aux) is now allocated as part of the hash body, instead of as part of the block of memory allocated for the main hash array. - A new
phase_name()interface provides access to the name for each interpreter phase (i.e.,PL_phasevalue). - The
packbehavior ofUhas changed for EBCDIC. - New equality-test functions
sv_numeqandsv_streqhave been added, along with..._flags-suffixed variants. These expose a simple and consistent API to perform numerical or string comparison which is aware of operator overloading. - Reading the string form of an integer value no longer sets the flag
SVf_POK. The string form is still cached internally, and still re-read directly by the macrosSvPV(sv)etc (inline, without calling a C function). XS code that already calls the APIs to get values will not be affected by this change. XS code that accesses flags directly instead of using API calls to express its intent might break, but such code likely is already buggy if passed some other values, such as floating point values or objects with string overloading.
This small change permits code (such as JSON serializers) to reliably determine between
- a value that was initially written as an integer, but then read as a string
my $answer = 42;
print "The answer is $answer\n";
- that same value that was initially written as a string, but then read as an integer
my $answer = "42";
print "That doesn't look right\n"
unless $answer == 6 * 9;
For the first case (originally written as an integer), we now have:
use Devel::Peek;
my $answer = 42;
Dump ($answer);
my $void = "$answer";
print STDERR "\n";
Dump($answer)
SV = IV(0x562538925778) at 0x562538925788
REFCNT = 1
FLAGS = (IOK,pIOK)
IV = 42
SV = PVIV(0x5625389263c0) at 0x562538925788
REFCNT = 1
FLAGS = (IOK,pIOK,pPOK)
IV = 42
PV = 0x562538919b50 "42"\0
CUR = 2
LEN = 10
For the second (originally written as a string), we now have:
use Devel::Peek;
my $answer = "42";
Dump ($answer);
my $void = $answer == 6 * 9;
print STDERR "\n";
Dump($answer)'
SV = PV(0x5586ffe9bfb0) at 0x5586ffec0788
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK)
PV = 0x5586ffee7fd0 "42"\0
CUR = 2
LEN = 10
COW_REFCNT = 1
SV = PVIV(0x5586ffec13c0) at 0x5586ffec0788
REFCNT = 1
FLAGS = (IOK,POK,IsCOW,pIOK,pPOK)
IV = 42
PV = 0x5586ffee7fd0 "42"\0
CUR = 2
LEN = 10
COW_REFCNT = 1
(One can't rely on the presence or absence of the flag SVf_IsCOW to determine the history of operations on a scalar.)
Previously both cases would be indistinguishable, with all 4 flags set:
SV = PVIV(0x55d4d62edaf0) at 0x55d4d62f0930
REFCNT = 1
FLAGS = (IOK,POK,pIOK,pPOK)
IV = 42
PV = 0x55d4d62e1740 "42"\0
CUR = 2
LEN = 10
(and possibly SVf_IsCOW, but not always)
This now means that if XS code really needs to determine which form a value was first written as, it should implement logic roughly
if (flags & SVf_IOK|SVf_NOK) && !(flags & SVf_POK)
serialize as number
else if (flags & SVf_POK)
serialize as string
else
the existing guesswork ...
Note that this doesn't cover "dualvars" - scalars that report different values when asked for their string form or number form (such as $!). Most serialization formats cannot represent such duplicity.
The existing guesswork remains because as well as dualvars, values might be undef, references, overloaded references, typeglobs and other things that Perl itself can represent but do not map one-to-one into external formats, so need some amount of approximation or encapsulation.
sv_dump(and Devel::PeekβsDumpfunction) now escapes high-bit octets in the PV as hex rather than octal. Since most folks understand hex more readily than octal, this should make these dumps a bit more legible. This does not affect any other diagnostic interfaces likepv_display.
π Selected Bug Fixes π
utime()now correctly setserrno/$!when called on a closed handle. Fixing the vibe check on closed handles. β- The flags on the
OPTVALparameter tosetsockopt()were previously checked before magic was called, possibly treating a numeric value as a packed buffer or vice versa. It also ignored the UTF-8 flag, potentially treating the internal representation of an upgraded SV as the bytes to supply to thesetsockopt()system call. (github #18660<https://github.com/Perl/perl5/issues/18660>) - Only set
IOKp, notIOKon$)and$(. This was issue #18955<https://github.com/Perl/perl5/issues/18955>: This will prevent serializers from serializing these variables as numbers (which loses the additional groups). This restores behaviour from 5.16 - Use of the
mktablesdebugging facility would cause perl to croak since v5.31.10; this problem has now been fixed. makedependlogic is now compatible with BSD make (fixes GH #19046<https://github.com/Perl/perl5/issues/19046>).- Calling
untieon a tied hash that is partway through iteration now frees the iteration state immediately.
Iterating a tied hash causes perl to store a copy of the current hash key to track the iteration state, with this stored copy passed as the second parameter to NEXTKEY. This internal state is freed immediately when tie hash iteration completes, or if the hash is destroyed, but due to an implementation oversight, it was not freed if the hash was untied. In that case, the internal copy of the key would persist until the earliest of
tiewas called again on the same hash- The (now untied) hash was iterated (ie passed to any of
keys,valuesoreach) - The hash was destroyed.
This inconsistency is now fixed - the internal state is now freed immediately by untie.
As the precise timing of this behaviour can be observed with pure Perl code (the timing of DESTROY on objects returned from FIRSTKEY and NEXTKEY) it's just possible that some code is sensitive to it.
- The
Internals::getcwd()function added for bootstrapping miniperl in perl 5.30.0 is now only available in miniperl. [github #19122] - Setting a breakpoint on a
BEGINor equivalently ausestatement could cause a memory write to a freeddbstateop. [GH #19198<https://github.com/Perl/perl5/issues/19198>] - When bareword filehandles are disabled, the parser was interpreting any bareword as a filehandle, even when immediately followed by parens.
π Errata From Previous Releases π
perl5300deltamistakenly identified a CVE whose correct identification isCVE-2015-1592. Oops, a wrong CVE moment. π
ποΈ Obituaries ποΈ
Raun "Spider" Boardman (SPIDB on CPAN), author of at least 66 commits to the Perl 5 core distribution between 1996 and 2002, passed away May 24, 2021 from complications of COVID. He will be missed.
David H. Adler (DHA) passed away on November 16, 2021. In 1997, David co-founded NY.pm, the first Perl user group, and in 1998 co-founded Perl Mongers to help establish other user groups across the globe. He was a frequent attendee at Perl conferences in both North America and Europe and well known for his role in organizing Bad Movie Night celebrations at those conferences. He also contributed to the work of the Perl Foundation, including administering the White Camel awards for community service. He will be missed.
β¨ Acknowledgements β¨
Okay bestie, gather round, because this is the part where we give credit where credit is SO beyond due. π
Perl 5.36.0 is literally about a year of development on top of Perl 5.34.0, and it's packing approximately 250,000 lines of changes across 2,000 files from 82 authors. No cap. That's not a typo, that's a whole era. π
And if we don't count the auto-generated files, the docs, and the release tools? Still approximately 190,000 lines of changes to 1,300 .pm, .t, .c and .h files. The way that they just kept going. π
Perl keeps flourishing into its fourth decade thanks to a vibrant community of users and developers β and the following people are known to have contributed the improvements that became Perl 5.36.0:
- Alyssa Ross
- Andrew Fresh
- Aristotle Pagaltzis
- Asher Mancinelli
- Atsushi Sugawara
- Ben Cornett
- Bernd
- Biswapriyo Nath
- Brad Barden
- Bram
- Branislav ZahradnΓk
- brian d foy
- Chad Granum
- Chris 'BinGOs' Williams
- Christian Walde (Mithaldu)
- Christopher Yeleighton
- Craig A. Berry
- cuishuang
- Curtis Poe
- Dagfinn Ilmari MannsΓ₯ker
- Dan Book
- Daniel LaΓΌgt
- Dan Jacobson
- Dan Kogai
- Dave Cross
- Dave Lambley
- David Cantrell
- David Golden
- David Marshall
- David Mitchell
- E. Choroba
- Eugen Konkov
- Felipe Gasper
- FranΓ§ois Perrad
- Graham Knop
- H.Merijn Brand
- Hugo van der Sanden
- Ilya Sashcheka
- Ivan Panchenko
- Jakub Wilk
- James E Keenan
- James Raspass
- Karen Etheridge
- Karl Williamson
- Leam Hall
- Leon Timmermans
- Magnus Woldrich
- Matthew Horsfall
- Max Maischein
- Michael G Schwern
- Michiel Beijen
- Mike Fulton
- Neil Bowers
- Nicholas Clark
- Nicolas R
- Niyas Sait
- Olaf Alders
- Paul Evans
- Paul Marquess
- Petar-Kaleychev
- Pete Houston
- Renee Baecker
- Ricardo Signes
- Richard Leach
- Robert Rothenberg
- Sawyer X
- Scott Baker
- Sergey Poznyakoff
- Sergey Zhmylove
- Sisyphus
- Slaven Rezic
- Steve Hay
- Sven Kirmess
- TAKAI Kousuke
- Thibault Duponchelle
- Todd Rinaldo
- Tomasz Konojacki
- Tomoyuki Sadahiro
- Tony Cook
- Unicode Consortium
- Yves Orton
- ΠΠΈΡ Π°ΠΈΠ» ΠΠΎΠ·Π°ΡΠΊΠΎΠ²
Absolute icons, every single one. π
Real talk though β that list above is almost certainly incomplete, because it's automatically generated from version control history. Specifically, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker. So if you filed a bug and you're not up there, know that you're still a legend in our hearts. π«Ά
Also, so many of the changes 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. πΈ
And for a more complete list of all of Perl's historical contributors, please see the AUTHORS file in the Perl source distribution.
π Reporting Bugs
Found something that looks sus? First move: check the perl bug database at <https://github.com/Perl/perl5/issues>. There may also be information at <http://www.perl.org/>, the Perl Home Page.
If you genuinely believe you've got an unreported bug, please open an issue at <https://github.com/Perl/perl5/issues>. And bestie, be sure to trim your bug down to a tiny but sufficient test case β we love a concise queen. π
Now listen, if the bug you're reporting has security implications that make it inappropriate to send to a public issue tracker, do NOT just post it. See "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec for the details on how to report the issue. Protect the vibe, protect the users. π
π«Ά Give Thanks
Wanna say thank you to the Perl 5 Porters for the work we've done in Perl 5? You absolutely can, and it's lowkey adorable β just run the perlthanks program:
perlthanks
That'll send an email to the Perl 5 Porters list with your show of thanks. Go be sweet, it costs nothing. π
π 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 the whole delta, bestie β every last crumb of it. This page came from Perl version v5.42.3, dated 2026-08-03, and it's the PERL5360DELTA(1) manual page, so if you ever need to cite it, that's your receipt. π Go write something iconic with Perl 5.36.0. Periodt. β¨
π¦ 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