PERL5380DELTA(1perl)

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

โœจ NAME โœจ

perl5380delta โ€” bestie, this is literally what is new for perl v5.38.0. It lives in the Perl Programmers Reference Guide (you'll see it filed as PERL5380DELTA(1perl) up top) ๐Ÿ’–


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

Okay so this page spills all the tea on the differences between the 5.36.0 release and the 5.38.0 release. That's it, that's the whole job. ๐ŸŒธ


๐Ÿ”ฅ Core Enhancements ๐Ÿ”ฅ

๐Ÿ’… New "class" Feature ๐Ÿ’…

So there's a brand new experimental syntax for defining object classes, where per-instance data lives in field variables that act exactly like lexicals. Iconic behaviour, honestly:

use feature 'class';

class Point
{
    field $x;
    field $y;

    method zero { $x = $y = 0; }
}

The full breakdown lives in perlclass. And if you're the kind of girl who wants the internals, the implementation notes and assorted related details are in perlclassguts. ๐Ÿ‘‘

Heads up bestie: this is still a new and experimental feature, and it is very much still under development. It's gonna get a lot more added to it, refined, and altered in future releases. And because it's experimental, it throws warnings in the experimental::class category. You can shush them with a no warnings statement:
use feature 'class';
no warnings 'experimental::class';

๐ŸŒˆ Unicode 15.0 is supported ๐ŸŒˆ

Go look at <https://www.unicode.org/versions/Unicode15.0.0/> for the details, bestie. ๐Ÿ“š

๐Ÿšจ Deprecation warnings now have specific subcategories ๐Ÿšจ

All deprecation warnings now have their own specific deprecation category that you can disable individually. You can see a list of all deprecated features in perldeprecation, and in warnings. This next list is straight outta warnings:

         +- deprecated ----+
         |                 |
         |                 +- deprecated::apostrophe_as_package_separator
         |                 |
         |                 +- deprecated::delimiter_will_be_paired
         |                 |
         |                 +- deprecated::dot_in_inc
         |                 |
         |                 +- deprecated::goto_construct
         |                 |
         |                 +- deprecated::smartmatch
         |                 |
         |                 +- deprecated::unicode_property_name
         |                 |
         |                 +- deprecated::version_downgrade

You can still disable all deprecation warnings in one single statement with

no warnings 'deprecated';

but now you get finer grained control. And like it's always been, these warnings are automatically enabled with

use warnings;

๐Ÿช %{^HOOK} API introduced ๐Ÿช

So, for various reasons it can be genuinely difficult to create subroutine wrappers for some of perl's keywords. Any keyword with an undefined prototype simply cannot be wrapped with a subroutine, and some keywords that perl does permit you to wrap are, in practice, extremely tricky to wrap. For example, require is tricky โ€” it's possible, but doing so changes the stack depth, and the standard methods of exporting assume they'll be exporting to a package at a certain stack depth up the stack, so the wrapper will change where functions get exported to unless it's implemented with a great deal of care. Awkward. Very awkward. ๐Ÿ˜ญ

So accordingly, we've introduced a new hash called %{^HOOK} which is meant to make those cases easier. When a keyword supports any kind of special hook, that hook lives in this new hash. Hooks in this hash get named after the function they're called by, followed by two underbars, and then the phase they're executed in โ€” currently that's either before or after the keyword is executed.

In this initial release we support two hooks: require__before and require__after. They're there to make it easier to do stuff before and after a require statement. ๐Ÿซถ

See perlvar for more details.

๐ŸŽฒ PERL_RAND_SEED ๐ŸŽฒ

New environment variable just dropped: PERL_RAND_SEED. Use it to make a perl program that calls rand without explicitly calling srand(), or that calls srand() with no arguments, become repeatable. See perlrun. โœจ

And if you want this feature gone at compile time, pass this to Configure during the build process:

-Accflags=-DNO_PERL_RAND_SEED

๐Ÿ’ซ Defined-or and logical-or assignment default expressions in signatures ๐Ÿ’ซ

The default expression for a subroutine signature parameter can now be assigned with the //= or ||= operators, so the defaults apply whenever the caller handed over an undefined or false value (respectively) โ€” not just when the parameter is missing entirely. More detail is in the docs in perlsub. ๐Ÿ“

๐Ÿฆ‹ @INC Hook Enhancements and $INC and INCDIR ๐Ÿฆ‹

The internals for @INC hooks have been hardened to handle various edge cases, and they should no longer segfault or throw assert failures when hooks modify @INC during a require operation. As part of this, we now make sure that any given hook is executed at most once during a require call, and that any duplicate directories don't trigger extra directory probes. No cap.

To give developers more control over dynamic module lookup, a new hook method INCDIR is now supported. An object supporting this method can be injected into the @INC array, and when it's encountered during the module search process it will be executed โ€” exactly like how INC hooks are executed โ€” and its return value gets used as the list of directories to search for the module. Returning an empty list acts as a no-op. ๐Ÿ’…

But listen: since any references returned by this hook will be stringified and used as strings, you may not return a hook to be executed later via this API. Periodt.

When an @INC hook (either INC or INCDIR) is called during require, the $INC variable gets localized to be the value of the index of @INC that the hook came from. If the hook wants to override what the "next" index in @INC should be, it may update $INC to be one less than the desired index (undef is equivalent to -1). This lets an @INC hook completely rewrite the @INC array and have perl restart its directory probes from the beginning of @INC. ๐ŸŒˆ

Blessed CODE references in @INC that don't support the INC or INCDIR methods will no longer trigger an exception โ€” instead they get treated the same as unblessed coderefs are, and executed as though they were an INC hook. So chill. ๐Ÿ˜Œ

๐Ÿ›‘ Forbidden control flow out of "defer" or "finally" now detected at compile-time ๐Ÿ›‘

It is forbidden to try to leave a defer or finally block by means of control flow like return or goto. Previous versions of perl could only catch this when it was actually attempted at runtime.

This version of perl adds compile-time detection for lots of cases that can be statically determined. Which means code that compiled successfully on a previous version of perl might now get reported as a compile-time error with this one. But bestie, don't panic โ€” this only happens in cases where it would have been an error to actually execute the code anyway. The error just shows up at an earlier time. ๐Ÿ’€

๐Ÿ”ฎ Optimistic Eval in Patterns ๐Ÿ”ฎ

Using (?{ ... }) and (??{ ... }) in a pattern disables various optimisations globally in that pattern. Which you may or may not want, honestly. This release adds the (*{ ... }) equivalent. The only difference is that it does not โ€” and never will โ€” disable any optimisations in the regex engine. โœจ

Now, this may make it more unstable in the sense that it may be called more or less times in the future. However, the number of times it executes will truly match how the regex engine functions. For example, certain types of optimisation are disabled when (?{ ... }) is included in a pattern, so patterns that are O(N) in normal use become O(N*N) with a (?{ ... }) pattern in them. Switching to (*{ ... }) means the pattern stays O(N). Slay. ๐Ÿ‘‘

๐Ÿ“ˆ REG_INF has been raised from 65,536 to 2,147,483,647 ๐Ÿ“ˆ

Many regex quantifiers used to be limited to U16_MAX in the past, but are now limited to I32_MAX โ€” so now you can write things like /(?:word){1000000}/. โญ

Warning though: doing that may cause the regex engine to run longer and use more memory. You've been warned, babe. ๐Ÿซ 

๐Ÿ› ๏ธ New API functions optimize_optree and finalize_optree ๐Ÿ› ๏ธ

There are two new API functions for operating on optree fragments, so you can actually invoke the required parts of the optree-generation process that might otherwise not get invoked (e.g. when creating a custom LOGOP). ๐ŸŽ€

To get access to these functions, you first need to set a #define to opt in to using them:

#define PERL_USE_VOLATILE_API
These functions are closely tied to the internals of how the interpreter works, and could be altered or removed at any time if other internal changes make that necessary. Don't get attached. ๐Ÿ’”

๐Ÿšช Some "goto"s are now permitted in "defer" and "finally" blocks ๐Ÿšช

Perl version 5.36.0 added defer blocks, and permitted the finally keyword to add similar behaviour to try/catch syntax. Those did not permit any goto expression within the body, because it could have caused control flow to jump out of the block. But now, some goto expressions are allowed โ€” if they have a constant target label, and that label is found within the block. ๐Ÿ’–

use feature 'defer';

defer {
  goto LABEL;
  print "This does not execute\n";
  LABEL: print "This does\n";
}

๐Ÿงš New regexp variable ${^LAST_SUCCESSFUL_PATTERN} ๐Ÿงš

This gives you access to the last successful pattern that matched in the current scope. Lots of aspects of the regex engine refer to the "last successful pattern" โ€” the empty pattern reuses it, and all of the magic regex vars relate to it. This gives you access to its pattern. So this code:

if (m/foo/ || m/bar/) {
    s//PQR/;
}

can be rewritten as:

if (m/foo/ || m/bar/) {
    s/${^LAST_SUCCESSFUL_PATTERN}/PQR/;
}

and it will do the exactly same thing. Iconic. ๐ŸŒŸ

๐ŸŒ Locale category LC_NAME now supported on participating platforms ๐ŸŒ

On platforms that have the GNU extension LC_NAME category, you may now use it as the category parameter to setlocale in POSIX to set and query its locale. Go off. ๐Ÿ‘‘๐ŸŒธ

โœจ Incompatible Changes โœจ

Okay bestie, these are the glow-downs โ€” stuff that changed and might break your old code. No cap, read carefully. ๐Ÿ’–

readline() no longer clears the stream error and eof flags ๐Ÿ’…

So readline() โ€” which you also know and love as <> โ€” used to be out here clearing the handle's error and eof flags after an error occurred on the stream. Convenient? Rude? Both.

In nearly all cases, that clear is no longer done, so the error and eof flags now properly reflect the status of the stream after readline(). It's giving honest. Periodt.

Since the error flag is no longer cleared, calling close() on the stream may fail, and if the stream wasn't explicitly closed, the implicit close of the stream may produce a warning. ๐Ÿ˜ญ

This has resulted in two main types of problems in downstream CPAN modules, and these may also occur in your code:

  • If your code reads to end of file, and then rebinds the handle to a new file descriptor, previously โ€” since the eof flag wasn't set โ€” you could continue to read from the stream. You now need to clear the eof flag yourself with $handle->clearerr() to continue reading. Slay, but manually. โœจ
  • If your code encounters an error on the stream while reading with readline(), you will need to call $handle->clearerr to continue reading. The one case this occurred, the underlying file descriptor was marked non-blocking, so the read() system call was failing with EAGAIN, which resulted in the error flag being set on the stream. ๐Ÿ’€

The only case where error and eof flags continue to be cleared on error is when reading from the child process for glob() in miniperl. This allows it to correctly report errors from the child process on close(). This is unlikely to be an issue during normal perl development. ๐Ÿซถ

[GH #20060 <https://github.com/Perl/perl5/issues/20060>]

INIT blocks no longer run after an exit() in BEGIN ๐Ÿฆ‹

INIT blocks will no longer run after an exit() performed inside of a BEGIN. So if you were counting on that, bestie, it's a no.

This means that the combination of the -v option and the -c option no longer executes a compile check as well as showing the perl version. The -v option executes an exit(0) after printing the version information inside of a BEGIN block, and the -c check is implemented by using INIT hooks, resulting in the -v option taking precedence. ๐Ÿ‘‘

[GH #1537 <https://github.com/Perl/perl5/issues/1537>] [GH #20181 <https://github.com/Perl/perl5/issues/20181>]

Syntax errors no longer produce "phantom error messages" ๐Ÿ™ˆ

Generally perl will continue parsing the source code even after encountering a compile error. In many cases this is helpful โ€” for instance with misspelled variable names, it is helpful to show as many examples of the error as possible. But in the case of syntax errors, continuing often produces bizarre error messages and may even cause segmentation faults during the compile process. Not cute. Not iconic.

In this release, the compiler will halt at the first syntax error encountered. This means that any code expecting to see the specific error messages we used to produce will be broken. The error that is emitted will be one of the diagnostics that used to be produced, but in some cases some messages that used to be produced will no longer be displayed. ๐Ÿ˜ญ

See "Changes to Existing Diagnostics" for more details.

utf8::upgrade() ๐ŸŒฑ

Starting in this release, if the input string is undef, it remains undef. Previously it would be changed into a defined, zero-length string. That's it. That's the tea. ๐Ÿต

Changes to "thread-safe" locales ๐ŸŒˆ

Perl 5.28 introduced "thread-safe" locales on systems that supported them โ€” namely modern Windows, and systems supporting POSIX 2008 locale operations. These systems accomplish this by having per-thread locales, while continuing to support the older global locale operations for code that doesn't take the steps necessary to use the newer per-thread ones. It's a whole dual-vibe. โœจ

It turns out that some POSIX 2008 platforms have or have had buggy implementations, which forced perl to not use them. The ${^SAFE_LOCALES} scalar variable contains 0 or 1 to indicate whether or not the current platform is considered by perl to have a working thread-safe implementation. Some implementations have been fixed already, but FreeBSD and Cygwin have been newly discovered to be sufficiently buggy that the thread-safe operations are no longer used by perl, starting in this release. Hence, ${^SAFE_LOCALES} is now 0 for them. Older versions of perl can be configured to avoid these buggy implementations by adding the Configure option -DNO_POSIX_2008_LOCALE. ๐Ÿ”ง

And v5.38 fixes a bug in all previous perls that led to locales not being fully thread-safe. The first thread that finishes caused the main thread (named thread0) to revert to the global locale in effect at startup, discarding whatever the thread's locale had been previously set to. If any other thread had switched to the global locale by calling switch_to_global_locale() in XS code, those threads would all share the global locale, and thread0 would not be thread-safe. Big yikes, but fixed now. ๐Ÿ’…


Deprecations โš ๏ธ

Use of "'" as a package name separator is deprecated ๐Ÿšซ

Using "'" as package separator in a variable named in a double-quoted string has warned since 5.28. It is now deprecated in both string interpolation and non-interpolated contexts, and will be removed in Perl 5.42. So maybe start packing your bags, bestie. ๐Ÿงณ

Switch and Smart Match operator ๐Ÿ’€

The switch feature and the smartmatch operator, ~~, were introduced in v5.10. Their behavior was significantly changed in v5.10.1. 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. We've been through it. ๐Ÿ˜ฎโ€๐Ÿ’จ

In v5.38.0, we are declaring the experiment a failure. Some future system may take the conceptual place of smartmatch, but it has not yet been designed or built. So don't hold your breath. ๐Ÿซ

These features will be entirely removed from perl in v5.42.0. Periodt. ๐Ÿ’…


Performance Enhancements ๐Ÿš€๐Ÿ”ฅ

โœจ Modules and Pragmata โœจ

Okay so bestie, this is the glow-up section, and the modules literally ate. ๐Ÿ’… No cap, it's giving upgrade era, fr fr. Letโ€™s get into it. ๐Ÿฆ‹

๐Ÿ’– Updated Modules and Pragmata ๐Ÿ’–

  • is_tainted() โ€” okay so they literally added this builtin function, no cap. [GH #19854 https://github.com/Perl/perl5/issues/19854]
  • export_lexically() โ€” added as a builtin function, as per PPC 0020 https://github.com/Perl/PPCs/blob/main/ppcs/ppc0020-lexical-export.md. [GH #19895 https://github.com/Perl/perl5/issues/19895]
  • Support for PPC 0018 โ€” https://github.com/Perl/PPCs/blob/main/ppcs/ppc0018-module-true.md, so like, use feature "module_true"; has been added to the default feature bundle for v5.38 and later. It may also be used explicitly. When enabled inside of a module, the module does not need to return true explicitly, and in fact the return will be forced to a simple true value regardless of what it originally was. Periodt. ๐Ÿ’…
  • Attribute::Handlers โ€” upgraded from version 1.02 to 1.03. โœจ
  • attributes โ€” upgraded from version 0.34 to 0.35.
  • autodie โ€” upgraded from version 2.34 to 2.36.
  • B โ€” upgraded from version 1.83 to 1.88.
  • B::Concise โ€” upgraded from version 1.006 to 1.007.
  • B::Deparse โ€” upgraded from version 1.64 to 1.74.
  • Benchmark โ€” upgraded from version 1.23 to 1.24.
  • bignum โ€” upgraded from version 0.65 to 0.66.
  • Carp โ€” upgraded from version 1.52 to 1.54.
  • Class::Struct โ€” upgraded from version 0.66 to 0.68.
  • Compress::Raw::Bzip2 โ€” upgraded from version 2.103 to 2.204_001.
  • Compress::Raw::Zlib โ€” upgraded from version 2.105 to 2.204_001.
  • Config::Perl::V โ€” upgraded from version 0.33 to 0.36.
  • CPAN โ€” upgraded from version 2.33 to 2.36.
  • Data::Dumper โ€” upgraded from version 2.184 to 2.188.
  • DB_File โ€” upgraded from version 1.857 to 1.858.
  • Devel::Peek โ€” upgraded from version 1.32 to 1.33.
  • Devel::PPPort โ€” upgraded from version 3.68 to 3.71.
  • Digest::MD5 โ€” upgraded from version 2.58 to 2.58_01.
  • Digest::SHA โ€” upgraded from version 6.02 to 6.04.
  • DynaLoader โ€” upgraded from version 1.52 to 1.54.
  • Encode โ€” upgraded from version 3.17 to 3.19.
  • encoding::warnings โ€” upgraded from version 0.13 to 0.14.
  • Env โ€” upgraded from version 1.05 to 1.06.
  • Errno โ€” upgraded from version 1.36 to 1.37.
  • experimental โ€” upgraded from version 0.028 to 0.031.
  • ExtUtils::CBuilder โ€” upgraded from version 0.280236 to 0.280238.
  • ExtUtils::Install โ€” upgraded from version 2.20 to 2.22.
  • ExtUtils::MakeMaker โ€” upgraded from version 7.64 to 7.70.
  • ExtUtils::Miniperl โ€” upgraded from version 1.11 to 1.13.
  • ExtUtils::ParseXS โ€” upgraded from version 3.45 to 3.51.
  • ExtUtils::PL2Bat โ€” upgraded from version 0.004 to 0.005.
  • ExtUtils::Typemaps โ€” upgraded from version 3.45 to 3.51.
  • feature โ€” upgraded from version 1.72 to 1.82.
  • File::Basename โ€” upgraded from version 2.85 to 2.86.
  • File::Copy โ€” upgraded from version 2.39 to 2.41.
  • File::Find โ€” upgraded from version 1.40 to 1.43.
  • File::Glob โ€” upgraded from version 1.37 to 1.40.
  • File::Spec โ€” upgraded from version 3.84 to 3.89.
  • File::stat โ€” upgraded from version 1.12 to 1.13.
  • FileHandle โ€” upgraded from version 2.03 to 2.05.
  • Filter::Util::Call โ€” upgraded from version 1.60 to 1.64.
  • GDBM_File โ€” upgraded from version 1.23 to 1.24.
  • Getopt::Long โ€” upgraded from version 2.52 to 2.54.
  • Hash::Util โ€” upgraded from version 0.28 to 0.30.
  • HTTP::Tiny โ€” upgraded from version 0.080 to 0.083.
  • I18N::Langinfo โ€” upgraded from version 0.21 to 0.22.
  • IO โ€” upgraded from version 1.50 to 1.52.
  • IO-Compress โ€” upgraded from version 2.106 to 2.204.
  • IO::Socket::IP โ€” upgraded from version 0.41 to 0.41_01. ๐Ÿ‰
  • IO::Zlib โ€” upgraded from version 1.11 to 1.14.
  • JSON::PP โ€” upgraded from version 4.07 to 4.16.
  • libnet โ€” upgraded from version 3.14 to 3.15.
  • Locale::Maketext โ€” upgraded from version 1.31 to 1.33.
  • Math::BigInt โ€” upgraded from version 1.999830 to 1.999837.
  • Math::BigInt::FastCalc โ€” upgraded from version 0.5012 to 0.5013.
  • Math::BigRat โ€” upgraded from version 0.2621 to 0.2624.
  • Math::Complex โ€” upgraded from version 1.5902 to 1.62.
  • Memoize โ€” upgraded from version 1.03_01 to 1.16.
  • MIME::Base64 โ€” upgraded from version 3.16 to 3.16_01.
  • Module::CoreList โ€” upgraded from version 5.20220520 to 5.20230520.
  • mro โ€” upgraded from version 1.26 to 1.28.
  • NDBM_File โ€” upgraded from version 1.15 to 1.16.
  • Net::Ping โ€” upgraded from version 2.74 to 2.76.
  • ODBM_File โ€” upgraded from version 1.17 to 1.18.
  • Opcode โ€” upgraded from version 1.57 to 1.64.
  • overload โ€” upgraded from version 1.35 to 1.37.
  • parent โ€” upgraded from version 0.238 to 0.241.
  • PerlIO::via::QuotedPrint โ€” upgraded from version 0.09 to 0.10.
  • Pod::Checker โ€” upgraded from version 1.74 to 1.75.
  • Pod::Html โ€” upgraded from version 1.33 to 1.34.
  • Pod::Usage โ€” upgraded from version 2.01 to 2.03.
  • podlators โ€” upgraded from version 4.14 to 5.01.
  • POSIX โ€” upgraded from version 2.03 to 2.13.
  • re โ€” upgraded from version 0.43 to 0.44.
  • Safe โ€” upgraded from version 2.43 to 2.44.
  • Scalar::Util โ€” upgraded from version 1.62 to 1.63.
  • SDBM_File โ€” upgraded from version 1.15 to 1.17.
  • Socket โ€” upgraded from version 2.033 to 2.036.
  • Storable โ€” upgraded from version 3.26 to 3.32.
  • Sys::Hostname โ€” upgraded from version 1.24 to 1.25.
  • Term::Cap โ€” upgraded from version 1.17 to 1.18.
  • Test::Simple โ€” upgraded from version 1.302190 to 1.302194.
  • Text::Balanced โ€” upgraded from version 2.04 to 2.06.
  • threads โ€” upgraded from version 2.27 to 2.36.
  • threads::shared โ€” upgraded from version 1.64 to 1.68.
  • Tie::File โ€” upgraded from version 1.06 to 1.07.
  • Time::HiRes โ€” upgraded from version 1.9770 to 1.9775.
  • Time::Piece โ€” upgraded from version 1.3401 to 1.3401_01.
  • Unicode::Normalize โ€” upgraded from version 1.31 to 1.32.
  • UNIVERSAL โ€” upgraded from version 1.14 to 1.15.
  • User::grent โ€” upgraded from version 1.03 to 1.04.
  • User::pwent โ€” upgraded from version 1.01 to 1.02.
  • utf8 โ€” upgraded from version 1.24 to 1.25.
  • warnings โ€” upgraded from version 1.58 to 1.65.
  • XS::APItest โ€” upgraded from version 1.22 to 1.32.
  • XSLoader โ€” upgraded from version 0.31 to 0.32.

โœจ Documentation โœจ

Okay so the docs got some love too. ๐Ÿ’–

๐Ÿ“š New Documentation ๐Ÿ“š

  • perlclass โ€” describes the new "class" feature. It's giving main character energy. ๐Ÿ‘‘
  • perlclassguts โ€” describes the internals of the new "class" feature. The behind-the-scenes tea. โ˜•

๐Ÿ“ 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. No cap, they want your feedback. ๐Ÿ™ˆ

Additionally, the following selected changes have been made:

perlapi

  • Documented "hv_ksplit" ๐Ÿ’…
  • Documented "hv_name_set" ๐Ÿ’–
  • "hv_store" and "hv_stores" documentation have been greatly improved. Slay. โœจ
  • Documented "gv_autoload_pv"
  • Documented "gv_autoload_pvn"
  • Documented "gv_autoload_sv"
  • Documented "gv_name_set"
  • Documented "start_subparse"
  • Documented "SV_CHECK_THINKFIRST_COW_DROP"
  • Documented "SV_CHECK_THINKFIRST"
  • Documented "SvPV_shrink_to_cur"
  • Documented "save_aelem"
  • Documented "save_aelem_flags"
  • Documented "save_helem"
  • Documented "save_helem_flags"

perldeprecation

  • Added information about unscheduled deprecations and their categories. ๐Ÿ‘€
  • Added category information for existing scheduled deprecations. ๐Ÿ—‚๏ธ
  • Added smartmatch and apostrophe as a package separator deprecation data. ๐Ÿ’€

perlintern

  • Documented "save_pushptr"
  • Documented "save_scalar_at"
  • Entries have been added to perlguts for the new "newAV_alloc_x", "newAV_alloc_xz" and *_simple functions. ๐Ÿงš
  • References to the now-defunct PrePAN service have been removed from perlcommunity and perlmodstyle. Rip PrePAN. ๐Ÿชฆ
  • A section on symbol naming has been added to perlhacktips. โœจ
  • perlexperiment has been edited to properly reference the warning categories for the defer block modifier and extra paired delimiters for quote-like operators. ๐Ÿ“

perlexperiment

  • Smartmatch has been moved from experimental status to deprecated status. Unfortunately the experiment did not work out. ๐Ÿ˜ญ It's giving flop era.

perlfunc

  • Some wording improvements have been made for the "ucfirst", "push", "unshift" and "bless" functions, as well as additional examples added. ๐Ÿ‘‘

perlhacktips

  • A new section, "Writing safer macros" in perlhacktips has been added to discuss pitfalls and solutions to using C macros in C and XS code. ๐Ÿ› ๏ธ
  • A new section, "Choosing good symbol names" in perlhacktips, has been added to discuss unexpected gotchas with names. ๐Ÿค”

perlop

  • Document the behavior of matching the empty pattern better and specify its relationship to the new "${^LAST_SUCCESSFUL_PATTERN}" properly. ๐Ÿ’…

perlvar

  • Added a section on "Scoping Rules of Regex Variables", and other wording improvements made throughout. ๐ŸŽ€
  • Added information on the new "%{^HOOK}" interface, and the new "require__before" and "require__after" hooks which it exposes. ๐Ÿช
  • Correct information on the regex variables "${^PREMATCH}", "${^MATCH}" and "${^POSTMATCH}", all of which were incorrectly documented due to an oversight. Specifically they only work properly after a regex operation that used the /p modifier to enable them. ๐Ÿ‘€
  • Added information on the new regex variable "${^LAST_SUCCESSFUL_PATTERN}", which represents the pattern of the last successful regex match in scope. ๐Ÿ”

DIAGNOSTICS ๐Ÿ’–

okay bestie, this whole section is about diagnostic output โ€” warnings, fatal errors, all the little messages perl yells at you when stuff goes sideways ๐Ÿ’…. The following additions or changes have been made to diagnostic output, including warnings and fatal error messages. For the complete list of diagnostic messages, see perldiag.


New Diagnostics โœจ

New Errors ๐Ÿšจ

  • A new syntax error has been added for the error that a catch block does not have its required variable declaration. See catch block requires a (VAR).
  • Too many nested BEGIN blocks, maximum of %d allowed
  • Execution of %s aborted due to compilation errors.
  • Can't locate object method "INC", nor "INCDIR" nor string overload via package "%s" %s in @INC
  • Attempt to bless into a class โ€” (F) You are attempting to call bless with a package name that is a new-style class. This is not necessary, as instances created by the constructor are already in the correct class. Instances cannot be created by other means, such as bless.
  • Cannot assign :param(%s) to field %s because that name is already in use โ€” (F) An attempt was made to apply a parameter name to a field, when the name is already being used by another field in the same class, or one of its parent classes. This would cause a name clash so is not allowed.
  • Cannot create class %s as it already has a non-empty @ISA โ€” (F) An attempt was made to create a class out of a package that already has an @ISA array, and the array is not empty. This is not permitted, as it would lead to a class with inconsistent inheritance.
  • Cannot invoke a method of "%s" on an instance of "%s" โ€” (F) You tried to directly call a method subroutine of one class by passing in a value that is an instance of a different class. This is not permitted, as the method would not have access to the correct instance fields.
  • Cannot invoke method on a non-instance โ€” (F) You tried to directly call a method subroutine of a class by passing in a value that is not an instance of that class. This is not permitted, as the method would not then have access to its instance fields.
  • Cannot '%s' outside of a 'class' โ€” (F) You attempted to use one of the keywords that only makes sense inside a class definition, at a location that is not inside such a class.
  • Cannot reopen existing class "%s" โ€” (F) You tried to begin a class definition for a class that already exists. A class may only have one definition block.
  • Can't bless an object reference โ€” (F) You attempted to call bless on a value that already refers to a real object instance.
  • can't convert empty path โ€” (F) On Cygwin, you called a path conversion function with an empty path. Only non-empty paths are legal.
  • Class already has a superclass, cannot add another โ€” (F) You attempted to specify a second superclass for a class by using the :isa attribute, when one is already specified. Unlike classes whose instances are created with bless, classes created via the class keyword cannot have more than one superclass.
  • Class attribute %s requires a value โ€” (F) You specified an attribute for a class that would require a value to be passed in parentheses, but did not provide one. Remember that whitespace is not permitted between the attribute name and its value; you must write this as
class Example::Class :attr(VALUE) ...
  • Class :isa attribute requires a class but "%s" is not one โ€” (F) When creating a subclass using the class :isa attribute, the named superclass must also be a real class created using the class keyword.
  • Field already has a parameter name, cannot add another โ€” (F) A field may have at most one application of the :param attribute to assign a parameter name to it; once applied a second one is not allowed.
  • Field attribute %s requires a value โ€” (F) You specified an attribute for a field that would require a value to be passed in parentheses, but did not provide one. Remember that whitespace is not permitted between the attribute name and its value; you must write this as
field $var :attr(VALUE) ...
  • Field %s is not accessible outside a method โ€” (F) An attempt was made to access a field variable of a class from code that does not appear inside the body of a method subroutine. This is not permitted, as only methods will have access to the fields of an instance.
  • Field %s of "%s" is not accessible in a method of "%s" โ€” (F) An attempt was made to access a field variable of a class, from a method of another class nested inside the one that actually defined it. This is not permitted, as only methods defined by a given class are permitted to access fields of that class.
  • Only scalar fields can take a :param attribute โ€” (F) You tried to apply the :param attribute to an array or hash field. Currently this is not permitted.
  • Required parameter '%s' is missing for %s constructor โ€” (F) You called the constructor for a class that has a required named parameter, but did not pass that parameter at all.
  • Unexpected characters while parsing class :isa attribute: %s โ€” (F) You tried to specify something other than a single class name with an optional trailing version number as the value for a class :isa attribute. This confused the parser.
  • Unrecognized class attribute %s โ€” (F) You attempted to add a named attribute to a class definition, but perl does not recognise the name of the requested attribute.
  • Unrecognized field attribute %s โ€” (F) You attempted to add a named attribute to a field definition, but perl does not recognise the name of the requested attribute.
  • ${^HOOK}{%s} may only be a CODE reference or undef
  • Attempt to set unknown hook '%s' in %{^HOOK}
  • Missing or undefined argument to %s via %{^HOOK}{require__before}
  • Too many capture groups (limit is %d) in regex m/%s/

New Warnings โš ๏ธ

  • Unknown locale category %d โ€” This is a shortened form of an already existing diagnostic, for use when there is no new locale being switched to. The previous diagnostic was misleading in such circumstances.
  • Locale '%s' is unsupported, and may crash the interpreter.
  • Treating %s::INIT block as BEGIN block as workaround
  • Filehandle STD%s reopened as %s only for input
  • %s on BEGIN block ignored
  • ADJUST is experimental โ€” (S experimental::class) This warning is emitted if you use the ADJUST keyword of use feature 'class'. This keyword is currently experimental and its behaviour may change in future releases of Perl.
  • class is experimental โ€” (S experimental::class) This warning is emitted if you use the class keyword of use feature 'class'. This keyword is currently experimental and its behaviour may change in future releases of Perl.
  • Method %s redefined โ€” (W redefine) You redefined a method. To suppress this warning, say
{
   no warnings 'redefine';
   *name = method { ... };
}
  • Odd number of elements in hash field initialization โ€” (W misc) You specified an odd number of elements to initialise a hash field of an object. Hashes are initialised from a list of key/value pairs so there must be a corresponding value to every key. The final missing value will be filled in with undef instead.
  • Old package separator "'" deprecated โ€” (W deprecated, syntax) You used the old package separator ' in a variable, subroutine or package name. Support for the old package separator will be removed in Perl 5.40.
  • field is experimental โ€” (S experimental::class) This warning is emitted if you use the field keyword of use feature 'class'. This keyword is currently experimental and its behaviour may change in future releases of Perl.
  • method is experimental โ€” (S experimental::class) This warning is emitted if you use the method keyword of use feature 'class'. This keyword is currently experimental and its behaviour may change in future releases of Perl.
  • Can't call destructor for 0x%p in global destruction

Changes to Existing Diagnostics ๐Ÿ”„

  • The compiler will now stop parsing on the first syntax error it encounters. Historically, the compiler would try to โ€œskip pastโ€ the error and continue parsing so it could list multiple errors. For things like undeclared variables under strict, that makes sense. For syntax errors, though, it has been found that continuing tends to result in a storm of unrelated or bizarre errors that mostly just obscure the true error. In extreme cases it can even lead to segfaults and other incorrect behavior.

Therefore, the continuation logic has been reformed so that the parse will stop after the first seen syntax error. Semantic errors like undeclared variables will not stop the parse, so you may still see multiple errors when compiling code. However, if there is a syntax error it will be the last error message reported by perl and all of the errors that you see will be something that actually needs to be fixed.

  • Error messages that output class or package names have been modified to output double quoted strings with various characters escaped so as to make the exact value clear to a reader. The exact rules on which characters are escaped may change over time but currently are that printable ASCII codepoints, with the exception of " and \, and Unicode word characters whose codepoint is over 255 are output raw, and any other symbols are escaped much as Data::Dumper might escape them, using \n for newline and \" for double quotes, etc. Codepoints in the range 128-255 are always escaped as they can cause trouble on Unicode terminals when output raw.

In older versions of perl the one liner

$ perl -le'"thing\n"->foo()'

would output the following error message exactly as shown here, with text spread over multiple lines because the \n would be emitted as a raw newline character:

Can't locate object method "foo" via package "thing
" (perhaps you forgot to load "thing
"?) at -e line 1.

As of this release we would output this instead (as one line):

Can't locate object method "foo" via package "thing\n"
  (perhaps you forgot to load "thing\n"?) at -e line 1.

Notice the newline in the package name has been quoted and escaped, so the error message comes out as one single line. It's only shown wrapped onto two lines here so you can actually read it ๐Ÿ’….

  • When package or class names in errors are very large, the middle excess portion gets elided from the message. As of this release, error messages show only up to the first 128 characters and the last 128 characters of a package or class name that's in an error message. Like, say you run:
$ perl -le'("Foo" x 1000)->new()'

it'll output the following as one line (wrapped here for readability only):

Can't locate object method "new" via package "FooFooFooFooFooFooFoo
FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
FooFooFooFooFooFooFooFooFooFooFooFooFooFo"..."oFooFooFooFooFooFooFoo
FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
FooFooFooFooFooFooFooFooFooFooFooFooFoo" (perhaps you forgot to load
"FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFo"...
"oFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
FooFooFooFooFooFooFooFooFooFooFooFooFoo"?)
at -e line 1.

Notice the "prefix"..."suffix" form of the package name in this case. In previous versions of perl the complete string would've been shown, making the error message over 6k long, and there was literally no upper limit on the length of the error message at all ๐Ÿ˜ญ. If you accidentally used a 1MB string as a class name then the error message would be over 2MB long. In this perl the upper limit should be around 2k when eliding and escaping are taken into account.

  • Removed Complex regular subexpression recursion limit (%d) exceeded. The regular expression engine has not used recursion in some time, so this warning no longer makes sense. See GH #19636 โ€” https://github.com/Perl/perl5/pull/19636.
  • Various warnings that used to produce parenthesized hints underneath the main warning message, and after its "location data", were changed to put the hint inline with the main message. For instance:
Bareword found where operator expected at -e line 1, near "foo bar"
    (Do you need to predeclare foo?)

will now look like this, but as one line:

Bareword found where operator expected (Do you need to predeclare
foo?) at -e line 1, near "foo bar"

and as a result such warnings will no longer trigger $SIG{__WARN__} twice, and the hint will be visible when fatal warnings is in effect ๐Ÿ‘€.

  • The error message produced when a require or use statement fails has been changed. It used to contain the words @INC contains:, and it used to show the state of @INC after the require had completed and failed. The error message has been changed to say @INC entries checked: and to reflect the actual directories or hooks that were executed during the require statement. For example:
    perl -e'push @INC, sub {@INC=()}; eval "require Frobnitz"
        or die $@'
    Can't locate Frobnitz.pm in @INC (you may need to install the
    Frobnitz module) (@INC contains:) at (eval 1) line 1.

will change to (with some output elided for clarity):

    perl -e'push @INC, sub {@INC=()}; eval "require Frobnitz"
        or die $@'
    Can't locate Frobnitz.pm in @INC (you may need to install the
    Frobnitz module) (@INC entries checked:
    .../site_perl/5.38.0/x86_64-linux .../site_perl/5.38.0
    .../5.38.0/x86_64-linux .../5.38.0 CODE(0x562745e684b8))
    at (eval 1) line 1.

thus showing the actual directories checked ๐ŸŽ€. Code that checks for @INC contains: in error messages should be hardened against any future wording changes between the @INC and :. For instance, use qr/\@INC[ \w]+:/ instead of using qr/\@INC contains:/ or qr/\@INC entries checked:/ in tests, because that way you get both forward and backward compatibility.

  • Old package separator used in string โ€” this diagnostic is now also part of the deprecated category.
  • given is deprecated replaces given is experimental.
  • when is deprecated replaces when is experimental.
  • Smartmatch is deprecated replaces Smartmatch is experimental.

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

  • make -j6 minitest could fail due to a build conflict in building $(MINIPERL_EXE) between the main make process and a child process. GH #19829 โ€” https://github.com/Perl/perl5/issues/19829
  • Properly populate osvers on Dragonfly BSD when the hostname isn't set.
  • Fix typos for C99 macro name PRIX64.
  • Remove ancient and broken GCC for VMS support
  • Remove vestigial reference to /VAXC qualifier
  • Remove sharedperl option on VMS
  • VMS now has mkostemp
  • Configure now properly handles quoted elements outputted by gcc. GH #20606 โ€” https://github.com/Perl/perl5/issues/20606
  • Configure probed for the return type of malloc() and free() by testing whether declarations for those functions produced a function type mismatch with the implementation. On Solaris, with a C++ compiler, this check always failed, since Solaris instead imports malloc() and free() from std:: with using for C++ builds. Since the return types of malloc() and free() are well defined by the C standard, skip probing for them. Configure command-line arguments and hints can still override these type in the unlikely case that is needed. GH #20806 โ€” https://github.com/Perl/perl5/issues/20806

๐Ÿงช Testing ๐Ÿงช

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

  • Unicode normalization tests have been added.
  • t/test.pl: Add ability to cancel a watchdog timer

๐ŸŒ Platform Support ๐ŸŒ

๐Ÿ’€ Discontinued Platforms ๐Ÿ’€

Ultrix

Support code for DEC Ultrix has been removed ๐Ÿ’€. Ultrix was the native Unix-like operating system for various Digital Equipment Corporation machines. Its final release was in 1995. Rip bestie ๐Ÿซก.


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

DragonflyBSD

Skip tests to workaround an apparent bug in setproctitle(). GH #19894 โ€” https://github.com/Perl/perl5/issues/19894

FreeBSD

FreeBSD no longer uses thread-safe locale operations, to avoid a bug in FreeBSD โ€” https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265950

Replace the first part of archname with uname -p GH #19791 โ€” https://github.com/Perl/perl5/issues/19791

Solaris

Avoid some compiler and compilation issues on NetBSD/Solaris from regexec.c and regcomp.c.

Synology

Update Synology Readme for DSM 7.

Windows

Fix win32 memory alignment needed for gcc-12 from vmem.h.

utimes() on Win32 would print a message to stderr if it failed to convert a supplied time_t to a FILETIME. GH #19668 โ€” https://github.com/Perl/perl5/issues/19668

In some cases, timestamps returned by stat() and lstat() failed to take daylight saving time into account. GH #20018 โ€” https://github.com/Perl/perl5/issues/20018 โ€” GH #20061 โ€” https://github.com/Perl/perl5/issues/20061

stat() now works on AF_UNIX socket files. GH #20204 โ€” https://github.com/Perl/perl5/issues/20204

readlink() now returns the PrintName from a symbolic link reparse point instead of the SubstituteName, which should make it better match the name the link was created with. GH #20271 โ€” https://github.com/Perl/perl5/pull/20271

lstat() on Windows now returns the length of the link target as the size of the file, as it does on POSIX systems. GH #20476 โ€” https://github.com/Perl/perl5/issues/20476

symlink() on Windows now replaces any / in the target with \, since Windows does not recognise / in symbolic links. The reverse translation is not done by readlink(). GH #20506 โ€” https://github.com/Perl/perl5/issues/20506

symlink() where the target was an absolute path to a directory was incorrectly created as a file symbolic link. GH #20533 โ€” https://github.com/Perl/perl5/issues/20533

POSIX::dup2 no longer creates broken sockets. GH #20920 โ€” https://github.com/Perl/perl5/issues/20920

Closing a busy pipe could cause Perl to hang. GH #19963 โ€” https://github.com/Perl/perl5/issues/19963

๐Ÿ› ๏ธ Internal Changes ๐Ÿ› ๏ธ

okay bestie, this part is all the nerdy behind-the-scenes glow-up stuff ๐Ÿ’… like nobody's gonna see it from the outside but the whole vibe of the core got retouched. buckle up, it's a long list, let's go ๐Ÿซถ

  • so many deprecated C functions got deleted, periodt. they'd been deprecated for forever (like, embarrassingly long, ngl). full list is right here if you wanna scroll: https://github.com/perl/perl5/commit/7008caa915ad99e650acf2aea40612b5e48b7ba2
  • get_op_descs, get_op_names, get_opargs, get_no_modify and get_ppaddr have been marked deprecated. ๐Ÿ’€ it's giving "we still love you but from a distance"
  • hv_free_ent has been marked as internal API.
  • save_pushptr, save_pushptrptr, and save_pushi32ptr have been marked as internal API. (yes babe all three, don't try to use them, they're locked in their room ๐Ÿšช)
  • new bool-related functions and macros have been added to complement the new bool type that showed up back in 5.36 โœจ the functions are:
    • newSVbool(const bool bool_val)
    • newSV_true()
    • newSV_false()
    • sv_set_true(SV *sv)
    • sv_set_false(SV *sv)
    • sv_set_bool(SV *sv, const bool bool_val)

and the macros are:

  • SvIandPOK(sv)
  • SvIandPOK_off(sv)
  • SvIandPOK_on
  • Perl is no longer manipulating the environ array directly. the variable PL_use_safe_putenv has been removed and PERL_USE_SAFE_PUTENV is always defined. what does that mean for you, bestie? it means XS modules can now call setenv and putenv without causing segfaults ๐Ÿ˜ญ๐Ÿ™ iconic behaviour. [perl #19399 https://github.com/Perl/perl5/issues/19399]
  • internal C API functions are now hidden with __attribute__((hidden)) on the platforms that support it. the consequence is real: they are no longer callable from XS modules on those platforms. ๐Ÿ‘‘
ngl those functions have always been hidden on Windows. this change just brought that same energy to everywhere else. not a plot twist, just catching up. [perl #19655 https://github.com/Perl/perl5/pull/19655]
  • new formatting symbols were added for printing values declared as U32 or I32:
    • I32df โ€” like %d
    • U32of โ€” like %o
    • U32uf โ€” like %u
    • U32xf โ€” like %x
    • U32Xf โ€” like %X

you use these the same way as the already-existing similar symbols, like IVdf. see "I/O Formats" in perlapi if you need the receipts ๐Ÿงพ

  • new 'HvHasAUX' macro โœจ
  • regexec.c: add some branch predictions, reorder conds. lowkey just tidying the place up ๐Ÿงน
  • locale: change macro name to be C conformant.
  • rename the PADNAMEt_* constants to PADNAMEf_* ๐Ÿ”ค
  • changes all the API macros that retrieve a PV into a call to an inline function, so as to evaluate the parameter just once. efficiency era ๐Ÿ’…
  • regexec.c: multiple code refactors to make the code more readable. it's giving "we cleaned our room and now we can think" ๐Ÿ›๏ธโœจ
  • perl.h: change macro name to be C conformant (remove leading _ from NOT_IN_NUMERIC macros).
  • regcomp.h: add new BITMAP_BIT macro in addition to the existing BITMAP_BYTE and BITMAP_TEST ones. the trio is complete ๐Ÿ”ฅ
  • create new regnode type ANYOFH. populate_ANYOF_from_invlist was renamed to populate_bitmap_from_invlist.
  • regex: refactor bitmap vs non-bitmap of qr/[]/ ๐Ÿฆ‹
  • regcomp.c: add new functions to convert from an inversion list to a bitmap (and vice versa) โ€” populate_bitmap_from_invlist and populate_invlist_from_bitmap. both directions, we do not play favourites ๐Ÿ’–
  • add newAVav() to create an AV from an existing AV. add newAVhv() to create an AV using keys and values from an existing HV. two new besties on the block ๐Ÿซถ
  • fix definition of Perl_atof. โœ…
  • fix undefined behavior with overflow related OPTIMIZE_INFTY and delta in regcomp.c.
  • fix regnode pointer alignment issue in regcomp.h.
  • the CVf_METHOD CV flag and the associated CvMETHOD macro have been renamed to CVf_NOWARN_AMBIGUOUS and CvNOWARN_AMBIGUOUS. why? because the new name closer reflects its actual behaviour (it suppresses a warning that would otherwise be generated about ambiguous names), so it's way less confusing next to CvIsMETHOD, which actually indicates a CV is a "method" subroutine relating to the "class" feature. names matter babes ๐Ÿ’…
  • the OPf_SPECIAL flag is no longer set on the OP_ENTERSUB op constructed to call the VERSION, import and unimport methods as part of a use statement and attribute application, nor when assigning to an :lvalue subroutine.
  • a new CV flag CVf_REFCOUNTED_ANYSV has been added. it indicates the CV is an XSUB and stores an SV pointer in the CvXSUBANY.any_sv union field. Perl core operations like cloning or destroying the CV will maintain the reference count of the pointed-to SV, destroying it when required. responsible memory management is the moment ๐Ÿ‘‘
  • a new API function, "Perl_localeconv" in perlapi, is added. it's the same as POSIX::localeconv (returning a hash of the localeconv() fields), but directly callable from XS code. so convenient โœจ
  • a new API function, "Perl_langinfo8" in perlapi, is added. same as plain "Perl_langinfo" in perlapi, but with an extra parameter that lets the caller simply and reliably know if the returned string is UTF-8. ๐Ÿ’œ
  • we have introduced a limit on the number of nested eval EXPR/BEGIN blocks and require/BEGIN (and thus use statements as well) to prevent C stack overflows. this variable can also be used to forbid BEGIN blocks from executing during eval EXPR compilation. the limit defaults to 1000 but can be overridden by setting the ${^MAX_NESTED_EVAL_BEGIN_BLOCKS} variable. the default itself can be changed at compile time with:
-Accflags='-DPERL_MAX_NESTED_EVAL_BEGIN_BLOCKS_DEFAULT=12345'
โš ๏ธ heads up bestie: this value relates to the size of your C stack, and if you choose an inappropriately large value Perl may segfault. be conservative about what you choose. do not just crank it to a million for fun, i am begging ๐Ÿ™ˆ
  • a new magic type PERL_MAGIC_extvalue has been added. it's available for use like PERL_MAGIC_ext, but it's a value magic: upon localization the new value will not be magical. subtle but iconic โœจ
  • the SSNEW(), SSNEWt(), SSNEWa() and SSNEWat() APIs now return a SSize_t value. the SSPTR() and SSPTRt() macros now expect a SSize_t parameter, and enforce that on debugging builds. [GH #20411 https://github.com/Perl/perl5/issues/20411]
  • filenames in cops are now refcounted under threads. under threads we used to copy the filenames into each opcode (because in theory opcodes created in one thread can be destroyed in another, messy). the change adds a new struct/type RCPV, which is a refcounted string using shared memory. it's implemented in such a way that code that previously used a char * can continue to do so, because the refcounting data is located at a specific offset before the char * pointer itself. sneaky genius fr fr ๐Ÿง 
  • added HvNAMEf and HvNAMEf_QUOTEDPREFIX special formats. they take an HV * as an argument and use HvNAME() and related macros to determine the string, its length, and whether it is utf8. ๐ŸŒˆ
  • the underlying Perl_dowantarray function implementing the long-deprecated GIMME macro has been marked as deprecated, so that use of the macro emits a compile-time warning. GIMME has been documented as deprecated in favour of GIMME_V since Perl v5.6.0, but had not previously issued a warning. okay so it was always on thin ice, now the ice is actually cracking ๐Ÿ’€
  • the API function utf8_length in perlapi is now more efficient. go off king ๐Ÿ‘‘
  • added SAVERCPV() and SAVEFREERCPV() for better support for working with RCPV (reference counted string/pointer value) structures, which currently are used in opcodes to share filename and warning bit data in a memory efficient manner. memory efficient AND fancy, the duality ๐ŸŽ€
  • added MORTALSVFUNC_SV() and MORTALDESTRUCTOR_SV() macros, which make it possible to create a destructor that is fired at the end of the current statement. this uses the PERL_MAGIC_destruct magic to use free magic to trigger an action when a variable is freed. the action can be specified as a C function or as a Perl code reference. choose your fighter ๐Ÿ’…
  • added the %{^HOOK} api and related PERL_MAGIC_hook and PERL_MAGIC_hookelem for providing ways to hook selected perl functions which, for one reason or another, are problematic to wrap with a customized subroutine. sometimes you can't just put a lil jacket on it, you need a real hook ๐Ÿช
  • added support for ${^HOOK}{require__before} which can be used to rewrite the filename that require will try to load, and also to block require from loading a specific module โ€” even via fully qualified filename. the hook can also be used to perform "pre-require" and "post-require" actions. interfering lovingly ๐Ÿ’–
  • added support for ${^HOOK}{require__after} which can be used to track what modules have been required after the fact. detective energy ๐Ÿ•ต๏ธโ€โ™€๏ธ
  • regular expression opcodes (regops) now use a standardized structure layout that uses unions to expose data in different formats. this means it should be much easier to extend or modify regops to use more memory. and this has already been used to make a number of regops track how many parens they contain ๐Ÿ‘‘๐Ÿ’œ

๐Ÿ”ฅ Selected Bug Fixes ๐Ÿ”ฅ

okay bestie, grab a snack, this is the glowy-up list of everything we fixed ๐Ÿ’…

  • No more recursion and stack overflow when parsing a pack template, we said not today ๐Ÿ’€ [GH #16319 <https://github.com/Perl/perl5/issues/16319>]
  • An eval() sitting as the last statement inside a regex code block used to be able to trigger an interpreter panic, like this:
/(?{ ...; eval {....}; })/

[GH #19680 <https://github.com/Perl/perl5/issues/19680>]

  • Turning off the bareword_filehandles feature does not treat print Class->method as an error anymore. [GH #19704 <https://github.com/Perl/perl5/issues/19704>]
  • When a Perl sub tail-calls an XS sub with goto &xs_sub, that XS sub can now actually figure out its calling context ๐Ÿ’… before this it was always reported as scalar.

Also, when the Perl sub gets freed at the same moment, like:

sub foo { *foo = sub {}; goto &xs_sub }

this used to be able to crash if the XS sub tried to use PL_op, because that was being set to NULL. Fixed now, bestie. [GH #19936 <https://github.com/Perl/perl5/issues/19936>]

  • setsockopt() now uses the mechanism that got added back in 5.36 to be better at telling numeric values apart from string values passed as the OPTVAL parameter. [GH #18761 <https://github.com/Perl/perl5/issues/18761>]
  • The 4-argument select() now rejects strings with code points above 255. And for code points 128-255, the operator now always gives the OS the corresponding octet, no matter how Perl happens to store those code points in memory. (Before this, Perl was literally leaking its internal string storage to the OS, embarrassing ๐Ÿ™ˆ) [GH #19882 <https://github.com/Perl/perl5/issues/19882>]
  • Fixed the panic situation coming from val {} inside /(?{...})/. [GH #19390 <https://github.com/Perl/perl5/issues/19390>]
  • Fixed a whole pile of compiler warnings coming out of regexp.c and locale.c. [GH #19915 <https://github.com/Perl/perl5/issues/19915>]
  • Fixed a bug with querying locales on platforms that don't have LC_NUMERIC at all. [GH #19890 <https://github.com/Perl/perl5/issues/19890>]
  • Stopped undefined behaviour in S_maybe_multideref().
  • Avoided signed integer overflow in use integer ops.
  • Avoided adding an offset to a NULL pointer in hv_delete_common.
  • PerlIO::get_layers now accepts IO references too ๐ŸŽ€

Before this it would only take glob references or names of globs. Now it also takes IO references. Slay.

  • Fixes to memory handling for PL_splitstr:
    • If a thread was created, the allocated string would be freed twice. ๐Ÿ’€
    • If two -F switches were supplied, the memory allocated for the first switch wouldn't get freed.
  • Correctly handle OP_ANONCODE ops generated by CPAN modules that don't include the OPf_REF flag when propagating lvalue context. [GH #20532 <https://github.com/Perl/perl5/pull/20532>]
  • POSIX::strxfrm now uses the LC_CTYPE locale category to specify its collation, ignoring any differing LC_COLLATE. It genuinely does not make sense for a string to be encoded in one locale (say, ISO-8859-6, Arabic) and then collated based on another one (like ISO-8859-7, Greek). Perl assumes the current LC_CTYPE locale correctly represents the encoding, and collates accordingly. โœจ

Also, embedded NUL characters are now allowed in the input.

If locale collation isn't enabled on the platform (LC_COLLATE), the input gets returned unchanged.

  • Double FETCH during stringification of tied scalars returning an overloaded object has been fixed. The FETCH method should only be called once, but before this release it was actually called twice. ๐Ÿ˜ญ [GH #20574 <https://github.com/Perl/perl5/pull/20574>]
  • Writing to the magic variables tied to the selected output handle โ€” $^, $~, $=, $- and $% โ€” no longer crashes perl if the IO object has been cleared from the selected output handle. [GH #20733 <https://github.com/Perl/perl5/issues/20733>]
  • Redefining a use constant list constant with use constant now properly warns. This changes the behaviour of use constant, but it's a core change, not a change to constant.pm. [GH #20742 <https://github.com/Perl/perl5/issues/20742>]
  • Redefining a use constant list constant with an empty prototype constant sub used to result in an assertion failure. [GH #20742 <https://github.com/Perl/perl5/issues/20742>]
  • Fixed a regression where the INC method for objects in @INC would not be resolved by AUTOLOAD, while it was in 5.36. The INCDIR method for objects in @INC cannot be resolved by AUTOLOAD the way INC would have been resolved first. [GH #20665 <https://github.com/Perl/perl5/issues/20665>]
  • $SIG{__DIE__} will now be called from eval when the code dies during compilation, no matter how it dies. What this means is that code expecting to be able to upgrade $@ into an object will be called consistently. In earlier versions of perl, $SIG{__DIE__} would not be called for certain compilation errors โ€” undeclared variables, for example. For other errors it might get called if there were more than a certain number of errors, but not if there were fewer. Now you can expect it will be called in every case. ๐Ÿซถ
  • Compilation of code with errors used to stop inconsistently, depending on the count and type of errors it hit. The intent was that after 10 errors compilation would halt, but bugs in that logic meant certain types of error would get counted, but then would not trigger the threshold check that stops compilation. Other errors would. With this release, after at most 10 errors compilation will terminate, regardless of what type of error they were.

Heads up though: you can change that maximum count by defining PERL_STOP_PARSING_AFTER_N_ERRORS to be something else during the configuration process. For example:

./Configure ... -Accflags='-DPERL_STOP_PARSING_AFTER_N_ERRORS=100'

would allow up to 100 errors. ๐Ÿ’…

  • The API function my_snprintf in perlapi now prints a non-dot decimal point if the perl code it ultimately gets called from is in the scope of use locale and the locale in effect calls for that.
  • A bunch of bugs related to capture groups inside quantified groups in regular expressions have been fixed, especially in alternations. For example, in a pattern like:
"foobazfoobar" =~ /((foo)baz|foo(bar))+/

the regex variable $2 will not be "foo" like it once was โ€” it will be undef.

  • Bugs with regex backreference operators that sit inside a capture group have been fixed. For instance:
"xa=xaaa" =~ /^(xa|=?\1a){2}\z/

will now correctly not match. [GH #10073 <https://github.com/Perl/perl5/issues/10073>]

  • SSGROW() and SSCHECK() have been reworked to make sure the requested space is actually allocated. SSCHECK() is now an alias for SSGROW().

๐Ÿซถ Acknowledgements ๐Ÿซถ

Perl 5.38.0 represents approximately 12 months of development since Perl 5.36.0, and contains approximately 290,000 lines of changes across 1,500 files from 100 authors. no cap, that's a lot ๐ŸŽ€

If we're excluding auto-generated files, documentation and release tools, there were approximately 190,000 lines of changes to 970 .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.38.0:

Alex, Alexander Nikolov, Alex Davies, Andreas Kรถnig, Andrew Fresh, Andrew Ruthven, Andy Lester, Aristotle Pagaltzis, Arne Johannessen, A. Sinan Unur, Bartosz Jarzyna, Bart Van Assche, Benjamin Smith, Bram, Branislav Zahradnรญk, Brian Greenfield, Bruce Gray, Chad Granum, Chris 'BinGOs' Williams, chromatic, Clemens Wasser, Craig A. Berry, Dagfinn Ilmari Mannsรฅker, Dan Book, danielnachun, Dan Jacobson, Dan Kogai, David Cantrell, David Golden, David Mitchell, E. Choroba, Ed J, Ed Sabol, Elvin Aslanov, Eric Herman, Felipe Gasper, Ferenc Erki, Firas Khalil Khana, Florian Weimer, Graham Knop, Hรฅkon Hรฆgland, Harald Jรถrg, H.Merijn Brand, Hugo van der Sanden, James E Keenan, James Raspass, jkahrman, Joe McMahon, Johan Vromans, Jonathan Stowe, Jon Gentle, Karen Etheridge, Karl Williamson, Kenichi Ishigaki, Kenneth ร–lwing, Kurt Fitzner, Leon Timmermans, Li Linjie, Loren Merritt, Lukas Mai, Marcel Telka, Mark Jason Dominus, Mark Shelor, Matthew Horsfall, Matthew O. Persico, Mattia Barbon, Max Maischein, Mohammad S Anwar, Nathan Mills, Neil Bowers, Nicholas Clark, Nicolas Mendoza, Nicolas R, Paul Evans, Paul Marquess, Peter John Acklam, Peter Levine, Philippe Bruhat (BooK), Reini Urban, Renee Baecker, Ricardo Signes, Richard Leach, Russ Allbery, Scott Baker, Sevan Janiyan, Sidney Markowitz, Sisyphus, Steve Hay, TAKAI Kousuke, Todd Rinaldo, Tomasz Konojacki, Tom Stellard, Tony Cook, Tsuyoshi Watanabe, Unicode Consortium, vsfos, Yves Orton, Zakariyya Mughal, Zefram, ๅฐ้ธก.

The list above is almost certainly incomplete, since it's 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 ones ๐Ÿ’–

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.

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 something you think is a bug, you might want to check the perl bug database at <https://github.com/Perl/perl5/issues> first. There may also be info over 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, that's the move.

If the bug you're reporting has security implications that make it inappropriate to send to a public issue tracker, then check out "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec for the details on how to report it. ๐Ÿ”’


๐Ÿ™ Give Thanks ๐Ÿ™

If you want to thank the Perl 5 Porters for the work we've done in Perl 5, you can do that 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 ๐Ÿฅน


๐Ÿ‘€ 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 the whole page, bestie!! ๐Ÿฆ‹ this was PERL5380DELTA(1perl), covering perl v5.44.0 and dated 2026-10-17 โ€” go forth and upgrade, ily, periodt ๐Ÿ’…โœจ

๐Ÿ“ฆ 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