PERL5380DELTA(1)

PERL5380DELTA(1) β€” Perl Programmers Reference Guide


πŸ’– NAME πŸ’–

perl5380delta β€” what is new for perl v5.38.0

🌸 DESCRIPTION 🌸

okay bestie, this whole doc is the tea on what changed between the 5.36.0 release and the 5.38.0 release. no cap.


✨ Core Enhancements ✨

πŸŽ€ New "class" Feature πŸŽ€

So there's a brand-new experimental syntax for defining object classes, and the per-instance data gets stored in field variables that behave like lexicals. it's giving object-oriented main character energy, fr fr.

use feature 'class';

class Point
{
    field $x;
    field $y;

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

The full deets live in perlclass. And if you're nosy about the internals of how it's implemented plus other related details, perlclassguts has you covered.

This is still a new and experimental feature, and it is very much still under development. It's gonna get a ton of further addition, refinement and alteration in future releases. Because it's experimental, it throws warnings in the "experimental::class" category. You can silence those with a no warnings statement. slay.

use feature 'class';
no warnings 'experimental::class';

🌈 Unicode 15.0 is supported 🌈

Unicode 15.0 is supported, bestie. See <https://www.unicode.org/versions/Unicode15.0.0/> for details.

πŸ’… Deprecation warnings now have specific subcategories πŸ’…

Every deprecation warning now has its own specific deprecation category, so you can disable them individually. The full list of deprecated features lives in perldeprecation, and also in warnings. This next list is from 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 as has historically been the case, these warnings are automatically enabled with

use warnings;

πŸ¦‹ %{^HOOK} API introduced πŸ¦‹

ngl, for various reasons it can be super difficult to create subroutine wrappers for some of perl's keywords. Any keyword that has an undefined prototype simply cannot be wrapped with a subroutine, and some keywords that perl does permit to be wrapped are in practice very tricky to wrap. Take require β€” it's tricky to wrap. It is possible, but doing so changes the stack depth, and the standard methods of exporting assume that they will be exporting to a package at a certain stack depth up the stack. So the wrapper will change where functions are exported to unless it's implemented with a great deal of care. That can be very awkward to deal with.

So accordingly, we introduced a new hash called %{^HOOK} to facilitate these cases. When a keyword supports any kind of special hook, that hook lives in this new hash. Hooks in this hash are named after the function they are called by, followed by two underbars and then the phase they are executed in β€” currently 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 tasks before and after a require statement.

See perlvar for more details.

πŸ“ PERL_RAND_SEED πŸ“

A new environment variable PERL_RAND_SEED has been added. It can be used to cause a perl program that uses rand without using srand() explicitly, or that uses srand() with no arguments, to be repeatable. See perlrun. You can disable this feature at compile time by passing

-Accflags=-DNO_PERL_RAND_SEED

to Configure during the build process.

πŸ’œ Defined-or and logical-or assignment default expressions in signatures πŸ’œ

The default expression for a subroutine signature parameter can now be assigned using the //= or ||= operators. That applies the defaults whenever the caller provided an undefined or false value (respectively), instead of simply when the parameter is missing entirely. For more detail, see the documentation 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 ensure that any given hook is executed at most once during a require call, and that any duplicate directories do not trigger additional directory probes.

To give developers more control over dynamic module lookup, a new hook method INCDIR is now supported. An object that supports this method can be injected into the @INC array, and when it's encountered in the module search process it will be executed, just like how INC hooks are executed. Its return value is used as a list of directories to search for the module. Returning an empty list acts as a no-op. Note that 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.

When an @INC hook (either INC or INCDIR) is called during require, the $INC variable will be 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 do not support the INC or INCDIR methods will no longer trigger an exception. Instead, they'll be treated the same as unblessed coderefs are, and executed as though they were an INC hook.

πŸ’€ 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 such as return or goto. Previous versions of perl could only detect this when it was actually attempted at runtime.

This version of perl adds compile-time detection for many cases that can be statically determined. That may mean code that compiled successfully on a previous version of perl is now reported as a compile-time error with this one. This only happens in cases where it would have been an error to actually execute the code anyway β€” the error just happens at an earlier time.

πŸ”₯ Optimistic Eval in Patterns πŸ”₯

Using (?{ ... }) and (??{ ... }) in a pattern disables various optimisations globally in that pattern. That may or may not be what the programmer wants. This release adds the (*{ ... }) equivalent. The only difference is that it does not and will never disable any optimisations in the regex engine. This may make it more unstable in the sense that it may be called more or less times in the future, but 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 will stay O(N).

πŸ‘‘ 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 they're now limited to I32_MAX. That means you can now write /(?:word){1000000}/, for example. Note that doing so may cause the regex engine to run longer and use more memory.

⭐ New API functions optimize_optree and finalize_optree ⭐

There are two new API functions for operating on optree fragments, making sure you can 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 they could be altered or removed at any time if other internal changes make that necessary.

🌸 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 also 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. 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 lets you access 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. The following code

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

can be rewritten as follows

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

and it will do the exactly same thing.

🫢 Locale category LC_NAME now supported on participating platforms 🫢

On platforms that have the GNU extension LC_NAME category, you can now use it as the category parameter to setlocale in POSIX to set and query its locale.

πŸ’” Incompatible Changes πŸ’”

okay bestie, this is the section where perl said "we're switching it up and ur code might need a lil adjustment" πŸ’… no cap, these are the changes that can break stuff.

readline() no longer clears the stream error and eof flags

readline(), also spelled "<>", would clear the handle's error and eof flags after an error occurred on the stream. 🫢

In nearly all cases this clear is no longer done, so the error and eof flags now properly reflect the status of the stream after readline(). it's giving accuracy, honestly.

Since the error flag is no longer cleared calling close() on the stream may fail and if the stream was not explicitly closed, the implicit close of the stream may produce a warning. so like... heads up bestie. πŸ™ˆ

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.
  • 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 get 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". 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. 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.

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 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.


🚫 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.

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.

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.

These features will be entirely removed from perl in v5.42.0.


⚑ Performance Enhancements ⚑

Modules and Pragmata 🧩

okay bestie, let's talk about all the modules and pragmata that got a glow-up in this release. so many upgrades, so little time. πŸ’…

Updated Modules and Pragmata ✨

  • ✨ New builtin alert! is_tainted() has entered the chat. [GH #19854 <https://github.com/Perl/perl5/issues/19854>]
  • And export_lexically() is here too, straight outta PPC 0020 <https://github.com/Perl/PPCs/blob/main/ppcs/ppc0020-lexical-export.md>. [GH #19895 <https://github.com/Perl/perl5/issues/19895>]
  • PPC 0018 <https://github.com/Perl/PPCs/blob/main/ppcs/ppc0018-module-true.md> got the green light, so use feature "module_true"; is now in the default feature bundle for v5.38 and later. You can still turn it on explicitly if you want. When enabled inside a module, the module doesn't need to return true explicitly β€” in fact, the return will be forced to a simple true value regardless of what it originally was. Slay. πŸ’…
  • Attribute::Handlers β€” from 1.02 to 1.03 πŸŽ€
  • attributes β€” from 0.34 to 0.35 πŸ¦‹
  • autodie β€” from 2.34 to 2.36 πŸ”₯
  • B β€” from 1.83 to 1.88 πŸ’€
  • B::Concise β€” from 1.006 to 1.007 ✨
  • B::Deparse β€” from 1.64 to 1.74 🧠
  • Benchmark β€” from 1.23 to 1.24 ⏱️
  • bignum β€” from 0.65 to 0.66 πŸ”’
  • Carp β€” from 1.52 to 1.54 🐟
  • Class::Struct β€” from 0.66 to 0.68 πŸ—οΈ
  • Compress::Raw::Bzip2 β€” from 2.103 to 2.204_001 πŸ—œοΈ
  • Compress::Raw::Zlib β€” from 2.105 to 2.204_001 πŸ—œοΈ
  • Config::Perl::V β€” from 0.33 to 0.36 βš™οΈ
  • CPAN β€” from 2.33 to 2.36 πŸ“¦
  • Data::Dumper β€” from 2.184 to 2.188 πŸ—‘οΈ
  • DB_File β€” from 1.857 to 1.858 πŸ—„οΈ
  • Devel::Peek β€” from 1.32 to 1.33 πŸ‘€
  • Devel::PPPort β€” from 3.68 to 3.71 🚒
  • Digest::MD5 β€” from 2.58 to 2.58_01 πŸ”
  • Digest::SHA β€” from 6.02 to 6.04 πŸ”
  • DynaLoader β€” from 1.52 to 1.54 πŸš€
  • Encode β€” from 3.17 to 3.19 πŸ”€
  • encoding::warnings β€” from 0.13 to 0.14 ⚠️
  • Env β€” from 1.05 to 1.06 🌍
  • Errno β€” from 1.36 to 1.37 🚫
  • experimental β€” from 0.028 to 0.031 πŸ§ͺ
  • ExtUtils::CBuilder β€” from 0.280236 to 0.280238 πŸ› οΈ
  • ExtUtils::Install β€” from 2.20 to 2.22 πŸ“₯
  • ExtUtils::MakeMaker β€” from 7.64 to 7.70 🏭
  • ExtUtils::Miniperl β€” from 1.11 to 1.13 🐣
  • ExtUtils::ParseXS β€” from 3.45 to 3.51 πŸ”§
  • ExtUtils::PL2Bat β€” from 0.004 to 0.005 πŸ¦‡
  • ExtUtils::Typemaps β€” from 3.45 to 3.51 πŸ—ΊοΈ
  • feature β€” from 1.72 to 1.82 🌟
  • File::Basename β€” from 2.85 to 2.86 πŸ“
  • File::Copy β€” from 2.39 to 2.41 πŸ“‹
  • File::Find β€” from 1.40 to 1.43 πŸ”
  • File::Glob β€” from 1.37 to 1.40 🌐
  • File::Spec β€” from 3.84 to 3.89 πŸ“‚
  • File::stat β€” from 1.12 to 1.13 πŸ“Š
  • FileHandle β€” from 2.03 to 2.05 πŸ—‚οΈ
  • Filter::Util::Call β€” from 1.60 to 1.64 🧹
  • GDBM_File β€” from 1.23 to 1.24 πŸ—ƒοΈ
  • Getopt::Long β€” from 2.52 to 2.54 πŸŽ›οΈ
  • Hash::Util β€” from 0.28 to 0.30 #️⃣
  • HTTP::Tiny β€” from 0.080 to 0.083 🌐
  • I18N::Langinfo β€” from 0.21 to 0.22 🌍
  • IO β€” from 1.50 to 1.52 πŸ“₯
  • IO-Compress β€” from 2.106 to 2.204 πŸ—œοΈ
  • IO::Socket::IP β€” from 0.41 to 0.41_01 πŸ”Œ
  • IO::Zlib β€” from 1.11 to 1.14 πŸ—œοΈ
  • JSON::PP β€” from 4.07 to 4.16 πŸ“„
  • libnet β€” from 3.14 to 3.15 🌐
  • Locale::Maketext β€” from 1.31 to 1.33 🌍
  • Math::BigInt β€” from 1.999830 to 1.999837 πŸ”’
  • Math::BigInt::FastCalc β€” from 0.5012 to 0.5013 ⚑
  • Math::BigRat β€” from 0.2621 to 0.2624 πŸ€
  • Math::Complex β€” from 1.5902 to 1.62 πŸŒ€
  • Memoize β€” from 1.03_01 to 1.16 🧠
  • MIME::Base64 β€” from 3.16 to 3.16_01 πŸ“§
  • Module::CoreList β€” from 5.20220520 to 5.20230520 πŸ“…
  • mro β€” from 1.26 to 1.28 🧬
  • NDBM_File β€” from 1.15 to 1.16 πŸ—„οΈ
  • Net::Ping β€” from 2.74 to 2.76 πŸ“‘
  • ODBM_File β€” from 1.17 to 1.18 πŸ—„οΈ
  • Opcode β€” from 1.57 to 1.64 πŸŽ›οΈ
  • overload β€” from 1.35 to 1.37 πŸ‹οΈ
  • parent β€” from 0.238 to 0.241 πŸ‘ͺ
  • PerlIO::via::QuotedPrint β€” from 0.09 to 0.10 πŸ–¨οΈ
  • Pod::Checker β€” from 1.74 to 1.75 πŸ“
  • Pod::Html β€” from 1.33 to 1.34 🌐
  • Pod::Usage β€” from 2.01 to 2.03 πŸ“–
  • podlators β€” from 4.14 to 5.01 πŸ“š
  • POSIX β€” from 2.03 to 2.13 🐧
  • re β€” from 0.43 to 0.44 πŸ”
  • Safe β€” from 2.43 to 2.44 πŸ”’
  • Scalar::Util β€” from 1.62 to 1.63 πŸ”§
  • SDBM_File β€” from 1.15 to 1.17 πŸ—„οΈ
  • Socket β€” from 2.033 to 2.036 πŸ”Œ
  • Storable β€” from 3.26 to 3.32 πŸ’Ύ
  • Sys::Hostname β€” from 1.24 to 1.25 πŸ–₯️
  • Term::Cap β€” from 1.17 to 1.18 πŸ–₯️
  • Test::Simple β€” from 1.302190 to 1.302194 πŸ§ͺ
  • Text::Balanced β€” from 2.04 to 2.06 βš–οΈ
  • threads β€” from 2.27 to 2.36 🧡
  • threads::shared β€” from 1.64 to 1.68 🧡
  • Tie::File β€” from 1.06 to 1.07 πŸ”—
  • Time::HiRes β€” from 1.9770 to 1.9775 ⏱️
  • Time::Piece β€” from 1.3401 to 1.3401_01 ⏰
  • Unicode::Normalize β€” from 1.31 to 1.32 🌐
  • UNIVERSAL β€” from 1.14 to 1.15 🌌
  • User::grent β€” from 1.03 to 1.04 πŸ‘₯
  • User::pwent β€” from 1.01 to 1.02 πŸ‘€
  • utf8 β€” from 1.24 to 1.25 🌈
  • warnings β€” from 1.58 to 1.65 ⚠️
  • XS::APItest β€” from 1.22 to 1.32 πŸ§ͺ
  • XSLoader β€” from 0.31 to 0.32 πŸš€

Documentation πŸ“š

New Documentation ✨

  • perlclass β€” describes the new "class" feature. πŸ‘‘
  • perlclassguts β€” describes the internals of the new "class" feature. 🧠

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>.

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. ✨
  • 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. πŸ—‘οΈ
  • 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. 😒

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 is the part where perl talks back. These are all the additions and changes to diagnostic output β€” that means warnings AND fatal error messages. For the complete list of every diagnostic message ever, go peek at 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) bestie you're trying to call bless with a package name that's a new-style class. Literally no need β€” instances made by the constructor are already in the correct class. And you can't make instances any other way, like with bless. Periodt.

  • Cannot assign :param(%s) to field %s because that name is already in use

(F) You tried to slap a parameter name onto a field, but that name is already taken by another field in the same class, or one of its parent classes. That would be a name clash, so nope, not allowed. πŸ™…

  • Cannot create class %s as it already has a non-empty @ISA

(F) You tried to make a class out of a package that already has an @ISA array, and that array isn't empty. Not permitted, because you'd end up with a class with inconsistent inheritance. It's giving messy. 😭

  • 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's an instance of a different class. Not permitted, because the method wouldn't 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 isn't an instance of that class. Not permitted, because the method wouldn't have access to its instance fields.

  • Cannot '%s' outside of a 'class'

(F) You used one of the keywords that only makes sense inside a class definition β€” but you were somewhere that is not inside such a class. πŸ™ˆ

  • Cannot reopen existing class "%s"

(F) You tried to start a class definition for a class that already exists. A class only gets one definition block. That's the rule, iykyk.

  • Can't bless an object reference

(F) You tried to call bless on a value that already refers to a real object instance. She's already blessed, leave her alone. ✨

  • 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 tried to specify a second superclass for a class using the :isa attribute when one was already specified. Unlike classes whose instances get created with bless, classes made with the class keyword can't have more than one superclass.

  • Class attribute %s requires a value

(F) You specified an attribute for a class that needs a value passed in parentheses, but you didn't give one. Remember bestie: whitespace is not permitted between the attribute name and its value. You must write it like this:

class Example::Class :attr(VALUE) ...
  • Class :isa attribute requires a class but "%s" is not one

(F) When you're making a subclass with the class :isa attribute, the named superclass also has to be a real class created using the class keyword.

  • Field already has a parameter name, cannot add another

(F) A field can have at most one application of the :param attribute to assign it a parameter name. Once it's applied, a second one is not allowed.

  • Field attribute %s requires a value

(F) You specified an attribute for a field that needs a value in parentheses, but you didn't provide one. Again: no whitespace between the attribute name and its value. Write it like this:

field $var :attr(VALUE) ...
  • Field %s is not accessible outside a method

(F) You tried to access a field variable of a class from code that isn't inside the body of a method subroutine. Not permitted β€” only methods get access to the fields of an instance. πŸ’…

  • Field %s of "%s" is not accessible in a method of "%s"

(F) You tried to access a field variable of a class from a method of another class that's nested inside the one that actually defined it. Not permitted β€” only methods defined by a given class may access that class's fields.

  • Only scalar fields can take a :param attribute

(F) You tried to apply the :param attribute to an array or hash field. Currently that's 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 you didn't 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. That confused the parser, bestie.

  • Unrecognized class attribute %s

(F) You tried to add a named attribute to a class definition, but perl doesn't recognize the name of the attribute you asked for.

  • Unrecognized field attribute %s

(F) You tried to add a named attribute to a field definition, but perl doesn't recognize the name of the attribute you asked for.

  • ${^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 when there's no new locale being switched to. The previous diagnostic was misleading in those 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 shows up 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 shows up 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 gave an odd number of elements to initialize a hash field of an object. Hashes get initialized from a list of key/value pairs, so every key needs a matching value. The final missing value gets 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 shows up 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 shows up 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 attempt to "skip past" the error and keep parsing so it could list multiple errors. For things like undeclared variables under strict this makes sense. For syntax errors, though, it's been found that continuing tends to result in a whole 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. πŸ’€

So we've reformed the continuation logic: the parse stops after the first syntax error it sees. Semantic errors like undeclared variables won't stop the parse, so you may still see multiple errors when compiling code. But if there's a syntax error, it will be the last error message reported by perl, and all the errors you see will be something that actually needs to be fixed. Slay.

  • Error messages that output class or package names have been modified to output double quoted strings with various characters escaped, so the exact value is clear to a reader. The exact rules on which characters get escaped may change over time, but currently they are: 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, because they can cause trouble on Unicode terminals when output raw.

In older versions of perl, this 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 that the newline in the package name got quoted and escaped, so the error message is one single line. It's shown wrapped to two lines here just so you can actually read it, bestie. πŸ’–
  • When package or class names in errors are huge, the excess middle gets elided. 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 in error messages. Like, for example:
$ perl -le'("Foo" x 1000)->new()'

will output the following as one line:

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

See that "prefix"..."suffix" form of the package name? That's the glow-up. ✨ In previous versions of perl the complete string would've been shown, making the error message over 6k long β€” and there was 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. 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"

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 that is 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 as this will ensure 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. πŸͺ¦

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

✨ Internal Changes ✨

Bestie, this is the deep-magic section. C-level glow-ups, deprecated stuff getting yeeted, and a whole bunch of new macros. Buckle up πŸŽ€

  • Removed a whole bunch of deprecated C functions. They've been deprecated for so long, like they were basically ghosts at this point. Want the full list? It's all here: <https://github.com/perl/perl5/commit/7008caa915ad99e650acf2aea40612b5e48b7ba2>
  • get_op_descs, get_op_names, get_opargs, get_no_modify and get_ppaddr have all been marked deprecated. Not me watching them get the label 😭
  • hv_free_ent has been marked as internal API.
  • save_pushptr, save_pushptrptr, and save_pushi32ptr have also been marked as internal API. They're for the inside kids only now πŸ’…
  • New bool-related functions and macros got added to complement the new bool type that showed up in 5.36. Slay ✨

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)"

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 now. What does that mean for you? XS modules can finally call setenv and putenv without causing segfaults. No more πŸ’€. [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. Translation: on those platforms, XS modules can't call them anymore, periodt.

Important note tho: those functions have always been hidden on Windows. This change just brings that same energy to the other platforms. [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 them exactly the same way as the similar symbols that already exist, like IVdf. See "I/O Formats" in perlapi for the deets πŸ“–

  • new 'HvHasAUX' macro πŸ‘‘
  • regexec.c: Add some branch predictions reorder conds
  • 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, she's serving 🫢
  • regexec.c: multiple code refactor to make the code more readable
  • 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.
  • 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. They go both ways, we love a versatile icon 🌈
  • Add newAVav() to create an AV from an existing AV. Add newAVhv() to create an AV using keys and values from an existing HV.
  • Fix definition of Perl_atof.
  • Fix undefined behavior with overflow related OPTIMIZE_INFTY and delta in regcomp.c. Undefined behavior is not cute, glad it's fixed πŸ™ˆ
  • Fix regnode pointer alignment issue in regcomp.h.
  • The CVf_METHOD CV flag and its associated CvMETHOD macro have been renamed to CVf_NOWARN_AMBIGUOUS and CvNOWARN_AMBIGUOUS. Why? Because the new names closer reflect what it actually does β€” it suppresses a warning that would otherwise get generated about ambiguous names β€” so it's way less confusing next to CvIsMETHOD, which actually indicates that a CV is a "method" subroutine relating to the "class" feature. Name accuracy is self-care πŸ’…
  • 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 that the CV is an XSUB and stores an SV pointer in the CvXSUBANY.any_sv union field. Perl core operations such as cloning or destroying the CV will maintain the reference count of the pointed-to SV, destroying it when required. Keeping the refcounts in check, as one does πŸ’–
  • A new API function, "Perl_localeconv" in perlapi, is added. This is the same as POSIX::localeconv (returning a hash of the localeconv() fields), but directly callable from XS code. Convenience? Iconic.
  • A new API function, "Perl_langinfo8" in perlapi, is added. This is the same as plain "Perl_langinfo" in perlapi, but with an extra parameter that allows the caller to simply and reliably know if the returned string is UTF-8. Knowing your encoding >>> guessing πŸ¦‹
  • 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 pick a giant number for the plot.
  • A new magic type PERL_MAGIC_extvalue has been added. This is available for use like PERL_MAGIC_ext, but it's a value magic: upon localization the new value will not be magical. Subtle but important, iykyk ✨
  • 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 they 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 were copying the filenames into each opcode, because in theory opcodes created in one thread can be destroyed in another. The change adds a new struct/type RCPV, which is a refcounted string using shared memory. This is implemented in such a way that code that previously used a char * can continue to do so, as the refcounting data is located a specific offset before the char * pointer itself. Clever girl behavior πŸ”₯
  • 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. It's finally getting the warning it was owed since forever 😭
  • The API function utf8_length in perlapi is now more efficient. Faster, bestie πŸ’¨
  • 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.
  • Added MORTALSVFUNC_SV() and MORTALDESTRUCTOR_SV() macros, which make it possible to create a destructor which 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.
  • 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. Gatekeeping require? We love to see it πŸ‘‘
  • Added support for ${^HOOK}{require__after} which can be used to track what modules have been required after the fact. Receipts, but for modules 🧾
  • Regular expression opcodes (regops) now use a standardized structure layout that uses unions to expose data in different format. This means it should be much easier to extend or modify regops to use more memory. This has been used to make a number of regops track how many parens they contain. Organized, flexible, thriving 🌸

Selected Bug Fixes πŸ›πŸ’…

okay bestie, this is the bug-fix section and it is stacked. every single one of these is fixed now, periodt. πŸ’–

  • Avoid recursion and stack overflow parsing 'pack' template. GH #16319 β€” <https://github.com/Perl/perl5/issues/16319> ✨
  • An eval() as the last statement in a regex code block could trigger an interpreter panic; e.g.
/(?{ ...; eval {....}; })/

GH #19680 β€” <https://github.com/Perl/perl5/issues/19680> 😭

  • Disabling the bareword_filehandles feature no longer treats print Class->method as an error. GH #19704 β€” <https://github.com/Perl/perl5/issues/19704> πŸ’–
  • When a Perl subroutine tail-calls an XS subroutine using goto &xs_sub, the XS subroutine can now correctly determine its calling context. Previously it was always reported as scalar.

In addition, where the Perl subroutine is freed at the same time:

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

this formerly could lead to crashes if the XS subroutine tried to use the value of PL_op, since this was being set to NULL. This is now fixed. GH #19936 β€” <https://github.com/Perl/perl5/issues/19936> πŸ”₯

  • setsockopt() now uses the mechanism added in 5.36 to better distinguish between numeric and string values supplied as the OPTVAL parameter. GH #18761 β€” <https://github.com/Perl/perl5/issues/18761> 🫢
  • 4-argument select() now rejects strings with code points above 255. Additionally, for code points 128-255, this operator will now always give the corresponding octet to the OS, regardless of how Perl stores such code points in memory. (Previously Perl leaked its internal string storage to the OS.) GH #19882 β€” <https://github.com/Perl/perl5/issues/19882> πŸ’…
  • Fix panic issue from val {} inside /(?{...})/. GH #19390 β€” <https://github.com/Perl/perl5/issues/19390> 😭
  • Fix multiple compiler warnings from regexp.c, locale.c. GH #19915 β€” <https://github.com/Perl/perl5/issues/19915> ✨
  • Fix a bug with querying locales on platforms that don't have LC_NUMERIC. GH #19890 β€” <https://github.com/Perl/perl5/issues/19890> 🌍
  • Prevent undefined behaviour in S_maybe_multideref(). πŸ’€
  • Avoid signed integer overflow in use integer ops. πŸ”₯
  • Avoid adding an offset to a NULL pointer in hv_delete_common. πŸ’€
  • PerlIO::get_layers will now accept IO references too. Previously it would only take glob references or names of globs. Now it will also accept IO references. πŸ¦‹
  • 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 be 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 doesn't make sense for a string to be encoded in one locale (say, ISO-8859-6, Arabic) and to collate it based on another (like ISO-8859-7, Greek). Perl assumes that 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 is not enabled on the platform (LC_COLLATE), the input is returned unchanged. 🌈

  • Double FETCH during stringification of tied scalars returning an overloaded object have been fixed. The FETCH method should only be called once, but prior to this release was actually called twice. GH #20574 β€” <https://github.com/Perl/perl5/pull/20574> πŸ™ˆ
  • Writing to a magic variables associated with 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 is 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 would 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 as 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 regardless of how it dies. This means 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, for instance undeclared variables. For other errors it might be called if there were more than a certain number of errors, but not if there were less. Now you can expect that it will be called in every case. πŸ’–
  • Compilation of code with errors used to inconsistently stop depending on the count and type of errors encountered. The intent was that after 10 errors compilation would halt, but bugs in this logic meant that certain types of error would be counted, but would not trigger the threshold check to stop compilation. Other errors would. With this release after at most 10 errors compilation will terminate, regardless of what type of error they were.

Note that you can change the maximum count by defining PERL_STOP_PARSING_AFTER_N_ERRORS to be something else during the configuration process. For instance

./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 is called from is in the scope of use locale and the locale in effect calls for that. ✨
  • A number of bugs related to capture groups in quantified groups in regular expression 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" as it once was, it will be undef. πŸ’…

  • Bugs with regex backreference operators that are inside of 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 ensure that 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 whole lot of glow-up energy. πŸ’–

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 as it is automatically generated from version control history. In particular, it does not include the names of the (very much appreciated) contributors who reported issues to the Perl bug tracker. 🫢

Many of the changes included in this version originated in the CPAN modules included in Perl's core. We're grateful to the entire CPAN community for helping Perl to flourish.

For a more complete list of all of Perl's historical contributors, please see the AUTHORS file in the Perl source distribution.


Reporting Bugs πŸžπŸ’–

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 <http://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. bestie, tiny repro is the love language of maintainers. πŸŽ€

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. πŸ”


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. πŸ’Œ


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 perl v5.42.3, dated 2026-08-03, tagged PERL5380DELTA(1) β€” go forth and slay your upgrades. πŸŽ€βœ¨

πŸ“¦ where this page comes from