PERL5420DELTA(1perl)

๐Ÿ“ฆ
version 5.44.0 ยท 2 versions
, in arch rolling

๐Ÿ’– NAME ๐Ÿ’–

okay so bestie, perl5420delta โ€” it's the Perl Programmers Reference Guide page (section 1, iykyk) โ€” and it is literally the tea on what is new for perl v5.42.0 ๐ŸŽ€

โœจ DESCRIPTION โœจ

this whole doc is the rundown of the differences between the 5.42.0 release and the 5.40.0 release. that's the vibe. that's the assignment ๐Ÿ’…


๐ŸŒธ CORE ENHANCEMENTS ๐ŸŒธ

๐Ÿ’œ More CORE:: subs

chdir has been added as a subroutine to the CORE:: namespace. periodt ๐Ÿ‘‘

before this? code like &CORE::chdir($dir) or my $ref = \&CORE::chdir; $ref->($dir) would straight up throw an error going "&CORE::chdir cannot be called directly". now those cases are fully supported. we love a glow-up ๐Ÿซถ

๐Ÿ’œ New pragma source::encoding

this one lets you declare that the chunk of a program for the remainder of the lexical scope of the pragma is encoded either entirely in ASCII โ€” that's use source::encoding 'ascii' โ€” or that UTF-8 is allowed too, which is use source::encoding 'utf8'. and no, no other encodings are accepted, sorry to that one guy ๐ŸŒˆ

the second form is entirely equivalent to use utf8, and you can use them interchangeably.

the whole point of this pragma? catching cases early where you forgot to say use utf8 ๐Ÿ˜ญ lifesaver, fr fr.

use source::encoding 'ascii' is automatically enabled within the lexical scope of a use v5.41.0 or higher.

and no source::encoding turns off all this checking for the remainder of its lexical scope. heads up though: the meaning of non-ASCII characters is then undefined ๐Ÿ’€

๐Ÿ’œ New :writer attribute on field variables

classes defined using use feature 'class' can now automatically create writer accessors for scalar fields by using the :writer attribute โ€” same energy as how :reader already creates reader accessors โœจ

class Point {
    field $x :reader :writer :param;
    field $y :reader :writer :param;
}

my $p = Point->new( x => 20, y => 40 );
$p->set_x(60);

๐Ÿ’œ New any and all operators

two new experimental features just dropped, and they introduce the list-processing operators any and all ๐Ÿ‘‘

use v5.42;
use feature 'keyword_all';
no warnings 'experimental::keyword_all';

my @numbers = ...

if ( all { $_ % 2 == 0 } @numbers ) {
    say "All the numbers are even";
}

these keywords work similarly to grep, except they only ever return true or false โ€” they're testing whether any (or all) of the elements in the list make the testing block yield true. and because of that, they can short-circuit, so if one element already decides the answer, no need to keep testing the rest. efficiency? main character energy ๐Ÿ’…

they're inspired by the same-named functions in the List::Util module, except these are implemented as direct core operators, so they perform faster, and they do not produce an additional subroutine call stack frame for invoking the code block ๐Ÿ”ฅ

the feature flags enabling these keywords are named keyword_any and keyword_all โ€” that naming was deliberate, to avoid confusion with the feature module's ability to refer to all of its features using the :all export tag. [GH #23104] โ€” https://github.com/Perl/perl5/issues/23104

and the related experimental warning flags are consequently named experimental::keyword_any and experimental::keyword_all. consistency slay ๐Ÿ’–

๐Ÿ’œ Apostrophe as a global name separator can be disabled

so this got deprecated in Perl 5.38 and removed as scheduled in perl 5.41.3... but after some discussion it's been reinstated by default ๐Ÿ™ˆ plot twist.

you can control this with the apostrophe_as_package_separator feature, which is enabled by default, but is disabled from the 5.41 feature bundle onwards.

if you wanna disable it in your own code you can explicitly do:

no feature "apostrophe_as_package_separator";
note that disabling this feature only prevents use of apostrophe as a package separator within code. symbolic references still treat ' as :: with the feature disabled:
my $symref = "My'Module'Var";
# default features
my $x = $My'Module'Var; # fine
no feature "apostrophe_as_package_separator";
no strict "refs";
my $y = $$symref;       # like $My::Module::Var
my $z = $My'Module'Var; # syntax error

[GH #22644] โ€” https://github.com/Perl/perl5/issues/22644

๐Ÿ’œ Lexical method declaration using my method

just like sub since Perl version 5.18, method can now be prefixed with the my keyword ๐ŸŽ€ this declares a subroutine that has lexical, rather than package, visibility. see perlclass for more detail, bestie ๐Ÿ’œ

๐Ÿ’œ Lexical method invocation operator ->&

along with being able to declare methods lexically, this release also lets you invoke a lexical subroutine as if it were a method โ€” bypassing the usual name-based method resolution ๐Ÿฆ‹

and once you combine that with lexical method declaration? these two new abilities together create the effect of having private methods. iconic. no notes. โœจ

๐Ÿ’œ Switch and Smart Match operator kept, behind a feature

the switch feature and the smartmatch operator, ~~, were introduced in v5.10. their behavior got significantly changed in v5.10.1. and when the experiment system was added in v5.18.0, switch and smartmatch were retroactively declared experimental ๐Ÿ˜ญ

over the years, proposals to fix or supplement the features have come and gone. they were deprecated in Perl v5.38.0 and scheduled for removal in Perl v5.42.0. but after extensive discussion, their removal has been indefinitely postponed ๐ŸŽ‰ and using them no longer produces a deprecation warning.

switch itself still requires the switch feature, which is enabled by default for feature bundles from v5.9.5 through to v5.34. switch remains disabled in feature bundles 5.35 and later, but can be separately enabled:

# no switch here
use v5.10;
# switch here
use v5.36;
# no switch here
use feature "switch";
# switch here

smart match now requires the smartmatch feature, which is enabled by default and included in all feature bundles up to 5.40. it's disabled for the 5.41 feature bundle and later, but can be separately enabled:

# smartmatch here
use v5.41;
# no smartmatch here
use feature "smartmatch";
# smartmatch here

[GH #22752] โ€” https://github.com/Perl/perl5/issues/22752

๐Ÿ’œ Unicode 16.0 supported

Perl now supports Unicode 16.0 โ€” https://www.unicode.org/versions/Unicode16.0.0/ โ€” including the changes introduced in 15.1 โ€” https://www.unicode.org/versions/Unicode15.1.0/ ๐ŸŒˆ

๐Ÿ’œ Assigning logical xor ^^= operator

Perl 5.40.0 introduced the logical medium-precedence exclusive-or operator ^^. but nobody noticed at the time that the assigning variant ^^= was also missing ๐Ÿ˜ญ (not me forgetting the whole assignment). this is now added ๐Ÿซถ


๐Ÿ”’ SECURITY ๐Ÿ”’

๐Ÿ’€ [CVE-2024-56406] Heap buffer overflow vulnerability with tr//

okay bestie, this one is serious, pay attention ๐Ÿ‘‘

a heap buffer overflow vulnerability was discovered in Perl. when there are non-ASCII bytes in the left-hand-side of the tr operator, S_do_trans_invmap() can overflow the destination pointer d ๐Ÿ’€

$ perl -e '$_ = "\x{FF}" x 1000000; tr/\xFF/\x{100}/;'
Segmentation fault (core dumped)
it is believed that this vulnerability can enable Denial of Service or Arbitrary Code Execution attacks on platforms that lack sufficient defenses. this is not a drill, fr fr.

this problem was discovered by Nathan Mills and assigned [CVE-2024-56406] โ€” https://lists.security.metacpan.org/cve-announce/msg/28708725/ โ€” by the CPAN Security Group โ€” https://security.metacpan.org/

the patch that fixes this issue (87f42aa0e0096e9a346c9672aa3a0bd3bef8c1dd โ€” https://github.com/Perl/perl5/commit/87f42aa0e0096e9a346c9672aa3a0bd3bef8c1dd) is applicable to all perls that are vulnerable, including those that are out-of-support ๐Ÿ™

๐Ÿ’€ [CVE-2025-40909] Perl threads have a working directory race condition where file operations may target unintended paths

Perl thread cloning had a working directory race condition where file operations may target unintended paths ๐Ÿ˜ญ Perl 5.42 will no longer chdir to each handle. periodt.

this problem was discovered by Vincent Lefรจvre via [GH #23010] โ€” https://github.com/Perl/perl5/issues/23010 โ€” and assigned [CVE-2025-40909] โ€” https://lists.security.metacpan.org/cve-announce/msg/30017499/ โ€” by the CPAN Security Group โ€” https://security.metacpan.org/

fixes were provided via [GH #23019] โ€” https://github.com/Perl/perl5/pull/23019 โ€” and [GH #23361] โ€” https://github.com/Perl/perl5/pull/23361 ๐Ÿซถ


๐Ÿ’” INCOMPATIBLE CHANGES ๐Ÿ’”

๐Ÿ’œ Removed containing function references for functions without eval

okay so context, bestie: Perl 5.40 reintroduced unconditional references from functions to their containing functions, in order to fix a bug introduced in Perl 5.18 that broke the special behaviour of eval EXPR in package DB โ€” which is what the debugger uses ๐Ÿ”

but in some cases, that change led to circular reference chains between closures and other existing references, which meant memory leaks ๐Ÿ’€ not the vibe.

so this change has been reverted โ€” which fixes [GH #22547] โ€” https://github.com/Perl/perl5/issues/22547 โ€” but re-breaks [GH #19370] โ€” https://github.com/Perl/perl5/issues/19370 ๐Ÿ˜ญ you win some, you lose some.

what this means for you: the reference loops won't occur, and lexical variables and functions from enclosing functions may not be visible in the debugger ๐Ÿ™ˆ

note that calling eval EXPR in a function unconditionally causes a function to reference its enclosing functions, as it always has. that part never changed ๐ŸŽ€

๐Ÿ”ฅ Performance Enhancements ๐Ÿ”ฅ

Okay so like, the following code used to allocate eleven string buffers, each one holding a million "A"s. Eleven! Girl. The audacity.

my @scalars; push @scalars, ("A" x 1_000_000) for 0..9;

Now? One single buffer gets allocated and shared between a CONST OP and the ten scalar elements of @scalars. Economical. Frugal. She's thrifty.

Heads up though bestie โ€” if you're out here using this sort of constant to simulate memory leaks (maybe in a test file ๐Ÿ‘€), you now have to permute the string to trigger a string copy and get those separate buffers back. Something like ("A" x 1_000_000).time might be a suitable small change. iykyk.
  • tr/// now runs at the same speed regardless of the internal representation of its operand</p>, as long as the only characters being translated are ASCII-range โ€” think tr/A-Z/a-z/ vibes. Before this? If the internal encoding was UTF-8, it went and used a slower, more general implementation. Not anymore. She's efficient now. ๐Ÿ’…
  • Code that uses the indexed function from the builtin module to make a list of index/value pairs out of an array or list, and then passes that into a two-variable foreach list to unpack them again โ€” that is now optimised to be more efficient.
my @array = (...);

foreach my ($idx, $val) (builtin::indexed @array) {
    ...
}

foreach my ($idx, $val) (builtin::indexed LIST...) {
    ...
}

Specifically: a temporary list twice the size of the original is no longer generated. Instead the loop iterates down the original array or list in-place, directly, exactly the way foreach (@array) or foreach (LIST) would do. No middleman. No extra list. Just vibes and efficiency. โœจ

substr($x, 0, ...)
substr($x, 0, ..., '')
  • The stringification of integers by print in perlfunc and say in perlfunc, when it's coming from an SVt_IV, is now more efficient. [GH #22927 <https://github.com/Perl/perl5/issues/22927>] ๐Ÿ’–
  • String reversal from a single argument โ€” when the string buffer is not swiped โ€” is now done in a single pass and is noticeably faster. How much faster? Compiler & hardware dependent, babes, it varies. [GH #23012 <https://github.com/Perl/perl5/issues/23012>]

๐Ÿ“ฆ Modules and Pragmata ๐Ÿ“ฆ

โœจ Updated Modules and Pragmata โœจ

Bestie, the glow-ups. Every single one of these got upgraded and we are obsessed:

  • Archive::Tar โ€” from version 3.02_001 to 3.04.
  • B::Deparse โ€” from version 1.76 to 1.85.
  • Benchmark โ€” from version 1.25 to 1.27.
  • builtin โ€” from version 0.014 to 0.019.
  • Compress::Raw::Bzip2 โ€” from version 2.212 to 2.213.
  • Compress::Raw::Zlib โ€” from version 2.212 to 2.213.
  • Config::Perl::V โ€” from version 0.36 to 0.38.
  • CPAN โ€” from version 2.36 to 2.38.
  • CPAN::Meta::YAML โ€” from version 0.018 to 0.020.
  • Data::Dumper โ€” from version 2.189 to 2.192.
  • DB โ€” from version 1.08 to 1.09.
  • DBM_Filter โ€” from version 0.06 to 0.07.
  • Devel::Peek โ€” from version 1.34 to 1.36.
  • Devel::PPPort โ€” from version 3.72 to 3.73.
  • Digest::MD5 โ€” from version 2.58_01 to 2.59.
  • DynaLoader โ€” from version 1.56 to 1.57.
  • experimental โ€” from version 0.032 to 0.035.
  • Exporter โ€” from version 5.78 to 5.79.
  • ExtUtils::CBuilder โ€” from version 0.280240 to 0.280242.
  • ExtUtils::MakeMaker โ€” from version 7.70 to 7.76.
  • ExtUtils::ParseXS โ€” from version 3.51 to 3.57.
  • ExtUtils::Typemaps โ€” from version 3.51 to 3.57.
  • Fcntl โ€” from version 1.18 to 1.20.
  • feature โ€” from version 1.89 to 1.97.
  • fields โ€” from version 2.25 to 2.27.
  • File::Spec โ€” from version 3.90 to 3.94.
  • Getopt::Long โ€” from version 2.57 to 2.58.
  • HTTP::Tiny โ€” from version 0.088 to 0.090.
  • IO::Compress โ€” from version 2.212 to 2.213.
  • IO::Socket::IP โ€” from version 0.42 to 0.43.
  • IPC::Open3 โ€” from version 1.22 to 1.24.
  • locale โ€” from version 1.12 to 1.13.
  • Math::BigInt โ€” from version 2.003002 to 2.005002.
  • Math::BigInt::FastCalc โ€” from version 0.5018 to 0.5020.
  • Math::Complex โ€” from version 1.62 to 1.63.
  • Memoize โ€” from version 1.16 to 1.17.
  • Module::CoreList โ€” from version 5.20240609 to 5.20250702.
  • NDBM_File โ€” from version 1.17 to 1.18.
  • ODBM_File โ€” from version 1.18 to 1.20.
  • Opcode โ€” from version 1.65 to 1.69.
  • overload โ€” from version 1.37 to 1.40.
  • parent โ€” from version 0.241 to 0.244.
  • perlfaq โ€” from version 5.20240218 to 5.20250619.
  • Pod::Usage โ€” from version 2.03 to 2.05.
  • podlators โ€” from version 5.01_02 to v6.0.2.
  • POSIX โ€” from version 2.20 to 2.23.
  • re โ€” from version 0.47 to 0.48.
  • Safe โ€” from version 2.46 to 2.47.
  • Scalar::Util โ€” from version 1.63 to 1.68_01.
  • Search::Dict โ€” from version 1.07 to 1.08.
  • SelfLoader โ€” from version 1.27 to 1.28.
  • sort โ€” from version 2.05 to 2.06.
  • Storable โ€” from version 3.32 to 3.37.
  • strict โ€” from version 1.13 to 1.14.
  • Term::Table โ€” from version 0.018 to 0.024.
  • Test::Harness โ€” from version 3.48 to 3.50.
  • Test::Simple โ€” from version 1.302199 to 1.302210.
  • Thread โ€” from version 3.05 to 3.06.
  • threads โ€” from version 2.40 to 2.43.
  • threads::shared โ€” from version 1.69 to 1.70.
  • Tie::File โ€” from version 1.09 to 1.10.
  • Tie::RefHash โ€” from version 1.40 to 1.41.
  • Time::HiRes โ€” from version 1.9777 to 1.9778.
  • Time::Piece โ€” from version 1.3401_01 to 1.36.
  • Unicode::UCD โ€” from version 0.78 to 0.81.
  • utf8 โ€” from version 1.25 to 1.27.
  • version โ€” from version 0.9930 to 0.9933.
  • VMS::Filespec โ€” from version 1.13 to 1.15.
  • warnings โ€” from version 1.69 to 1.74.
  • Win32 โ€” from version 0.59 to 0.59_01.
  • XS::APItest โ€” from version 1.36 to 1.43.

๐Ÿ“– Documentation ๐Ÿ“–

Changes to Existing Documentation

So like, we attempted to update the docs to reflect all the changes listed in this document. If you find any we missed, bestie, please open an issue at <https://github.com/Perl/perl5/issues>. We'd literally love that. ๐Ÿซถ

Additionally, the following selected changes have been made:

perlapi

  • Combined the documentation for several groups of related functions into single entries.
  • All forms of gv_fetchmeth() are now documented together.
  • gv_autoload4 is now documented with gv_autoload_pv and additional notes added. The long Perl_ forms are now listed when available.

perldata

  • Binary and octal floating-point constants โ€” like 012.345p-2 and 0b101.11p-1 โ€” are now documented. This feature was first introduced in perl 5.22.0 together with hexadecimal floating-point constants, and it got a few bug fixes in perl 5.28.0, but it was never formally documented until now. [GH #18664 <https://github.com/Perl/perl5/issues/18664>] ๐Ÿ˜ญ iconic belated behaviour.

perlfunc

  • Clarified the description of ref and reftype in relation to built-in types and class names.
  • Clarified that perl sort is stable (and has been since v5.8.0). Periodt.
  • The recommended alternatives to the rand() function were updated to modern modules recommended by the CPAN Security Group <https://security.metacpan.org/>. [GH #22873 <https://github.com/Perl/perl5/pull/22873>]

perlgov

  • The list of Steering Council and Core Team members have been updated, following the conclusion of the latest election on 2024-07-17.

perlguts

  • Added some description of real AVs compared to fake AVs.
  • Documentation was updated to reflect that mixing Newx, Renew, and Safefree vs malloc, realloc, and free are not allowed, and mixing pointers between the 2 classes of APIs is not allowed either. Updates made in perlguts and perlclib. ๐Ÿšซ
  • Additional caveats have been added to the description of TARG.

perlop

  • Portions of perlop are supposed to be ordered so that all the operators with the same precedence are in a single section, and the sections are ordered so the highest precedence operators appear first. That ordering has now been restored. Other reorganization was done to improve clarity, with more basic operations described before the ones that depend on them.
  • The documentation for here-docs has been cleaned up and reorganized. Indented here-docs were formerly documented separately โ€” now the two types have interwoven documentation which is more compact and way easier to understand. ๐Ÿ’–
  • The documentation of the xor operator has been expanded.
  • Outdated advice about using relational string operators in UTF-8 locales has been removed. Use Unicode::Collate for the best results โ€” but these operators will give adequate results on many platforms.
  • Normalized alignment of verbatim sections, fixing how they're displayed by some Pod viewers that strip indentation.

perlvar

  • Entries for $# and $* have been amended to note that use of them results in a compilation error, not a warning. ๐Ÿ’€

๐Ÿ’… Diagnostics ๐Ÿ’…

okay so here's the tea on the messages perl throws at you โ˜• โ€” the warnings AND the fatal errors. These are the additions and changes to perl's diagnostic output for this release. Wanna see the whole master list? That's perldiag, bestie. ๐Ÿ“–


โœจ New Diagnostics โœจ

๐Ÿšจ New Errors ๐Ÿšจ

  • Use of non-ASCII character 0x%X illegal when 'use source::encoding "ascii"' is in effect โ€” (F) This pragma is so strict โ€” it literally forbids non-ASCII characters anywhere inside its scope. No exceptions, no vibes. ๐Ÿ™…โ™€๏ธ
  • Undefined subroutine &%s called, close to label '%s' โ€” (F) The sub you called just... doesn't exist. Maybe it never did, maybe it got undefined later, who knows. ๐Ÿ’€

But listen โ€” this error can also mean you typo'd your package separator, like when you typed one colon instead of two. For example, Foo:bar() gets parsed as the label "Foo" followed by an unqualified function name: "foo: bar()". Classic. [GH #22860 <https://github.com/Perl/perl5/issues/22860>]

โš ๏ธ New Warnings โš ๏ธ

  • __CLASS__ is experimental โ€” (S experimental::class) You get this warning if you use the "__CLASS__" keyword from use feature 'class'. That keyword is currently experimental, meaning its behaviour may absolutely change in future releases of Perl. Living on the edge, bestie. ๐ŸŽข
  • %s() attempted on handle %s opened with open() โ€” (W io) You called readdir(), telldir(), seekdir(), rewinddir() or closedir() on a handle that was opened with open(). If you actually want to walk through a directory's contents with those functions, you gotta open the handle with opendir() instead, periodt. [GH #22394 <https://github.com/Perl/perl5/issues/22394>]
  • Possible precedence problem between ! and %s โ€” (W precedence) so you wrote something like:
!$x < $y               # parsed as: (!$x) < $y
!$x eq $y              # parsed as: (!$x) eq $y
!$x =~ /regex/         # parsed as: (!$x) =~ /regex/
!$obj isa Some::Class  # parsed as: (!$obj) isa Some::Class

but bc "!" has higher precedence than comparison operators, "=~", and "isa", perl reads this as comparing/matching the logical negation of the first operand instead of negating the result of the comparison/match. not what you meant, bestie ๐Ÿ˜ญ

To disambiguate, use a negated comparison/binding operator:

$x >= $y
$x ne $y
$x !~ /regex/

... or parentheses:

!($x < $y)
!($x eq $y)
!($x =~ /regex/)
!($obj isa Some::Class)

... or the low-precedence "not" operator:

not $x < $y
not $x eq $y
not $x =~ /regex/
not $obj isa Some::Class

(If you genuinely did mean to compare the boolean result of negating the first operand, then just parenthesize it as "(!$x) < $y", "(!$x) eq $y", etc.) ๐Ÿซถ

Note: this warning does not trigger for code like "!!$x == $y" โ€” i.e. where double negation ("!!") is being used as a convert-to-boolean operator. You're safe there.

๐Ÿ”„ Changes to Existing Diagnostics ๐Ÿ”„

  • %s() attempted on invalid dirhandle %s โ€” This got consolidated from separate messages for readdir(), telldir(), seekdir(), rewinddir() and closedir() as part of the refactoring for [GH #22394 <https://github.com/Perl/perl5/issues/22394>]. one message to rule them all, iconic behavior. ๐Ÿ‘‘
  • Useless use of %s in void context โ€” This warning now also triggers when you use a chained comparison like "0 < $x < 1". [GH #22969 <https://github.com/Perl/perl5/issues/22969>]
  • Use of uninitialized value%s โ€” They stopped this warning from firing when you access a function parameter in @_ that is an lvalue reference to an untied hash element where the key was undefined. The warning still gets produced at the point of call, tho. [GH #22423 <https://github.com/Perl/perl5/issues/22423>]

๐Ÿ› ๏ธ Utility Changes ๐Ÿ› ๏ธ

๐ŸŽ€ Porting/test-dist-modules.pl ๐ŸŽ€

  • Separate installation (without overwriting your already-installed modules, tyvm) is now the default. ๐Ÿ’…
  • Documentation got significantly enhanced. glow up โœจ

โš™๏ธ Configuration and Compilation โš™๏ธ

  • Fixed compilation on platforms (e.g. "Gentoo Prefix") that only have a C locale. [GH #22569 <https://github.com/Perl/perl5/issues/22569>] Bug first reported downstream at bugs.gentoo.org/939014 <https://bugs.gentoo.org/939014>
  • The (mostly undocumented) configuration macro "PERL_STRICT_CR" has been removed. When it was enabled (e.g. with "./Configure -A ccflags=-DPERL_STRICT_CR"), it made the perl parser throw a fatal error whenever it hit a CR (carriage return) character in source files. Now there's only one behavior and it's the default: the perl parser strips CRs that are paired with newline characters, and otherwise treats them as whitespace. bye extra config ๐Ÿซก

("PERL_STRICT_CR" was originally introduced in perl 5.005 to optionally restore backward compatibility with perl 5.004, which had made CR in source files an error. Before that, CR was accepted โ€” but retained literally in quoted multi-line constructs such as here-documents, even at the end of a line. history lesson for free ๐Ÿ“š)

  • Similarly, the (even less documented) configuration macro "PERL_CR_FILTER" has been removed too. When enabled, it would install a default source filter to strip carriage returns from source code before the parser proper even got to see it. gone, girl. ๐Ÿฆ‹

๐Ÿงช Testing ๐Ÿงช

Tests were added and changed to reflect all the other additions and changes in this release. And also, these significant changes were made:

  • A brand new t/run/todo.t test script was added as a home for TODO tests for known unfixed bugs. Patches are welcome to add to this file, so like... go off? ๐Ÿซถ
  • Added testing of the perl headers against the C++ compiler that corresponds to the C compiler perl is being built with. [GH #22232 <https://github.com/Perl/perl5/issues/22232>]

๐ŸŒ Platform Support ๐ŸŒ

๐Ÿ“ Platform-Specific Notes ๐Ÿ“

๐ŸŽ arm64 Darwin

Fix arm64 darwin hints when using use64bitall with Configure. [GH #22672 <https://github.com/Perl/perl5/issues/22672>]

๐Ÿค– Android

Changes to perl_langinfo.h for Android [GH #22650 <https://github.com/Perl/perl5/issues/22650>] related to [GH #22627 <https://github.com/Perl/perl5/issues/22627>].

๐Ÿง Cygwin

cygwin.c: fix several silly/terrible C errors. [GH #22724 <https://github.com/Perl/perl5/issues/22724>]

Supply an explicit base address for "cygperl*.dll" that cannot conflict with those generated by "--enable-auto-image-base". [GH #22695 <https://github.com/Perl/perl5/issues/22695>]``[GH #22104 <https://github.com/Perl/perl5/issues/22104>]

๐Ÿ–ฅ๏ธ MacOS (Darwin)

Collation of strings using locales on MacOS 15 (Darwin 24) and up has been turned off due to a failed assertion in its libc. ๐Ÿ˜ฌ

If earlier versions are also experiencing issues (such as failures in locale.t), you can explicitly disable locale collation by adding the "-Accflags=-DNO_LOCALE_COLLATE" option to your invocation of "./Configure", or just "-DNO_LOCALE_COLLATE" to the "ccflags" and "cppflags" variables in config.sh.

โœจ Internal Changes โœจ

okay bestie, this is the behind-the-scenes tea ๐Ÿซ– โ€” the stuff that makes Perl's insides go brrr. no cap, it's giving very coder-girl. let's go ๐Ÿ’…

  • The sv_strftime_ints function in perlapi is introduced. It's an enhanced version of my_strftime in perlapi, which is retained for backwards compatibility. Both are to call strftime(3) when you have the year, month, hour, etc. The new function handles UTF8ness for you, and allows you to specify if you want the possibility of daylight savings time to be considered. my_strftime never considers DST. ๐Ÿ’–
  • The bytes_to_utf8, bytes_from_utf8, and bytes_from_utf8_loc functions are no longer experimental. โœจ
  • Calls to call_argv() with the G_DISCARD flag set also ensure the SV parameters constructed from the argv parameter are released before call_argv() returns. Previously they were released on the next FREETMPS. GH #22255 (https://github.com/Perl/perl5/issues/22255) ๐Ÿฆ‹
  • When built with the -DDEBUGGING compile option, perl API functions that take pointers to distinct types of SVs (AVs, HVs or CVs) will check the SvTYPE() of the passed values to ensure they are valid. Additionally, internal code within core functions that attempts to extract AVs, HVs or CVs from reference values passed in will also perform such checks.

While this has been entirely tested by normal Perl CI testing, there may still be some corner-cases where these constraints are violated in otherwise-valid calls. These may require further investigation if they are found, and specific code to be adjusted to account for it. ๐Ÿ˜ญ

  • The op_dump() function has been expanded to include additional information about the recent OP_METHSTART and OP_INITFIELD ops, as well as for OP_ARGCHECK and OP_ARGELEM which had not been done previously. ๐Ÿ”ฅ
  • op_dump() now also has the facility to print extra debugging information about custom operators, if those operators register a helper function via the new xop_dump element of the XOP structure. For more information, see the relevant additions to perlguts. ๐Ÿฆ‹
  • New API functions are introduced to convert strings encoded in UTF-8 to their ordinal code point equivalent. These are safe to use by default, and generally more convenient to use than the existing ones. ๐Ÿ‘‘
    • utf8_to_uv in perlapi and utf8_to_uv_or_die in perlapi replace utf8_to_uvchr in perlapi (which is retained for backwards compatibility), but you should convert to use the new forms, as likely you aren't using the old one safely.
    • To convert in the opposite direction, you can now use uv_to_utf8 in perlapi. This is not a new function, but a new synonym for uvchr_to_utf8 in perlapi. It is added so you don't have to learn two sets of names.
    • There are also two new functions, strict_utf8_to_uv in perlapi and c9strict_utf8_to_uv in perlapi which do the same thing except when the input string represents a code point that Unicode doesn't accept as legal for interchange, using either the strict original definition (strict_utf8_to_uv), or the looser one given by Unicode Corrigendum #9 (https://www.unicode.org/versions/corrigendum9.html) (c9strict_utf8_to_uv). When the input string represents one of the restricted code points, these functions return the Unicode "REPLACEMENT CHARACTER" instead.
    • Also extended_utf8_to_uv in perlapi is a synonym for utf8_to_uv, for use when you want to emphasize that the entire range of Perl extended UTF-8 is acceptable.
    • There are also replacement functions for the three more specialized conversion functions that you are unlikely to need to use. Again, the old forms are kept for backwards compatibility, but you should convert to use the new forms.
      • utf8_to_uv_flags in perlapi replaces utf8n_to_uvchr in perlapi.
      • utf8_to_uv_errors in perlapi replaces utf8n_to_uvchr_error in perlapi.
      • utf8_to_uv_msgs in perlapi replaces utf8n_to_uvchr_msgs in perlapi.
    • Also added are the inverse functions uv_to_utf8_flags in perlapi and uv_to_utf8_msgs in perlapi, which are synonyms for the existing functions, uvchr_to_utf8_flags in perlapi and uvchr_to_utf8_flags_msgs in perlapi respectively. These are provided only so you don't have to learn two sets of names. ๐Ÿ’œ
  • Three new API functions are introduced to convert strings encoded in UTF-8 to native bytes format (if possible). These are easier to use than the existing ones, and they avoid unnecessary memory allocations. The functions are utf8_to_bytes_overwrite in perlapi which is used when it is ok for the input string to be overwritten with the converted result; and utf8_to_bytes_new_pv in perlapi and utf8_to_bytes_temp_pv in perlapi when the original string must be preserved intact. utf8_to_bytes_temp_pv returns the result in a temporary using perlapi's SAVEFREEPV that will automatically be destroyed. With utf8_to_bytes_new_pv, you are responsible for freeing the newly allocated memory that is returned if the conversion is successful.

The latter two functions are designed to replace bytes_from_utf8 in perlapi which creates memory unnecessarily, or unnecessarily large. ๐Ÿงš

  • New API functions valid_identifier_pve(), valid_identifier_pvn() and valid_identifier_sv() have been added, which test if a string would be considered by Perl to be a valid identifier name. ๐ŸŒธ
  • When assigning from an SVt_IV into a SVt_NV (or vice versa), providing that both are "bodyless" types, Perl_sv_setsv_flags will now just change the destination type to match the source type. Previously, an SVt_IV would have been upgraded to a SVt_PVNV to store an NV, and an SVt_NV would have been upgraded to a SVt_PVIV to store an IV. This change prevents the need to allocate - and later free - the relevant body struct. ๐ŸŽ€
  • Two new API functions are introduced to convert strings encoded in native bytes format to UTF-8. These return the string unchanged if its UTF-8 representation is the same as the original. Otherwise, new memory is allocated to contain the converted string. This is in contrast to the existing bytes_to_utf8 in perlapi which always allocates new memory. The new functions are bytes_to_utf8_free_me in perlapi and bytes_to_utf8_temp_pv in perlapi. bytes_to_utf8_temp_pv in perlapi arranges for the new memory to automatically be freed. With bytes_to_utf8_free_me, you are responsible for freeing any newly allocated memory. ๐Ÿ’–
  • The way that subroutine signatures are parsed by the parser grammar has been changed.

Previously, when parsing individual signature parameters, the parser would accumulate an OP_ARGELEM optree fragment for each parameter on the parser stack, collecting them in an OP_LIST sequence, before finally building the complete argument handling optree itself, in a large action block defined directly in perly.y.

In the new approach, all the optree generation is handled by newly-defined functions in op.c which are called by the action blocks in the parser. These do not keep state on the parser stack, but instead in a dedicated memory structure referenced by the main PL_parser structure. This is intended to be largely opaque to other code, and accessed only via the new functions.

This new arrangement is intended to allow more flexible code generation and additional features to be developed in the future. ๐Ÿš€

  • Three new API functions have been added to interact with the regexp global match position stored in an SV. These are sv_regex_global_pos_get(), sv_regex_global_pos_set() and sv_regex_global_pos_clear(). Using these API functions avoids XS modules needing to know about or interact directly with the way this position is currently stored, which involves the PERL_MAGIC_regex_global magic type. ๐Ÿ”ฎ
  • New SvVSTRING API macro

A new API macro has been added, which is used to obtain the second string buffer out of a vstring SV, in a manner similar to the SvPV macro which obtains the regular string buffer out of a regular SV.

STRLEN len;
const char *vstr_pv = SvVSTRING(sv, vstr_len);

See SvVSTRING in perlapi. ๐ŸŒˆ

  • ExtUtils::ParseXS has been extensively refactored internally and extensive tests have been added. Most of these changes shouldn't be visible externally with a few exceptions, the main ones being:
    • The generated C code, especially for returning values, may have changed slightly, and in some cases be slightly more efficient (in particular, using TARG more often to return a value rather than creating a new temporary).
    • The parser is more likely to give warnings now on XS errors which previously would have just silently generated invalid C code.
    • One XS bug has been fixed in a way that may be highly visible. Previously when parsing the parameters of an XS sub declaration, if a parameter couldn't be parsed, it was quietly ignored. This meant that it would still consume an argument, but wouldn't declare a C variable: a bit like the Perl-level my ($a, undef, $c) = @_. Now, it gives a compile error. This will break XS code that does (for example):
void
foo(int a, /* skip arg */, int c)

because C-comments aren't part of XS syntax, and so the parameter was a syntax error and was quietly skipped. This is better written as

void
foo(int a, b, int c)

since parameters which are not assigned a type act as placeholders. ๐Ÿ’€

โœจ Selected Bug Fixes โœจ

okay bestie, itโ€™s bug-fix roundup time and this section is giving โ€œwe fixed things that were absolutely not itโ€ ๐Ÿ’… every single one is here, no cap. ๐Ÿ›โœจ

($x &= $y) += $z;
# Equivalent to:
#  $x &= $y;
#  $x += $z;

However, the separate numeric/string bitwise operators provided by the bitwise feature, &= ^= |= &.= ^.= |.=, did not return such lvalues:

use feature qw(bitwise);
($x &= $y) += $z;
# Used to die:
#  Can't modify numeric bitwise and (&) in addition (+) at ...

This has been corrected. [GH #22412 <https://github.com/Perl/perl5/issues/22412>]

  • Starting in v5.39.8, strftime in POSIX would crash or produce odd errors (such as Out of memory in perl:util:safesysmalloc) when given a format string that wasnโ€™t actually a string, but a number, undef, or an object (even one with overloaded string conversion). Now strftime stringifies its first argument, as before. [GH #22498 <https://github.com/Perl/perl5/issues/22498>]

Also, fixed POSIX::strftime(). [GH #22369 <https://github.com/Perl/perl5/issues/22369>]

  • pack("p", ...) and pack("P", ...) now SvPV_force() the supplied SV unless it is read only. This will remove CoW from the SV and prevents code that writes through the generated pointer from modifying the value of other SVs that happen to share the same CoWed string buffer. Note: this does not make pack("p",... ) safe โ€” if the SV is magical, then any writes to the buffer will likely be discarded on the next read. [GH #22380 <https://github.com/Perl/perl5/issues/22380>]
  • Enforce no feature "bareword_filehandles" for bareword file handles that have strictness removed because they are used in open() with a dup mode, such as in open my $fh, ">&", THISHANDLE. [GH #22568 <https://github.com/Perl/perl5/issues/22568>]
  • Using goto to tail call, or using the call_sv() and related APIs to call, any of trim(), refaddr(), reftype(), ceil(), floor() or stringify() in the builtin:: package would crash or assert due to a TARG handling bug. [GH #22542 <https://github.com/Perl/perl5/issues/22542>]
  • Fixed sv_gets() to accept a SSize_t append offset instead of I32. This prevents integer overflows when appending to a large SV for readpipe aka qx// and readline. <https://www.perlmonks.org/?node_id=11161665>
  • Fixed an issue where utf8n_to_uvchr failed to correctly identify certain invalid UTF-8 sequences as invalid. Specifically, sequences that start with continuation bytes or unassigned bytes could cause unexpected behavior or a panic. This fix ensures that such invalid sequences are now properly detected and handled. This correction also resolves related issues in modules that handle UTF-8 processing, such as Encode.pm.
  • The perl parser would erroneously parse some POD directives as if they were =cut. Some other POD directives whose names start with cut prematurely terminating an embedded POD section. The following cases were affected: cut followed by a digit (e.g. =cut2studio), cut followed by an underscore (e.g. =cut_grass), and in string eval, any identifier starting with cut (e.g. =cute). [GH #22759 <https://github.com/Perl/perl5/issues/22759>]
  • Builds with -msse and quadmath on 32-bit x86 systems would crash with a misaligned access early in the build. [GH #22577 <https://github.com/Perl/perl5/issues/22577>]
  • On threaded builds on POSIX-like systems, if the perl signal handler receives a signal, we now resend the signal to the main perl thread. Previously this would crash. [GH #22487 <https://github.com/Perl/perl5/issues/22487>]
  • Declaring a lexically scoped array or hash using state within a subroutine and then immediately returning no longer triggers a Bizarre copy of HASH/ARRAY in subroutine exit error. [GH #18630 <https://github.com/Perl/perl5/issues/18630>]
  • builtin::trim() didnโ€™t properly clear TARG, which could result in out-of-date cached numeric versions of the value being used on a second evaluation. Properly clear any cached values. [GH #22784 <https://github.com/Perl/perl5/issues/22784>]
  • shmread in perlfunc and shmwrite in perlfunc are no longer limited to 31-bit values and can use all the available bits on a platform for their POS and SIZE arguments. [GH #22895 <https://github.com/Perl/perl5/issues/22895>]
  • shmread in perlfunc is now better behaved if VAR is not a plain string. If VAR is a tied variable, it calls STORE once; previously, it would also call FETCH, but without using the result. If VAR is a reference, the referenced entity has its refcount properly decremented when VAR is turned into a string; previously, it would leak memory. [GH #22898 <https://github.com/Perl/perl5/issues/22898>]
  • The $SIG{__DIE__} and $SIG{__WARN__} handlers can no longer be invoked recursively, either deliberately or by accident, as described in %SIG in perlvar. That is, when an exception (or warning) triggers a call to a $SIG{__DIE__} (or $SIG{__WARN__}) handler, further exceptions (or warnings) are processed directly, ignoring %SIG until the original $SIG{__DIE__} (or $SIG{__WARN__}) handler call returns. [GH #14527 <https://github.com/Perl/perl5/issues/14527>], [GH #22984 <https://github.com/Perl/perl5/issues/22984>], [GH #22987 <https://github.com/Perl/perl5/issues/22987>]
  • The ObjectFIELDS() for an object and xhv_class_fields for the objectโ€™s stash werenโ€™t always NULL or not-NULL, confusing sv_dump() (and hence Devel::Peekโ€™s Dump()) into crashing on an object with no defined fields in some cases. [GH #22959 <https://github.com/Perl/perl5/issues/22959>]
  • When comparing strings when using a UTF-8 locale, the behavior was previously undefined if either or both contained an above-Unicode code point, such as 0x110000. Now all such code points will collate the same as the highest Unicode code point, U+10FFFF. [GH #22989 <https://github.com/Perl/perl5/issues/22989>]
  • In regexes, the contents of \g{...} backreferences are now properly validated. Previously, \g{1 FOO} was silently parsed as \g{1}, ignoring everything after the first number. [GH #23050 <https://github.com/Perl/perl5/issues/23050>]
  • A run-time pattern which contained a code block which recursed back to the same bit of code which ran that match could cause a crash. [GH #22869 <https://github.com/Perl/perl5/issues/22869>]

For example:

my $r = qr/... (?{ foo() if ... }) .../;
sub foo { $string =~ $r }
foo()
  • In some cases an eval would not add integer parts to the source lines saved by the debugger. [GH #23151 <https://github.com/Perl/perl5/issues/23151>]
  • In debugging mode, perl saves source lines from all files (plus an indication of whether each line is breakable) for use by the debugger. The internal storage format has been optimized to use less memory. This should save 24 bytes per stored line for 64-bit systems, more for -Duselongdouble or -Dusequadmath builds. Discussed in [GH #23171 <https://github.com/Perl/perl5/issues/23171>].
  • Ensure cloning the save stack for fork emulation doesnโ€™t duplicate freeing the RExC state. [GH #23022 <https://github.com/Perl/perl5/issues/23022>]
  • Smartmatch against a code reference that uses a loop exit such as last would crash perl. [GH #16608 <https://github.com/Perl/perl5/issues/16608>]
  • Class initializers and ADJUST blocks, per perlclass, that called last or other loop exits would crash perl. Same cause as for [GH #16608 <https://github.com/Perl/perl5/issues/16608>].
  • Exceptions thrown and caught entirely within a defer {} or finally {} block no longer stop the outer run-loop.

Code such as the following would stop running the contents of the defer block once the inner exception in the inner try/catch block was caught. This has now been fixed, and runs as expected. ([GH #23064 <https://github.com/Perl/perl5/issues/23064>]).

defer {
    try { die "It breaks\n"; }
    catch ($e) { warn $e }

    say "This line would never run";
}
  • readline in perlfunc now clears the error flag if an error occurs when reading and that error is EAGAIN or EWOULDBLOCK. This allows code that depended on readline to clear all errors to ignore these relatively harmless errors. [GH #22883 <https://github.com/Perl/perl5/issues/22883>]
  • open automatically creates an anonymous temporary file when passed undef as a filename:
open(my $fh, "+>", undef) or die ...

This is supposed to work only when the undefined value is the one returned by the undef function.

In perls before 5.41.3, this caused a problem due to the fact that the same undefined value can be generated by lookups of non-existent hash keys or array elements, which can lead to bugs in user-level code (reported as [GH #22385 <https://github.com/Perl/perl5/issues/22385>]).

In 5.41.3, additional checks based on the syntax tree of the call site were added, which fixed this issue for some number of common cases, though not all of them, at the cost of breaking the ability of APIs that wrap open to expose its anonymous file mode. A notable example of such an API is autodie.

This release reverts to the old problem in preference to the new one for the time being.

๐Ÿ’” OBITUARIES

Abe Timmerman

Abe Timmerman (ABELTJE) passed away on August 15, 2024.

Since 2002, Abe built and maintained the Test::Smoke project: "a set of scripts and modules that try to run the Perl core tests on as many configurations as possible and combine the results into an easy to read report". Smoking Perl on as many platforms and configurations as possible has been instrumental in finding bugs and developing patches for those bugs. ๐Ÿ’–

Abe was a regular attendee of the Perl Toolchain Summit (nรฉe Perl QA Hackathon), the Dutch Perl Workshop and the Amsterdam.pm user group meetings. With his kindness, his smile and his laugh, he helped make Perl and its community better.

Abeltje's memorial card said "Grab every opportunity to have a drink of bubbly. This is an opportunity". We'll miss you Abe, and we'll have a drink of bubbly in your honor. ๐Ÿฅ‚

Andrew Main

Andrew Main (ZEFRAM) passed away on March 10, 2025.

Zefram was a brilliant person, seemingly knowledgeable in everything and happy to impart his knowledge and share his striking insights with a gentle, technical demeanor that often failed to convey the genuine care with which he communicated.

It would be impossible to overstate the impact that Zefram has had on both the language and culture of Perl over the years. From his countless contributions to the code-base, to his often quirky but always distinctive appearances at conferences and gatherings, his influence and memory are sure to endure long into the future. ๐Ÿฆ‹

Zefram wished to have no designated memorial location in meatspace. His designated memorial location in cyberspace is <http://www.fysh.org/~zefram/personal/>.


๐Ÿซถ ACKNOWLEDGEMENTS

So like, Perl 5.42.0 represents approximately 13 months of development since Perl 5.40.0 and contains approximately 280,000 lines of changes across 1,600 files from 65 authors. The way that's a whole city of people, bestie. ๐Ÿ™๏ธโœจ

Excluding auto-generated files, documentation and release tools, there were approximately 94,000 lines of changes to 860 .pm, .t, .c and .h files.

Perl continues to flourish into its fourth decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.42.0:

Aaron Dill, Andrei Horodniceanu, Andrew Ruthven, Antanas Vaitkus, Aristotle Pagaltzis, Branislav Zahradnรญk, brian d foy, Chad Granum, Chris 'BinGOs' Williams, Craig A. Berry, Dabrien 'Dabe' Murphy, Dagfinn Ilmari Mannsรฅker, Dan Book, Daniel Dragan, Dan Jacobson, David Cantrell, David Mitchell, E. Choroba, Ed J, Ed Sabol, Elvin Aslanov, Eric Herman, Erik Huelsmann, Gianni Ceccarelli, Graham Knop, hbmaclean, H.Merijn Brand, iabyn, James E Keenan, James Raspass, Johan Vromans, Karen Etheridge, Karl Williamson, Leon Timmermans, Lukas Mai, Marek Rouchal, Marin Tsanov, Mark Fowler, Masahiro Honma, Max Maischein, Paul Evans, Paul Johnson, Paul Marquess, Peter Eisentraut, Peter John Acklam, Philippe Bruhat (BooK), pyrrhlin, Reini Urban, Richard Leach, Robert Rothenberg, Robin Ragged, Russ Allbery, Scott Baker, Sergei Zhmylev, Sevan Janiyan, Sisyphus, ล tฤ›pรกn Nฤ›mec, Steve Hay, TAKAI Kousuke, Thibault Duponchelle, Todd Rinaldo, Tony Cook, Unicode Consortium, Vladimรญr Marek, Yves Orton.

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. ๐Ÿ™ˆ Y'all are the real MVPs, fr 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://github.com/Perl/perl5/issues>. There may also be information at <https://www.perl.org/>, the Perl Home Page.

If you believe you have an unreported bug, please open an issue at <https://github.com/Perl/perl5/issues>. Be sure to trim your bug down to a tiny but sufficient test case. (Yes bestie, we need the smallest possible repro โ€” a whole 500-line script is giving "sir this is a Wendy's". ๐Ÿ˜ญ)

If the bug you are reporting has security implications which make it inappropriate to send to a public issue tracker, then see "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec for details of how to report the issue.

Do NOT drop a security vuln in a public issue tracker, okay? Go read perlsec first. That's the vibe check. ๐Ÿ”’

๐ŸŽ€ 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. ๐Ÿซถ Go on, they literally built the thing, they deserve it.


๐Ÿ‘€ SEE ALSO

  • The Changes file for an explanation of how to view exhaustive details on what changed.
  • The INSTALL file for how to build Perl.
  • The README file for general stuff.
  • The Artistic and Copying files for copyright information.

and that's a wrap on the entire page, bestie!! โœจ๐Ÿ‘‘๐Ÿ’…

That's perl v5.44.0, dated 2026-10-17, from the PERL5420DELTA(1perl) page โ€” go forth, read perldelta, and slay. ๐Ÿ’–๐ŸŒธ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from
  • arch rolling: perl 5.44.0-1 ยท Artistic-1.0-Perl AND GPL-1.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms