PERL5140DELTA(1perl)

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

๐Ÿ’– perl5140delta ๐Ÿ’–

what is new for perl v5.14.0

okay bestie, gather round, because this is the Perl 5.14.0 glow-up and it is a lot ๐Ÿ’…


๐ŸŒธ DESCRIPTION ๐ŸŒธ

So this doc is literally just the tea on what changed between the 5.12.0 release and the 5.14.0 release. periodt.

If you're coming from something even older, like 5.10.0? bestie you need to read perl5120delta first, because that one covers the 5.10.0 โ†’ 5.12.0 jump. no skipping chapters ๐Ÿ™ˆ

Also real quick โ€” some of the bug fixes in this release got backported into later 5.12.x releases. Those ones are marked with the 5.12.x version in parentheses, iykyk.


๐Ÿ‘‘ Notice ๐Ÿ‘‘

As described in perlpolicy, the release of Perl 5.14.0 marks the official end of support for Perl 5.10. ๐Ÿ˜ญ

So if you or your codebase is still on Perl 5.10 or earlier... bestie it is time. Consider upgrading to a more recent release of Perl. fr fr.

โœจ Core Enhancements โœจ

๐Ÿฆ‹ Unicode ๐Ÿฆ‹

Unicode Version 6.0 is now supported (mostly)

Perl now comes with the Unicode 6.0 data base, updated with Corrigendum #8 <http://www.unicode.org/versions/corrigendum8.html>, with one exception noted below. ๐Ÿ‘€

For all the deets on the new release, see <http://unicode.org/versions/Unicode6.0.0/>.

Perl does not support any Unicode provisional properties, including the new ones for this release. nope, not those. ๐Ÿ™…โ€โ™€๏ธ

Okay so here's the drama: Unicode 6.0 chose to use the name "BELL" for the character at U+1F514, which is a symbol that looks like a bell and is used in Japanese cell phones. ๐Ÿ””

But that conflicts with the long-standing Perl usage where "BELL" means the ASCII "BEL" character, U+0007. messy.

In Perl 5.14:

  • "\N{BELL}" continues to mean U+0007, but its use generates a deprecation warning message unless such warnings are turned off.
  • The new name for U+0007 in Perl is "ALERT", which corresponds nicely with the existing shorthand sequence for it, "\a". cute โœจ
  • "\N{BEL}" means U+0007, with no warning given.
  • The character at U+1F514 has no name in 5.14, but can be referred to by "\N{U+1F514}".
โš ๏ธ In Perl 5.16, "\N{BELL}" will refer to U+1F514; all code that uses "\N{BELL}" should be converted to use "\N{ALERT}", "\N{BEL}", or "\a" before upgrading.

Full functionality for use feature 'unicode_strings'

This release provides full functionality for use feature 'unicode_strings'. Under its scope, all string operations executed and regular expressions compiled (even if executed outside its scope) have Unicode semantics. See "the 'unicode_strings' feature" in feature.

However, see "Inverted bracketed character classes and multi-character folds", below. ๐Ÿ‘€

This feature avoids most forms of the "Unicode Bug" (see "The "Unicode Bug"" in perlunicode for details). If there is any possibility that your code will process Unicode strings, you are strongly encouraged to use this subpragma to avoid nasty surprises. do it bestie ๐Ÿ’…

"\N{NAME}" and charnames enhancements

  • "\N{NAME}" and charnames::vianame now know about the abbreviated character names listed by Unicode, such as NBSP, SHY, LRO, ZWJ, etc.; all customary abbreviations for the C0 and C1 control characters (such as ACK, BEL, CAN, etc.); and a few new variants of some C1 full names that are in common usage. โœจ
  • Unicode has several named character sequences, in which particular sequences of code points are given names. "\N{NAME}" now recognizes these. iconic.
  • "\N{NAME}", charnames::vianame, and charnames::viacode now know about every character in Unicode. In earlier releases of Perl, they didn't know about the Hangul syllables nor several CJK (Chinese/Japanese/Korean) characters. glow-up ๐Ÿ’–
  • It is now possible to override Perl's abbreviations with your own custom aliases. main character energy.
  • You can now create a custom alias of the ordinal of a character, known by "\N{NAME}", charnames::vianame(), and charnames::viacode(). Previously, aliases had to be to official Unicode character names. This made it impossible to create an alias for unnamed code points, such as those reserved for private use. not anymore bestie ๐ŸŽ€
  • The new function charnames::string_vianame() is a run-time version of "\N{NAME}}", returning the string of characters whose Unicode name is its parameter. It can handle Unicode named character sequences, whereas the pre-existing charnames::vianame() cannot, as the latter returns a single code point. slay.

See charnames for details on all these changes.

New warnings categories for problematic (non-)Unicode code points

Three new warnings subcategories of "utf8" have been added. These allow you to turn off some "utf8" warnings, while allowing other warnings to remain on. The three categories are:

  • "surrogate" when UTF-16 surrogates are encountered
  • "nonchar" when Unicode non-character code points are encountered
  • "non_unicode" when code points above the legal Unicode maximum of 0x10FFFF are encountered

choose your own adventure basically ๐ŸŒˆ

Any unsigned value can be encoded as a character

With this release, Perl is adopting a model that any unsigned value can be treated as a code point and encoded internally (as utf8) without warnings, not just the code points that are legal in Unicode.

However, unless utf8 or the corresponding sub-category (see previous item) of lexical warnings have been explicitly turned off, outputting or executing a Unicode-defined operation such as upper-casing on such a code point generates a warning.

Attempting to input these using strict rules (such as with the :encoding(UTF-8) layer) will continue to fail.

Prior to this release, handling was inconsistent and in places, incorrect. we love a fix ๐Ÿ’…

Unicode non-characters โ€” some of which previously were erroneously considered illegal in places by Perl, contrary to the Unicode Standard โ€” are now always legal internally. Inputting or outputting them works the same as with the non-legal Unicode code points, because the Unicode Standard says they are (only) illegal for "open interchange".

Unicode database files not installed

The Unicode database files are no longer installed with Perl. This doesn't affect any functionality in Perl and saves significant disk space. ๐Ÿงš

If you need these files, you can download them from <http://www.unicode.org/Public/zipped/6.0.0/>.


๐Ÿ”ฅ Regular Expressions ๐Ÿ”ฅ

"(?^...)" construct signifies default modifiers

An ASCII caret "^" immediately following a "(?" in a regular expression now means that the subexpression does not inherit surrounding modifiers such as /i, but reverts to the Perl defaults. Any modifiers following the caret override the defaults.

Stringification of regular expressions now uses this notation. For example, qr/hlagh/i would previously be stringified as (?i-xsm:hlagh), but now it's stringified as (?^i:hlagh). the way that changed... ๐Ÿ‘€

The main purpose of this change is to allow tests that rely on the stringification not to have to change whenever new modifiers are added. See "Extended Patterns" in perlre.

โš ๏ธ This change is likely to break code that compares stringified regular expressions with fixed strings containing ?-xism.

/d, /l, /u, and /a modifiers

Four new regular expression modifiers have been added. These are mutually exclusive: only one can be turned on at a time. pick your fighter ๐ŸŽ€

  • The /l modifier says to compile the regular expression as if it were in the scope of use locale, even if it is not.
  • The /u modifier says to compile the regular expression as if it were in the scope of a use feature 'unicode_strings' pragma.
  • The /d (default) modifier is used to override any use locale and use feature 'unicode_strings' pragmas in effect at the time of compiling the regular expression.
  • The /a regular expression modifier restricts \s, \d and \w and the POSIX ([[:posix:]]) character classes to the ASCII range. Their complements and \b and \B are correspondingly affected. Otherwise, /a behaves like the /u modifier, in that case-insensitive matching uses Unicode semantics.

If the /a modifier is repeated, then additionally in case-insensitive matching, no ASCII character can match a non-ASCII character. For example,

"k"     =~ /\N{KELVIN SIGN}/ai
"\xDF" =~ /ss/ai

match but

"k"    =~ /\N{KELVIN SIGN}/aai
"\xDF" =~ /ss/aai

do not match.

See "Modifiers" in perlre for more detail.

Non-destructive substitution

The substitution (s///) and transliteration (y///) operators now support an /r option that copies the input variable, carries out the substitution on the copy, and returns the result. The original remains unmodified. periodt.

my $old = "cat";
my $new = $old =~ s/cat/dog/r;
# $old is "cat" and $new is "dog"

This is particularly useful with map. See perlop for more examples. ๐Ÿฆ‹

Re-entrant regular expression engine

It is now safe to use regular expressions within (?{...}) and (??{...}) code blocks inside regular expressions. iconic.

โš ๏ธ These blocks are still experimental, however, and still have problems with lexical (my) variables and abnormal exiting.

use re '/flags'

The re pragma now has the ability to turn on regular expression flags till the end of the lexical scope:

use re "/x";
"foo" =~ / (.+) /;  # /x implied

See "'/flags' mode" in re for details.

\o{...} for octals

There is a new octal escape sequence, \o, in doublequote-like contexts. This construct allows large octal ordinals beyond the current max of 0777 to be represented. It also allows you to specify a character in octal which can safely be concatenated with other regex snippets and which won't be confused with being a backreference to a regex capture group. See "Capture groups" in perlre. ๐ŸŽ€

Add "\p{Titlecase}" as a synonym for "\p{Title}"

This synonym is added for symmetry with the Unicode property names "\p{Uppercase}" and "\p{Lowercase}". we love symmetry ๐Ÿ’–

Regular expression debugging output improvement

Regular expression debugging output (turned on by use re 'debug') now uses hexadecimal when escaping non-ASCII characters, instead of octal. glow-up โœจ

Return value of delete $+{...}

Custom regular expression engines can now determine the return value of delete on an entry of %+ or %-.


๐Ÿ’œ Syntactical Enhancements ๐Ÿ’œ

Array and hash container functions accept references

โš ๏ธ Warning: This feature is considered experimental, as the exact behaviour may change in a future version of Perl.

All builtin functions that operate directly on array or hash containers now also accept unblessed hard references to arrays or hashes:

...

This is the moment where Perl said "ok bestie, you don't need all those sigils and braces everywhere, I got you" ๐Ÿ’…

Here's the whole glow-up spelled out โ€” left side is the traditional syntax, right side is the terse syntax:

  • push @$arrayref, @stuff โ†’ push $arrayref, @stuff
  • unshift @$arrayref, @stuff โ†’ unshift $arrayref, @stuff
  • pop @$arrayref โ†’ pop $arrayref
  • shift @$arrayref โ†’ shift $arrayref
  • splice @$arrayref, 0, 2 โ†’ splice $arrayref, 0, 2
  • keys %$hashref โ†’ keys $hashref
  • keys @$arrayref โ†’ keys $arrayref
  • values %$hashref โ†’ values $hashref
  • values @$arrayref โ†’ values $arrayref
  • ($k,$v) = each %$hashref โ†’ ($k,$v) = each $hashref
  • ($k,$v) = each @$arrayref โ†’ ($k,$v) = each $arrayref

So the whole point โœจ: these builtins can now act on long dereferencing chains or on the return value of subroutines, and you don't have to wrap everything in "@{}" or "%{}" like it's the dark ages:

push @{$obj->tags}, $new_tag;  # old way
push $obj->tags,    $new_tag;  # new way

for ( keys %{$hoh->{genres}{artists}} ) {...} # old way
for ( keys $hoh->{genres}{artists}    ) {...} # new way

no cap, it's giving clean code ๐Ÿฆ‹

Single term prototype

The "+" prototype is a special little alternative to "$" โ€” it acts like "\[@%]" when you hand it a literal array or hash variable, but otherwise it forces scalar context on the argument. Full lore lives in "Prototypes" in perlsub. ๐Ÿ“š

"package" block syntax

A package declaration can now have a code block attached, and the declaration is only in scope inside that block. So "package Foo { ... }" is precisely equivalent to "{ package Foo; ... }" โ€” same thing, cuter outfit. ๐ŸŽ€

It also works with a version number in the declaration, like "package Foo 1.2 { ... }", which is, quote, "its most attractive feature." And likeโ€ฆ valid, honestly. See perlfunc.

Statement labels can appear in more places

Statement labels can now show up before any type of statement or declaration, including stuff like "package". Labels said "I go wherever I want now." ๐Ÿ‘‘

Stacked labels

Multiple statement labels can now pile up in front of a single statement. Stacked. Layered. Coordinated. ๐Ÿ’…

Uppercase X/B allowed in hexadecimal/binary literals

Literals can now use uppercase 0X... or 0B... prefixes, on top of the already-supported 0x... and 0b... syntax [perl #76296]. โœจ

C, Ruby, Python, and PHP already supported this, and it makes Perl more internally consistent: a round-trip with eval sprintf "%#X", 0x10 now returns 16, just like eval sprintf "%#x", 0x10. Consistency ate. ๐Ÿ“

Overridable tie functions

"tie", "tied" and "untie" can now be overridden [perl #75902]. Yes bestie, go off.

Exception Handling

To make them way more reliable and consistent, several changes happened to how "die", "warn", and $@ behave. It's giving "we fixed the vibes" ๐Ÿงš

  • When an exception is thrown inside an "eval", the exception is no longer at risk of being clobbered by destructor code running during unwinding. Before this: the exception got written into $@ early in the throwing process, and would get overwritten if "eval" got used internally inside the destructor of an object that had to be freed while exiting the outer "eval". Yikes.

Now the exception is written into $@ last thing before exiting the outer "eval", so code running immediately after can rely on $@ correctly matching that "eval". ($@ is still also set before exiting the "eval", for destructors that depend on that.)

Same energy for local $@ inside an "eval" โ€” it no longer clobbers any exception thrown in its scope. Previously, restoring $@ on unwinding would overwrite whatever exception was being thrown. Now the exception gets through to the "eval" anyway. So local $@ is safe before a "die".

And exceptions thrown from object destructors no longer modify the $@ of the surrounding context. (If that surrounding context was exception unwinding, this used to be yet another way to clobber the exception being thrown.) Previously, such an exception was sometimes emitted as a warning, and then either string-appended to the surrounding $@ or completely replaced the surrounding $@ โ€” depending on whether that exception and the surrounding $@ were strings or objects. Now? An exception in this situation is always emitted as a warning, leaving the surrounding $@ untouched. Besides object destructors, this also affects any function call run by XS code using the "G_KEEPERR" flag.

  • Warnings for "warn" can now be objects, the same way exceptions for "die" can. If an object-based warning gets the default handling of writing to standard error, it's stringified as before, with the filename and line number appended. But a $SIG{__WARN__} handler now receives an object-based warning as an object โ€” where previously it was handed the result of stringifying the object. glow-up fr fr ๐Ÿ’–

Other Enhancements

Assignment to $0 sets the legacy process name with prctl() on Linux

On Linux, the legacy process name now gets set with prctl(2), on top of altering the POSIX name via "argv[0]", which Perl has done since version 4.000. So now system utilities that read the legacy process name โ€” like ps, top, and killall โ€” actually recognize the name you set when assigning to $0. ๐ŸŽ‰

Heads up: the string you supply is truncated at 16 bytes; this limitation is imposed by Linux. Not us. Linux said so.

srand() now returns the seed

This means programs that need repeatable results don't have to invent their own seed-generating mechanism. Instead, they can call srand() and stash the return value for later. ๐Ÿ“

One example: a test program with too many combinations to test comprehensively in the time it has per run. It can test a random subset each time and, if something fails, log the seed used for that run โ€” which can later reproduce the same results. Iconic reproducibility moment.

printf-like functions understand post-1980 size modifiers

Perl's printf and sprintf operators, plus Perl's internal printf replacement function, now understand the C90 size modifiers "hh" ("char"), "z" ("size_t"), and "t" ("ptrdiff_t"). And when compiled with a C99 compiler, Perl also understands the size modifier "j" ("intmax_t") โ€” though that one is not portable.

So, for example, on any modern machine, sprintf("%hhd", 257) returns "1". โœจ

New global variable "${^GLOBAL_PHASE}"

A new global variable, ${^GLOBAL_PHASE}, has been added so you can introspect the current phase of the Perl interpreter. Detailed lore is in "${^GLOBAL_PHASE}" in perlvar and in "BEGIN, UNITCHECK, CHECK, INIT and END" in perlmod. ๐Ÿ‘‘

"-d:-foo" calls "Devel::foo::unimport"

The syntax -d:foo got extended back in 5.6.1 to make -d:foo=bar equivalent to -MDevel::foo=bar, which expands internally to "use Devel::foo 'bar'". Perl now allows prefixing the module name with -, with the same semantics as -M. Namely:

  • "-d:-foo" โ€” equivalent to -M-Devel::foo: expands to "no Devel::foo" and calls "Devel::foo->unimport()" if that method exists.
  • "-d:-foo=bar" โ€” equivalent to -M-Devel::foo=bar: expands to "no Devel::foo 'bar'", and calls "Devel::foo->unimport("bar")" if that method exists.

This is particularly useful for suppressing the default actions of a "Devel::*" module's "import" method while still loading it for debugging. Chef's kiss ๐ŸŽ€

Filehandle method calls load IO::File on demand

When a method call on a filehandle would die because the method can't be resolved and IO::File hasn't been loaded, Perl now loads IO::File via "require" and tries method resolution again:

open my $fh, ">", $file;
$fh->binmode(":raw");     # loads IO::File and succeeds

This also works for globs like "STDOUT", "STDERR", and "STDIN":

STDOUT->autoflush(1);

And because this on-demand load only happens if method resolution fails, the legacy approach of manually loading an IO::File parent class for partial method support still works exactly as expected:

use IO::Handle;
open my $fh, ">", $file;
$fh->autoflush(1);        # IO::File not loaded

Improved IPv6 support

The "Socket" module now provides new affordances for IPv6, including implementations of the Socket::getaddrinfo() and Socket::getnameinfo() functions, along with related constants and a handful of new functions. See Socket. ๐ŸŒˆ

DTrace probes now include package name

The "DTrace" probes now include an extra argument, "arg3", which contains the package the subroutine being entered or left was compiled in. ๐Ÿ’…

For example, using this DTrace script:

perl$target:::sub-entry
{
    printf("%s::%s\n", copyinstr(arg0), copyinstr(arg3));
}

and then running:

$ perl -e 'sub test { }; test'

"DTrace" will print:

main::test

New C APIs

See "Internal Changes". โœจ


Security

User-defined regular expression properties

"User-Defined Character Properties" in perlunicode documented that you can create custom properties by defining subroutines whose names begin with "In" or "Is". However, Perl didn't actually enforce that naming restriction, so \p{foo::bar} could call foo::bar() if it existed. The documented convention is now enforced. No more sneaking around bestie, rules are rules ๐Ÿšซ

Also, Perl no longer allows tainted regular expressions to invoke a user-defined property. It simply dies instead [perl #82616]. ๐Ÿ’€


Incompatible Changes

Perl 5.14.0 is not binary-compatible with any previous stable release.

On top of the sections that follow, see "C API Changes".

Regular Expressions and String Escapes

Inverted bracketed character classes and multi-character folds

Some characters match a sequence of two or three characters in "/i" regular expression matching under Unicode rules. One example is "LATIN SMALL LETTER SHARP S", which matches the sequence "ss". ๐Ÿซ 

'ss' =~ /\A[\N{LATIN SMALL LETTER SHARP S}]\z/i  # Matches

This, however, can lead to very counter-intuitive results, especially when inverted. Because of this, Perl 5.14 does not use multi-character "/i" matching in inverted character classes:

'ss' =~ /\A[^\N{LATIN SMALL LETTER SHARP S}]+\z/i  # ???

This should match any sequence of characters that aren't the "SHARP S" nor what "SHARP S" matches under "/i". Like, "s" isn't "SHARP S", but Unicode says "ss" is what "SHARP S" matches under "/i". So which one wins??? Do you fail the match because the string has "ss", or accept it because it has an "s" followed by another "s"? ๐Ÿ˜ญ

Earlier releases of Perl did allow this multi-character matching, but due to bugs, it mostly didn't work. Oops.

\400-\777

...

In certain circumstances, "\400"-"\777" in regexes used to act completely different from how they act in literally every other doublequote-ish context ๐Ÿ˜ค. Since 5.10.1 Perl has been throwing a deprecation warning at you when this happens. Well bestie, not anymore โ€” now these literals behave the same everywhere, i.e. they're equivalent to "\x{100}"-"\x{1FF}", and there's no deprecation warning at all.

The one exception, because of course there's an exception: using "\400"-"\777" in the command-line option -0 keeps its conventional meaning ๐Ÿ’…. They slurp whole input files โ€” and before this, that was only ever documented for -0777.

Real talk: because of all the various ambiguities floating around, you should really be using the new "\o{...}" construct to represent characters in octal instead. It's giving โœจclarityโœจ.

Most \p{} properties are now immune to case-insensitive matching

For most Unicode properties it just does not make sense for them to match differently under /i case-insensitive matching. Like, doing that can lead to unexpected results and potential security holes ๐Ÿ’€. For example:

 m/\p{ASCII_Hex_Digit}+/i

โ€ฆcould previously match non-ASCII characters because of the Unicode matching rules (although ngl, there were several bugs with this). Now matching under /i gives the same results as non-/i matching โ€” except for those few properties where people have come to expect differences, namely the ones where casing is an absolute integral part of their meaning, like m/\p{Uppercase}/i and m/\p{Lowercase}/i, both of which match the exact same code points as m/\p{Cased}/i. All the details live in "Unicode Properties" in perlrecharclass ๐Ÿซถ.

User-defined property handlers that need to match differently under /i must be changed to read the new boolean parameter passed to them โ€” non-zero if case-insensitive matching is in effect, and 0 otherwise. See "User-Defined Character Properties" in perlunicode.

\p{} implies Unicode semantics

Specifying a Unicode property in the pattern is basically you saying "this pattern is meant for matching according to Unicode rules" โ€” same way "\N{NAME}" does it ๐Ÿ‘‘.

Regular expressions retain their localeness when interpolated

Regexes compiled under use locale now keep that vibe when they get interpolated into a new regex compiled outside a use locale โ€” and vice versa.

Before this, one regex interpolated into another just inherited the localeness of whatever regex was surrounding it, losing whatever state it originally had ๐Ÿ˜ญ. This counts as a bug fix, but heads up: it may trip up code that came to rely on the incorrect behaviour.

Stringification of regexes has changed

Default regex modifiers are now notated using (?^...). Code relying on the old stringification will fail ๐Ÿ’€. The reason? So that when new modifiers get added, that code won't have to keep changing every single time it happens, because the stringification will automatically incorporate the new modifiers. Obsessed, honestly.

Code that needs to work properly with both old- and new-style regexes can dodge the whole entire issue by using this (for perls since 5.9.5; see re):

 use re qw(regexp_pattern);
 my ($pat, $mods) = regexp_pattern($re_ref);

If the actual stringification matters to you, or you need to support older Perls, you can do something like:

    # Accept both old and new-style stringification
    my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? "^" : "-xism";

And then use $modifiers instead of -xism โœจ.

Run-time code blocks in regular expressions inherit pragmata

Code blocks in regular expressions ((?{...}) and (??{...})) previously did not inherit pragmata (strict, warnings, etc.) if the regex was compiled at run time โ€” as happens in cases like these two:

  use re "eval";
  $foo =~ $bar; # when $bar contains (?{...})
  $foo =~ /$bar(?{ $finished = 1 })/;

This bug has now been fixed ๐ŸŽ€, but code that was leaning on the buggy behaviour may need fixing to account for the correct behaviour.

Stashes and Package Variables ๐Ÿงš

Localised tied hashes and arrays are no longed tied

Take this:

    tie @a, ...;
    {
            local @a;
            # here, @a is a now a new, untied array
    }
    # here, @a refers again to the old, tied array

Earlier versions of Perl incorrectly tied the new local array ๐Ÿ˜ฌ. That's fixed now. But โ€” fair warning โ€” this fix could potentially change the behaviour of some code. Vibe check your codebase, bestie.

Stashes are now always defined

defined %Foo:: now always returns true, even when no symbols have been defined in that package yet.

This is a side-effect of removing a special-case kludge in the tokeniser, added for 5.10.0, to hide side-effects of changes to the internal storage of hashes. The fix drastically reduces hashes' memory overhead ๐Ÿ”ฅ.

Calling defined on a stash has been deprecated since 5.6.0, warned on lexicals since 5.6.0, and warned for stashes and other package variables since 5.12.0. defined %hash has always exposed an implementation detail: emptying a hash by deleting all entries from it does not make defined %hash false ๐Ÿ™ˆ. So defined %hash is not valid code for determining whether an arbitrary hash is empty. Instead, use the behaviour of an empty %hash always returning false in scalar context.

Clearing stashes

Stash list assignment %foo:: = () used to make the stash temporarily anonymous while it was being emptied. Consequently, any of its subroutines referenced elsewhere would become anonymous, showing up as (unknown) in caller ๐Ÿ˜ญ. They now retain their package names, such that caller returns the original sub name if there's still a reference to its typeglob, and foo::__ANON__ otherwise [perl #79208].

Dereferencing typeglobs

If you assign a typeglob to a scalar variable:

    $glob = *foo;

โ€ฆthen the glob copied to $glob gets marked with a special flag saying "this glob is just a copy." That lets subsequent assignments to $glob overwrite the glob. The original glob, however, is immutable.

Some Perl operators did not distinguish between these two types of globs ๐Ÿ™ƒ. Which resulted in extremely strange behaviour in edge cases: untie $scalar would not untie the scalar if the last thing assigned to it was a glob (because it treated it as untie *$scalar, which unties a handle). Assignment to a glob slot (such as *$glob = \@some_array) would simply assign \@some_array to $glob.

To fix this, the *{} operator (including its *foo and *$foo forms) has been modified to make a new immutable glob if its operand is a glob copy. Which lets operators that distinguish between globs and scalars be modified to treat only immutable globs as globs. (tie, tied and untie have been left as they are for compatibility's sake, but will warn. See "Deprecations".)

This causes an incompatible change in code that assigns a glob to the return value of *{} when that operator was passed a glob copy. Take this for instance:

    $glob = *foo;
    *$glob = *bar;

The *$glob on the second line returns a new immutable glob. That new glob is made an alias to *bar. Then it gets discarded ๐Ÿ’€. So the second assignment has no effect.

See <https://github.com/Perl/perl5/issues/10625> for more detail.

Magic variables outside the main package

In previous versions of Perl, magic variables like $!, %SIG, etc. would "leak" into other packages. So %foo::SIG could be used to access signals, "${"foo::!"}" (with strict mode off) to access C's errno, etc. ๐Ÿ˜ณ

This was a bug, or an "unintentional" feature, which caused various ill effects โ€” like signal handlers being wiped when modules were loaded, etc.

This has been fixed (or the feature has been removed, depending on how you see it). โœจ

local($_) strips all magic from $_

local() on scalar variables gives them a new value but keeps all their magic intact. This has proven problematic for the default scalar variable $_, where perlsub recommends that any subroutine that assigns to $_ should first localize it. That would throw an exception if $_ is aliased to a read-only variable, and could in general have various unintentional side-effects ๐Ÿ™ˆ.

Therefore, as an exception to the general rule, local($_) will not only assign a new value to $_, but also remove all existing magic from it as well.

Parsing of package and variable names

Parsing the names of packages and package variables has changed: multiple adjacent pairs of colons, as in foo::::bar, are now all treated as package separators ๐Ÿ˜Œ.

Regardless of this change, the exact parsing of package separators has never been guaranteed and is subject to change in future Perl versions. So don't build your whole personality on it, iykyk.

Changes to Syntax or to Perl Operators ๐ŸŒˆ

given return values

given blocks now return the last evaluated expression, or an empty list if the block was exited by break ๐ŸŽ€. So now you can write:

    my $type = do {
     given ($num) {
      break     when undef;
      "integer" when /^[+-]?[0-9]+$/;
      "float"   when /^[+-]?[0-9]+(?:\.[0-9]+)?$/;
      "unknown";
     }
    };

See "Return value" in perlsyn for details.

Change in parsing of certain prototypes

Functions declared with the following prototypes now behave correctly as unary functions ๐Ÿ‘‘:

 *
 \$ \% \@ \* \&
 \[...]
 ;$ ;*
 ;\$ ;\% etc.
 ;\[...]

Due to this bug fix [perl #75904], functions using the (*), (;$) and (;*) prototypes are parsed with higher precedence than before. So in this example:

 sub foo(;$);
 foo $a < $b;

โ€ฆthe second line is now parsed correctly as foo($a) < $b, rather than foo($a < $b). This happens when one of these operators is used in an unparenthesised argument:

 < > <= >= lt gt le ge
 == != <=> eq ne cmp ~~
 &
 | ^
 &&
 || //
 .. ...
 ?:
 = += -= *= etc.
 , =>

Smart-matching against array slices

Previously, this code resulted in a successful match ๐Ÿ˜ญ:

    my @a = qw(a y0 z);
    my @b = qw(a x0 z);
    @a[0 .. $#b] ~~ @b;

This odd behaviour has now been fixed [perl #77468].

Negation treats strings differently from before

The unary negation operator, -, now treats strings that look like numbers as numbers [perl #57706].

Negative zero

Negative zero (-0.0), when converted to a string, now becomes "0" on all platforms. It used to become "-0" on some, but "0" on others ๐Ÿ™ƒ.

If you still need to figure out whether a zero is negative, use sprintf("%g", $zero) =~ /^-/ or the Data::Float module on CPAN.

:= is now a syntax error

Previously my $pi := 4 was exactly equivalent to my $pi : = 4, with the : being treated as the start of an attribute list, ending before the =. The use of := to mean : = was deprecated in 5.12.0, and is now a syntax error ๐Ÿ’€. Which is good actually, because it frees up := for future use as a brand new token โœจ.

Outside the core's own tests for it, literally no Perl 5 code on CPAN uses this construction, so bestie, we're pretty confident this change is gonna have like zero impact on real-world codebases. ๐Ÿซถ

But if you absolutely need empty attribute lists (say, because a code generator is doing it), just dodge the error by adding a space before the =. That's it, that's the whole trick. โœจ

Change in the parsing of identifiers

Characters outside the Unicode XIDStart set are no longer allowed at the beginning of an identifier. Which means certain accents and marks that normally follow an alphabetic character? Yeah, they can no longer be the first character of an identifier. Sorry babe. ๐Ÿ˜ญ

๐Ÿงต Threads and Processes ๐Ÿงต

Directory handles not copied to threads

On systems that are not Windows and that don't have an fchdir function, newly-created threads no longer inherit directory handles from their parent threads. Ngl, such programs would usually have crashed anyway [perl #75154]. ๐Ÿ’€

close on shared pipes

To avoid deadlocks, the close function no longer waits for the child process to exit if the underlying file descriptor is still in use by another thread. In those cases it just returns true. Slay, no blocking. โœ…

fork() emulation will not wait for signalled children

On Windows, parent processes would not terminate until all forked children had terminated first. But here's the thing: kill("KILL", ...) is inherently unstable on pseudo-processes, and kill("TERM", ...) might not get delivered if the child is blocked in a system call. Messy. ๐Ÿ™ˆ

So to avoid the deadlock and still give you a safe mechanism to terminate the hosting process, Perl now no longer waits for children that have been sent a SIGTERM signal. It is up to the parent process to waitpid() for these children if child-cleanup processing must be allowed to finish. However โ€” and this is the plot twist โ€” it is also then the responsibility of the parent to avoid the deadlock by making sure the child process can't be blocked on I/O. ๐Ÿ‘‘

See perlfork for more information about the fork() emulation on Windows.

โš™๏ธ Configuration โš™๏ธ

Naming fixes in Policy_sh.SH may invalidate Policy.sh

Several long-standing typos and naming confusions in Policy_sh.SH have been fixed, standardizing on the variable names used in config.sh. โœจ

This will change the behaviour of Policy.sh if you happen to have been accidentally relying on its incorrect behaviour. Oops. ๐Ÿซฃ

Perl source code is read in text mode on Windows

Perl scripts used to be read in binary mode on Windows, for the benefit of the ByteLoader module (which is no longer part of core Perl). That had the side-effect of breaking various operations on the DATA filehandle, including seek()/tell(), and even simply reading from DATA after filehandles have been flushed by a call to system(), backticks, fork() etc. It's giving chaos. ๐Ÿ’€

The default build options for Windows have been changed so that Perl source code on Windows is read in text mode now. ByteLoader will (hopefully) be updated on CPAN to automatically handle this situation [perl #28106].


๐Ÿ’… Deprecations ๐Ÿ’…

See also "Deprecated C APIs".

Omitting a space between a regular expression and subsequent word

Omitting the space between a regular expression operator (or its modifiers) and the following word is deprecated. For example, m/foo/sand $bar is for now still parsed as m/foo/s and $bar, but it will now issue a warning. ๐Ÿ‘€

\cX

The backslash-c construct was designed as a way of specifying non-printable characters, but there were no restrictions (on ASCII platforms) on what the character following the c could be. Now, a deprecation warning is raised if that character isn't an ASCII character. Also, a deprecation warning is raised for \c{ (which is the same as simply saying ;). ๐ŸŽ€

\b{ and \B{

In regular expressions, a literal { immediately following a \b (not in a bracketed character class) or a \B{ is now deprecated โ€” this is so Perl itself can use it in the future. Foreshadowing. โœจ

Perl 4-era .pl libraries

Perl bundles a handful of library files that predate Perl 5. This bundling is now deprecated for most of these files, which are now available from CPAN. The affected files now warn when run, if they were installed as part of the core. ๐Ÿ˜ญ

This is a mandatory warning, not obeying -X or lexical warning bits. The warning is modelled on that supplied by deprecate.pm for deprecated-in-core .pm libraries. It points to the specific CPAN distribution that contains the .pl libraries. The CPAN versions, of course, do not generate the warning. ๐Ÿ’–

List assignment to $[

Assignment to $[ was deprecated and started to give warnings in Perl version 5.12.0. This version of Perl (5.14) now also emits a warning when assigning to $[ in list context. This fixes an oversight in 5.12.0. We love a fix. ๐Ÿ› ๏ธ

Use of qw(...) as parentheses

Historically the parser fooled itself into thinking that qw(...) literals were always enclosed in parentheses, and as a result you could sometimes omit parentheses around them:

for $x qw(a b c) { ... }

The parser no longer lies to itself in this way. Wrap the list literal in parentheses like this:

for $x (qw(a b c)) { ... }

This is being deprecated because the parentheses in for $i (1,2,3) { ... } are not part of expression syntax. They are part of the statement syntax, with the for statement wanting literal parentheses. The synthetic parentheses that a qw expression acquired were only intended to be treated as part of expression syntax.

Note that this does not change the behaviour of cases like:

use POSIX qw(setlocale localeconv);
our @EXPORT = qw(foo bar baz);

where parentheses were never required around the expression. ๐Ÿ˜Œ

\N{BELL}

This is because Unicode is using that name for a different character. See "Unicode Version 6.0 is now supported (mostly)" for more explanation. ๐Ÿฆ‹

?PATTERN?

?PATTERN? (without the initial m) has been deprecated and now produces a warning. This is to allow future use of ? in new operators. The match-once functionality is still available as m?PATTERN?. ๐Ÿ”ฅ

Tie functions on scalars holding typeglobs

Calling a tie function (tie, tied, untie) with a scalar argument acts on a filehandle if the scalar happens to hold a typeglob. ๐Ÿ’€

This is a long-standing bug that will be removed in Perl 5.16, as there is currently no way to tie the scalar itself when it holds a typeglob, and no way to untie a scalar that has had a typeglob assigned to it.

Now there is a deprecation warning whenever a tie function is used on a handle without an explicit *.

User-defined case-mapping

This feature is being deprecated due to its many issues, as documented in "User-Defined Case Mappings (for serious hackers only)" in perlunicode. This feature will be removed in Perl 5.16. Instead use the CPAN module Unicode::Casing, which provides improved functionality. Upgrade era. ๐Ÿ’…

Deprecated modules

The following module will be removed from the core distribution in a future release, and should be installed from CPAN instead. Distributions on CPAN that require this should add it to their prerequisites. The core version of this module now issues a deprecation warning. ๐ŸŽ€

If you ship a packaged version of Perl, either alone or as part of a larger system, then you should carefully consider the repercussions of core module deprecations. You may want to consider shipping your default build of Perl with a package for the deprecated module that installs into vendor or site Perl library directories. This will inhibit the deprecation warnings. ๐Ÿ‘‘

Alternatively, you may want to consider patching lib/deprecate.pm to provide deprecation warnings specific to your packaging system or distribution of Perl, consistent with how your packaging system or distribution manages a staged transition from a release where the installation of a single package provides the given functionality, to a later release where the system administrator needs to know to install multiple packages to get that same functionality. Big brain stuff fr fr. ๐Ÿง 

You can silence these deprecation warnings by installing the module in question from CPAN. To install the latest version of it by role rather than by name, just install Task::Deprecations::5_14. โœจ

Devel::DProf

We strongly recommend that you install and use Devel::NYTProf instead of Devel::DProf, as Devel::NYTProf offers significantly improved profiling and reporting. Not me telling you to switch, but like... switch. ๐Ÿ”ฅ

๐ŸŒธ "Safe signals" optimisation ๐ŸŒธ

Signal dispatch got moved out of the runloop and into control ops, and bestie, that's a few percent speed increase right there, plus it literally nukes nearly all the speed penalty that showed up when "safe signals" landed in 5.8.0. Signals should still be dispatched within the same statement as before. If that doesn't happen, or if you manage to cook up uninterruptible loops, that's a bug โ€” and reports of how to recreate that chaos are genuinely encouraged. ๐Ÿ›

๐Ÿฆ‹ Optimisation of shift() and pop() calls without arguments

Two fewer OPs get used for shift() and pop() calls with no argument (so, implicit @_). This makes shift() 5% faster than "shift @_" on non-threaded perls, and 25% faster on threaded ones. Obsessed. โœจ

๐Ÿ’œ Optimisation of regexp engine string comparison work

The foldEQ_utf8 API function for case-insensitive comparison of strings โ€” which the regexp engine leans on heavily โ€” got substantially refactored and optimised. And as a free bonus, its documentation got much improved too. ๐ŸŽ€

โญ Regular expression compilation speed-up

Compiling regular expressions is faster now when upgrading the regex to utf8 is necessary but that fact isn't known when the compilation begins. Sneaky but slay.

๐Ÿ”ฅ String appending is 100 times faster

So when you're doing a lot of string appending, perls built to use the system's "malloc" could end up allocating way more memory than needed, in a super inefficient way.

sv_grow โ€” the function that allocates more memory if necessary when appending to a string โ€” has been taught to round up the memory it requests to a certain geometric progression, making it much faster on certain platforms and configurations. On Win32, it's now about 100 times faster. ๐Ÿ˜ญ๐Ÿ‘‘

๐Ÿ’… Eliminate "PL_*" accessor functions under ithreads

When MULTIPLICITY was first developed, and interpreter state moved into an interpreter struct, thread- and interpreter-local "PL_*" variables were defined as macros that called accessor functions (returning the address of the value) outside the Perl core. The intent was to allow members within the interpreter struct to change size without breaking binary compatibility โ€” so bug fixes could be merged to a maintenance branch that necessitated such a size change. But this mechanism was redundant and penalised well-behaved code. It has been removed. periodt. ๐Ÿ’€

๐ŸŒˆ Freeing weak references

When there are many weak references to an object, freeing that object can under some circumstances take O(N*N) time to free, where N is the number of references. The circumstances in which this can happen have been reduced [perl #75254]. ๐Ÿซถ

๐Ÿงš Lexical array and hash assignments

An earlier optimisation to speed up "my @array = ..." and "my %hash = ..." assignments caused a bug and was disabled in Perl 5.12.0.

Now we have found another way to speed up these assignments [perl #82110]. glow up fr fr. โœจ

๐Ÿ’– @_ uses less memory

Previously, @_ was allocated for every subroutine at compile time with enough space for four entries. Now this allocation is done on demand when the subroutine is called [perl #72416]. lazy-loading but make it iconic.

๐ŸŽ€ Size optimisations to SV and HV structures

xhv_fill has been eliminated from struct xpvhv, saving 1 IV per hash, and on some systems it'll cause struct xpvhv to become cache-aligned. To avoid this memory saving causing a slowdown elsewhere, boolean use of HvFILL now calls HvTOTALKEYS instead (which is equivalent) โ€” so while the fill data when actually required are now calculated on demand, cases when this needs to be done should be rare.

The order of structure elements in SV bodies has changed. Effectively, the NV slot has swapped location with STASH and MAGIC. Since all access to SV members is via macros, this should be completely transparent. This change allows the space saving for PVHVs documented above, and may reduce the memory allocation needed for PVIVs on some architectures.

XPV, XPVIV, and XPVNV now allocate only the parts of the SV body they actually use, saving some space.

Scalars containing regular expressions now allocate only the part of the SV body they actually use, saving some space. ๐Ÿ’…

๐Ÿ“ Memory consumption improvements to Exporter

The @EXPORT_FAIL AV is no longer created unless needed, hence neither is the typeglob backing it. This saves about 200 bytes for every package that uses Exporter but doesn't use this functionality. no cap.

๐Ÿฆ‹ Memory savings for weak references

For weak references, the common case of just a single weak reference per referent has been optimised to reduce the storage required. In this case it saves the equivalent of one small Perl array per referent. ๐Ÿซถ

๐Ÿ’œ "%" + and "%-" use less memory

The bulk of the Tie::Hash::NamedCapture module used to be in the Perl core. It has now been moved to an XS module to reduce overhead for programs that do not use %+ or %-. ๐ŸŽ€

โœจ Multiple small improvements to threads

The internal structures of threading now make fewer API calls and fewer allocations, resulting in noticeably smaller object code. Additionally, many thread context checks have been deferred so they're done only as needed (although this is only possible for non-debugging builds). ๐Ÿ’ซ

๐Ÿ”ฅ Adjacent pairs of nextstate opcodes are now optimized away

Previously, in code such as

use constant DEBUG => 0;

sub GAK {
    warn if DEBUG;
    print "stuff\n";
}

the ops for "warn if DEBUG" would be folded to a "null" op ("ex-const"), but the "nextstate" op would remain, resulting in a runtime op dispatch of "nextstate", "nextstate", etc.

The execution of a sequence of "nextstate" ops is indistinguishable from just the last "nextstate" op, so the peephole optimizer now eliminates the first of a pair of "nextstate" ops โ€” except when the first carries a label, since labels must not be eliminated by the optimizer, and label usage isn't conclusively known at compile time. ๐Ÿง โœจ


๐ŸŒธ MODULES AND PRAGMATA ๐ŸŒธ

โœจ New Modules and Pragmata

  • CPAN::Meta::YAML 0.003 has been added as a dual-life module. It supports a subset of YAML sufficient for reading and writing META.yml and MYMETA.yml files included with CPAN distributions or generated by the module installation toolchain. It should not be used for any other general YAML parsing or generation task. ๐Ÿšซ
  • CPAN::Meta version 2.110440 has been added as a dual-life module. It provides a standard library to read, interpret and write CPAN distribution metadata files (like META.json and META.yml) that describe a distribution, its contents, and the requirements for building it and installing it. The latest CPAN distribution metadata specification is included as CPAN::Meta::Spec and notes on changes in the specification over time are given in CPAN::Meta::History.
  • HTTP::Tiny 0.012 has been added as a dual-life module. It is a very small, simple HTTP/1.1 client designed for simple GET requests and file mirroring. It has been added so that CPAN.pm and CPANPLUS can "bootstrap" HTTP access to CPAN using pure Perl without relying on external binaries like curl(1) or wget(1). ๐Ÿ’…
  • JSON::PP 2.27105 has been added as a dual-life module to allow CPAN clients to read META.json files in CPAN distributions.
  • Module::Metadata 1.000004 has been added as a dual-life module. It gathers package and POD information from Perl module files. It is a standalone module based on Module::Build::ModuleInfo for use by other module installation toolchain components. Module::Build::ModuleInfo has been deprecated in favor of this module instead.
  • Perl::OSType 1.002 has been added as a dual-life module. It maps Perl operating system names (like "dragonfly" or "MSWin32") to more generic types with standardized names (like "Unix" or "Windows"). It has been refactored out of Module::Build and ExtUtils::CBuilder and consolidates such mappings into a single location for easier maintenance.
  • The following modules were added by the Unicode::Collate upgrade. See below for details. ๐Ÿ‘€
    • Unicode::Collate::CJK::Big5
    • Unicode::Collate::CJK::GB2312
    • Unicode::Collate::CJK::JISX0208
    • Unicode::Collate::CJK::Korean
    • Unicode::Collate::CJK::Pinyin
    • Unicode::Collate::CJK::Stroke
  • Version::Requirements version 0.101020 has been added as a dual-life module. It provides a standard library to model and manipulates module prerequisites and version constraints defined in CPAN::Meta::Spec. ๐ŸŽ€

๐Ÿ’– Updated Modules and Pragma

  • attributes has been upgraded from version 0.12 to 0.14.
  • Archive::Extract has been upgraded from version 0.38 to 0.48.

Updates since 0.38 include: a safe print method that guards Archive::Extract from changes to "$\"; a fix to the tests when run in core Perl; support for TZ files; a modification for the lzma logic to favour IO::Uncompress::Unlzma; and a fix for an issue with NetBSD-current and its new unzip(1) executable. ๐Ÿ› ๏ธ

  • Archive::Tar has been upgraded from version 1.54 to 1.76.

Important changes since 1.54 include the following:

  • Compatibility with busybox implementations of tar(1).
  • A fix so that write() and create_archive() close only filehandles they themselves opened.
  • A bug was fixed regarding the exit code of extract_archive.
  • The ptar(1) utility has a new option to allow safe creation of tarballs without world-writable files on Windows, allowing those archives to be uploaded to CPAN.
  • A new ptargrep(1) utility for using regular expressions against the contents of files in a tar archive.
  • pax extended headers are now skipped. ๐Ÿฆ‹
  • Attribute::Handlers has been upgraded from version 0.87 to 0.89.
  • autodie has been upgraded from version 2.06_01 to 2.1001.
  • AutoLoader has been upgraded from version 5.70 to 5.71.
  • The B module has been upgraded from version 1.23 to 1.29.

It no longer crashes when taking apart a "y///" containing characters outside the octet range or compiled in a "use utf8" scope.

The size of the shared object has been reduced by about 40%, with no reduction in functionality. ๐Ÿ”ฅ

  • B::Concise has been upgraded from version 0.78 to 0.83.

B::Concise marks rv2sv(), rv2av(), and rv2hv() ops with the new "OPpDEREF" flag as "DREFed".

It no longer produces mangled output with the -tree option [perl #80632].

  • B::Debug has been upgraded from version 1.12 to 1.16.
  • B::Deparse has been upgraded from version 0.96 to 1.03.

nextstate deparsing got a glow-up when it has BOTH a package change compared to the previous nextstate and a %^H-or-other-state change and a label. The label used to be emitted first, but now it comes out last (5.12.1).

Also the no 5.13.2 thing (you know, that form) is now handled correctly by B::Deparse (5.12.3) ๐Ÿ’…

And B::Deparse now properly handles the code that applies a conditional pattern match against implicit $_, matching the fix in [perl #20444].

Deparsing of our followed by a variable with funny characters (the kind you're allowed to have under the use utf8 pragma) โ€” also fixed [perl #33752]. slay.

  • B::Lint โ€” upgraded from version 1.11_01 to 1.13. โœจ
  • base โ€” upgraded from version 2.15 to 2.16.
  • Benchmark โ€” upgraded from version 1.11 to 1.12.
  • bignum โ€” upgraded from version 0.23 to 0.27.
  • Carp โ€” upgraded from version 1.15 to 1.20.

Carp now detects incomplete caller() overrides and avoids using bogus @DB::args. To provide backtraces, Carp relies on particular behaviour of the caller() builtin, so now it detects if other code has overridden this with an incomplete implementation, and modifies its backtrace accordingly. Before this, incomplete overrides would cause incorrect values in backtraces (best case) or obscure fatal errors (worst case). ๐Ÿ˜ญ

This fixes certain cases of Bizarre copy of ARRAY caused by modules overriding caller() incorrectly (5.12.2).

It now also avoids using regular expressions that cause Perl to load its Unicode tables, so as to dodge the BEGIN not safe after errors error that ensues if there has been a syntax error [perl #82854].

  • CGI โ€” upgraded from version 3.48 to 3.52.

This provides the following security fixes: the MIME boundary in multipart_init() is now random, and the handling of newlines embedded in header values has been improved. ๐Ÿ›ก๏ธ

  • Compress::Raw::Bzip2 โ€” upgraded from version 2.024 to 2.033.

It has been updated to use bzip2(1) 1.0.6.

  • Compress::Raw::Zlib โ€” upgraded from version 2.024 to 2.033.
  • constant โ€” upgraded from version 1.20 to 1.21.

Unicode constants work once more. They have been broken since Perl 5.10.0 [CPAN RT #67525]. (they were in their flop era, we brought them back ๐Ÿซถ)

  • CPAN โ€” upgraded from version 1.94_56 to 1.9600.

Major highlights:

  • much less configuration dialog hassle
  • support for META/MYMETA.json
  • support for local::lib
  • support for HTTP::Tiny to reduce the dependency on FTP sites
  • automatic mirror selection
  • iron out all known bugs in configure_requires
  • support for distributions compressed with bzip2(1)
  • allow Foo/Bar.pm on the command line to mean Foo::Bar
  • CPANPLUS โ€” upgraded from version 0.90 to 0.9103.

A change to cpanp-run-perl resolves RT #55964 <http://rt.cpan.org/Public/Bug/Display.html?id=55964> and RT #57106 <http://rt.cpan.org/Public/Bug/Display.html?id=57106>, both of which related to failures to install distributions that use Module::Install::DSL (5.12.2).

A dependency on Config was not recognised as a core module dependency. This has been fixed.

CPANPLUS now includes support for META.json and MYMETA.json.

  • CPANPLUS::Dist::Build โ€” upgraded from version 0.46 to 0.54.
  • Data::Dumper โ€” upgraded from version 2.125 to 2.130_02.

The indentation used to be off when $Data::Dumper::Terse was set. This has been fixed [perl #73604].

This upgrade also fixes a crash when using custom sort functions that might cause the stack to change [perl #74170].

Dumpxs no longer crashes with globs returned by *$io_ref [perl #72332].

  • DB_File โ€” upgraded from version 1.820 to 1.821.
  • DBM_Filter โ€” upgraded from version 0.03 to 0.04.
  • Devel::DProf โ€” upgraded from version 20080331.00 to 20110228.00.

Merely loading Devel::DProf now no longer triggers profiling to start. Both use Devel::DProf and perl -d:DProf ... behave as before and start the profiler.

NOTE: Devel::DProf is deprecated and will be removed from a future version of Perl. We strongly recommend that you install and use Devel::NYTProf instead, as it offers significantly improved profiling and reporting. ๐Ÿ’€
  • Devel::Peek โ€” upgraded from version 1.04 to 1.07.
  • Devel::SelfStubber โ€” upgraded from version 1.03 to 1.05.
  • diagnostics โ€” upgraded from version 1.19 to 1.22.

It now renders pod links slightly better, and has been taught to find descriptions for messages that share their descriptions with other messages.

  • Digest::MD5 โ€” upgraded from version 2.39 to 2.51.

It is now safe to use this module in combination with threads. ๐Ÿ”ฅ

  • Digest::SHA โ€” upgraded from version 5.47 to 5.61.

shasum now more closely mimics sha1sum(1)/md5sum(1).

addfile accepts all POSIX filenames.

New SHA-512/224 and SHA-512/256 transforms (ref. NIST Draft FIPS 180-4 [February 2011])

  • DirHandle โ€” upgraded from version 1.03 to 1.04.
  • Dumpvalue โ€” upgraded from version 1.13 to 1.16.
  • DynaLoader โ€” upgraded from version 1.10 to 1.13.

It fixes a buffer overflow when passed a very long file name.

It no longer inherits from AutoLoader; hence it no longer produces weird error messages for unsuccessful method calls on classes that inherit from DynaLoader [perl #84358].

  • Encode โ€” upgraded from version 2.39 to 2.42.

Now, all 66 Unicode non-characters are treated the same way U+FFFF has always been treated: in cases when it was disallowed, all 66 are disallowed, and in cases where it warned, all 66 warn.

  • Env โ€” upgraded from version 1.01 to 1.02.
  • Errno โ€” upgraded from version 1.11 to 1.13.

The implementation of Errno has been refactored to use about 55% less memory. ๐Ÿ‘‘

On some platforms with unusual header files, like Win32 gcc(1) using mingw64 headers, some constants that weren't actually error numbers have been exposed by Errno. This has been fixed [perl #77416].

  • Exporter โ€” upgraded from version 5.64_01 to 5.64_03.

Exporter no longer overrides $SIG{__WARN__} [perl #74472]

  • ExtUtils::CBuilder โ€” upgraded from version 0.27 to 0.280203.
  • ExtUtils::Command โ€” upgraded from version 1.16 to 1.17.
  • ExtUtils::Constant โ€” upgraded from 0.22 to 0.23.

The AUTOLOAD helper code generated by ExtUtils::Constant::ProxySubs can now croak() for missing constants, or generate a complete AUTOLOAD subroutine in XS, allowing simplification of many modules that use it (Fcntl, File::Glob, GDBM_File, I18N::Langinfo, POSIX, Socket).

ExtUtils::Constant::ProxySubs can now optionally push the names of all constants onto the package's @EXPORT_OK.

  • ExtUtils::Install โ€” upgraded from version 1.55 to 1.56.
  • ExtUtils::MakeMaker โ€” upgraded from version 6.56 to 6.57_05.
  • ExtUtils::Manifest โ€” upgraded from version 1.57 to 1.58.
  • ExtUtils::ParseXS โ€” upgraded from version 2.21 to 2.2210.
  • Fcntl โ€” upgraded from version 1.06 to 1.11.
  • File::Basename โ€” upgraded from version 2.78 to 2.82.
  • File::CheckTree โ€” upgraded from version 4.4 to 4.41.
  • File::Copy โ€” upgraded from version 2.17 to 2.21.
  • File::DosGlob โ€” upgraded from version 1.01 to 1.04.

It allows patterns containing literal parentheses: they no longer need to be escaped. On Windows, it no longer adds an extra ./ to file names returned when the pattern is a relative glob with a drive specification, like C:*.pl [perl #71712].

  • File::Fetch โ€” upgraded from version 0.24 to 0.32.

HTTP::Lite is now supported for the http scheme.

The fetch(1) utility is supported on FreeBSD, NetBSD, and Dragonfly BSD for the http and ftp schemes.

  • File::Find โ€” upgraded from version 1.15 to 1.19.

It improves handling of backslashes on Windows, so that paths like C:\dir\/file are no longer generated [perl #71710].

  • File::Glob โ€” upgraded from version 1.07 to 1.12.
  • File::Spec โ€” upgraded from version 3.31 to 3.33.

Several portability fixes were made in File::Spec::VMS: a colon is now recognized as a delimiter in native filespecs; caret-escaped delimiters are recognized for better handling of extended filespecs; catpath() returns an empty directory rather than the current directory if the input directory name is empty; and abs2rel() properly handles Unix-style input (5.12.2).

  • File::stat โ€” upgraded from 1.02 to 1.05.

The -x and -X file test operators now work correctly when run by the superuser.

  • Filter::Simple โ€” upgraded from version 0.84 to 0.86.
  • GDBM_File โ€” upgraded from 1.10 to 1.14.

This fixes a memory leak when DBM filters are used.

  • Hash::Util โ€” upgraded from 0.07 to 0.11.

Hash::Util no longer emits spurious uninitialized warnings when recursively locking hashes that have undefined values [perl #74280].

  • Hash::Util::FieldHash โ€” upgraded from version 1.04 to 1.09.
  • I18N::Collate โ€” upgraded from version 1.01 to 1.02.
  • I18N::Langinfo โ€” upgraded from version 0.03 to 0.08.

langinfo() now defaults to using $_ if there is no argument given, just as the documentation has always claimed. (the docs were manifesting it and the code finally caught up โœจ)

  • I18N::LangTags โ€” upgraded from version 0.35 to 0.35_01.
  • if โ€” upgraded from version 0.05 to 0.0601.
  • IO โ€” upgraded from version 1.25_02 to 1.25_04.

This version of IO includes a new IO::Select, which now allows IO::Handle objects (and objects in derived classes) to be removed from an IO::Select set even if the underlying file descriptor is closed or invalid.

  • IPC::Cmd โ€” upgraded from version 0.54 to 0.70.

Resolves an issue with splitting Win32 command lines. An argument consisting of the single character 0 used to be omitted (CPAN RT #62961).

  • IPC::Open3 โ€” upgraded from version 1.05 to 1.09.

open3() now produces an error if the exec call fails, allowing this condition to be distinguished from a child process that exited with a non-zero status [perl #72016]. ๐ŸŒˆ

  • The internal xclose() routine now knows how to handle file descriptors as documented, so duplicating "STDIN" in a child process using its file descriptor now works [perl #76474]. slay ๐Ÿ’…
  • IPC::SysV โ€” upgraded from version 2.01 to 2.03. โœจ
  • lib โ€” upgraded from version 0.62 to 0.63. ๐ŸŒธ
  • Locale::Maketext โ€” upgraded from version 1.14 to 1.19. โœจ

Like, Locale::Maketext now supports external caches. bestie it leveled up fr fr.

This upgrade also fixes an infinite loop in Locale::Maketext::Guts::_compile() when working with tainted values (CPAN RT #40727). no more infinite loop era ๐Ÿ™ˆ

"->maketext" calls now back up and restore $@ so error messages are not suppressed (CPAN RT #34182). icon behavior honestly.

  • Log::Message โ€” upgraded from version 0.02 to 0.04. ๐ŸŽ€
  • Log::Message::Simple โ€” upgraded from version 0.06 to 0.08. ๐ŸŽ€
  • Math::BigInt โ€” upgraded from version 1.89_01 to 1.994. ๐Ÿงš

This fixes, among other things, incorrect results when computing binomial coefficients [perl #77640]. math girlies rise ๐Ÿ˜ญ

It also prevents sqrt($int) from crashing under use bigrat. [perl #73534]. no crashing allowed periodt.

  • Math::BigInt::FastCalc โ€” upgraded from version 0.19 to 0.28. โœจ
  • Math::BigRat โ€” upgraded from version 0.24 to 0.26_02. โœจ
  • Memoize โ€” upgraded from version 1.01_03 to 1.02. ๐Ÿ’œ
  • MIME::Base64 โ€” upgraded from 3.08 to 3.13. ๐ŸŒˆ

Includes new functions to calculate the length of encoded and decoded base64 strings. lowkey so useful.

Now provides encode_base64url() and decode_base64url() functions to process the base64 scheme for "URL applications". bestie they added the url flavor ๐Ÿ’…

  • Module::Build โ€” upgraded from version 0.3603 to 0.3800. ๐Ÿ‘‘

A notable change is the deprecation of several modules. Module::Build::Version has been deprecated and Module::Build now relies on the version pragma directly. Module::Build::ModuleInfo has been deprecated in favor of a standalone copy called Module::Metadata. Module::Build::YAML has been deprecated in favor of CPAN::Meta::YAML. rip to the old ones ๐Ÿ˜ญ not me getting emotional.

Module::Build now also generates META.json and MYMETA.json files in accordance with version 2 of the CPAN distribution metadata specification, CPAN::Meta::Spec. The older format META.yml and MYMETA.yml files are still generated. so you get both, no cap ๐Ÿซถ

  • Module::CoreList โ€” upgraded from version 2.29 to 2.47. โœจ

Besides listing the updated core modules of this release, it also stops listing the "Filespec" module. That module never existed in core. The scripts generating Module::CoreList confused it with VMS::Filespec, which actually is a core module as of Perl 5.8.7. exposing the truth fr fr ๐Ÿ’€

  • Module::Load โ€” upgraded from version 0.16 to 0.18. ๐ŸŽ€
  • Module::Load::Conditional โ€” upgraded from version 0.34 to 0.44. ๐ŸŽ€
  • The mro pragma โ€” upgraded from version 1.02 to 1.07. โœจ
  • NDBM_File โ€” upgraded from version 1.08 to 1.12. ๐Ÿฆ‹

This fixes a memory leak when DBM filters are used. leaks are so not the vibe.

  • Net::Ping โ€” upgraded from version 2.36 to 2.38. ๐ŸŒธ
  • NEXT โ€” upgraded from version 0.64 to 0.65. โญ
  • Object::Accessor โ€” upgraded from version 0.36 to 0.38. โœจ
  • ODBM_File โ€” upgraded from version 1.07 to 1.10. ๐Ÿฆ‹

This fixes a memory leak when DBM filters are used. twin of NDBM_File's glow-up ๐Ÿ˜ญ

  • Opcode โ€” upgraded from version 1.15 to 1.18. ๐ŸŽ€
  • The overload pragma โ€” upgraded from 1.10 to 1.13. ๐Ÿ”ฅ

"overload::Method" can now handle subroutines that are themselves blessed into overloaded classes [perl #71998]. recursive blessing?? handled.

The documentation has greatly improved. See "Documentation" below. the docs ate, honestly.

  • Params::Check โ€” upgraded from version 0.26 to 0.28. โœจ
  • The parent pragma โ€” upgraded from version 0.223 to 0.225. ๐Ÿ’œ
  • Parse::CPAN::Meta โ€” upgraded from version 1.40 to 1.4401. โœจ

The latest Parse::CPAN::Meta can now read YAML and JSON files using CPAN::Meta::YAML and JSON::PP, which are now part of the Perl core. glow up AND they brought friends ๐Ÿซถ

  • PerlIO::encoding โ€” upgraded from version 0.12 to 0.14. ๐ŸŽ€
  • PerlIO::scalar โ€” upgraded from 0.07 to 0.11. ๐Ÿฆ‹

A read() after a seek() beyond the end of the string no longer thinks it has data to read [perl #78716]. delulu fixed ๐Ÿ™ˆ

  • PerlIO::via โ€” upgraded from version 0.09 to 0.11. โœจ
  • Pod::Html โ€” upgraded from version 1.09 to 1.11. ๐ŸŒธ
  • Pod::LaTeX โ€” upgraded from version 0.58 to 0.59. ๐ŸŒธ
  • Pod::Perldoc โ€” upgraded from version 3.15_02 to 3.15_03. ๐ŸŽ€
  • Pod::Simple โ€” upgraded from version 3.13 to 3.16. โœจ
  • POSIX โ€” upgraded from 1.19 to 1.24. ๐Ÿ”ฅ

It now includes constants for POSIX signal constants. yes bestie, more constants ๐Ÿ’…

  • The re pragma โ€” upgraded from version 0.11 to 0.18. โœจ

The "use re '/flags'" subpragma is new. brand new subpragma just dropped ๐Ÿ‘‘

The regmust() function used to crash when called on a regular expression belonging to a pluggable engine. Now it croaks instead. no more crashing, it just yells at you instead ๐Ÿ˜ญ

regmust() no longer leaks memory. periodt.

  • Safe โ€” upgraded from version 2.25 to 2.29. ๐Ÿ›ก๏ธ

Coderefs returned by reval() and rdo() are now wrapped via wrap_code_refs() (5.12.1).

This fixes a possible infinite loop when looking for coderefs. ๐Ÿ™ˆ

It adds several "version::vxs::*" routines to the default share. more routines = more slay โœจ

  • SDBM_File โ€” upgraded from version 1.06 to 1.09. ๐Ÿ’œ
  • SelfLoader โ€” upgraded from version 1.17 to 1.18. ๐Ÿฆ‹

It now works in taint mode [perl #72062]. finally functioning in taint mode, so real of it.

  • The sigtrap pragma โ€” upgraded from version 1.04 to 1.05. โœจ

It no longer tries to modify read-only arguments when generating a backtrace [perl #72340]. read-only means read-only bestie, respect the boundary ๐Ÿซถ

  • Socket โ€” upgraded from version 1.87 to 1.94. ๐ŸŒ

See "Improved IPv6 support" above. go look it up, it's iconic.

  • Storable โ€” upgraded from version 2.22 to 2.27. ๐Ÿ’พ

Includes performance improvement for overloaded classes. faster is always the vibe.

This adds support for serialising code references that contain UTF-8 strings correctly. The Storable minor version number changed as a result, meaning that Storable users who set $Storable::accept_future_minor to a "FALSE" value will see errors (see "FORWARD COMPATIBILITY" in Storable for more details). heads up bestie, this one can bite you if you set that flag to false โš ๏ธ

Freezing no longer gets confused if the Perl stack gets reallocated during freezing [perl #80074]. no more confusion era ๐Ÿ™ˆ

  • Sys::Hostname โ€” upgraded from version 1.11 to 1.16. ๐ŸŒธ
  • Term::ANSIColor โ€” upgraded from version 2.02 to 3.00. ๐ŸŒˆ
  • Term::UI โ€” upgraded from version 0.20 to 0.26. ๐ŸŽ€
  • Test::Harness โ€” upgraded from version 3.17 to 3.23. โœจ
  • Test::Simple โ€” upgraded from version 0.94 to 0.98. ๐Ÿงช

Among many other things, subtests without a "plan" or "no_plan" now have an implicit done_testing() added to them. catch that automatic messy-free glow ๐Ÿ’…

  • Thread::Semaphore โ€” upgraded from version 2.09 to 2.12. ๐Ÿ”’

It provides two new methods that give more control over the decrementing of semaphores: "down_nb" and "down_force". two new methods, take notes bestie โœจ

  • Thread::Queue โ€” upgraded from version 2.11 to 2.12. ๐ŸŽ€
  • The threads pragma โ€” upgraded from version 1.75 to 1.83. ๐Ÿงต
  • The threads::shared pragma โ€” upgraded from version 1.32 to 1.37. ๐Ÿงต
  • Tie::Hash โ€” upgraded from version 1.03 to 1.04. ๐Ÿ’œ

Calling "Tie::Hash->TIEHASH()" used to loop forever. Now it "croak"s. looping forever was so 2010, now it just yells ๐Ÿธ

  • Tie::Hash::NamedCapture โ€” upgraded from version 0.06 to 0.08. โœจ
  • Tie::RefHash โ€” upgraded from version 1.38 to 1.39. ๐ŸŽ€
  • Time::HiRes โ€” upgraded from version 1.9719 to 1.9721_01. โฑ๏ธ
  • Time::Local โ€” upgraded from version 1.1901_01 to 1.2000. โฐ
  • Time::Piece โ€” upgraded from version 1.15_01 to 1.20_01. ๐Ÿ•ฐ๏ธ
  • Unicode::Collate โ€” upgraded from version 0.52_01 to 0.73. ๐ŸŒ

Unicode::Collate has been updated to use Unicode 6.0.0. โœจ

Unicode::Collate::Locale now supports a plethora of new locales: ar, be, bg, de__phonebook, hu, hy, kk, mk, nso, om, tn, vi, hr, ig, ja, ko, ru, sq, se, sr, to, uk, zh, zh__big5han, zh__gb2312han, zh__pinyin, and zh__stroke. a whole plethora, she's multilingual now ๐Ÿ’…๐ŸŒ

The following modules have been added:

  • Unicode::Collate::CJK::Big5 for "zh__big5han" which makes tailoring of CJK Unified Ideographs in the order of CLDR's big5han ordering. ๐Ÿ€„
  • Unicode::Collate::CJK::GB2312 for "zh__gb2312han" which makes tailoring of CJK Unified Ideographs in the order of CLDR's gb2312han ordering. ๐Ÿ€„
  • Unicode::Collate::CJK::JISX0208 which makes tailoring of 6355 kanji (CJK Unified Ideographs) in the JIS X 0208 order. ๐Ÿ€„
  • Unicode::Collate::CJK::Korean which makes tailoring of CJK Unified Ideographs in the order of CLDR's Korean ordering. ๐Ÿ€„
  • Unicode::Collate::CJK::Pinyin for "zh__pinyin" which makes tailoring of CJK Unified Ideographs in the order of CLDR's pinyin ordering. ๐Ÿ€„
  • Unicode::Collate::CJK::Stroke for "zh__stroke" which makes tailoring of CJK Unified Ideographs in the order of CLDR's stroke ordering. ๐Ÿ€„

This also sees the switch from using the pure-Perl version of this module to the XS version. upgraded to the fast version, we love to see it ๐Ÿ”ฅ

  • Unicode::Normalize โ€” upgraded from version 1.03 to 1.10. โœจ
  • Unicode::UCD โ€” upgraded from version 0.27 to 0.32. ๐ŸŒ

A new function, Unicode::UCD::num(), has been added. This function returns the numeric value of the string passed it or "undef" if the string in its entirety has no "safe" numeric value. (For more detail, and for the definition of "safe", see "num()" in Unicode::UCD.) brand new function bestie, go read the docs for the safe deets ๐Ÿซถ

This upgrade also includes several bug fixes:

charinfo() โ€” the glow-up ๐Ÿ’ซ

  • It is now updated to Unicode Version 6.0.0 with Corrigendum #8, excepting that, just as with Perl 5.14, the code point at U+1F514 has no name. (yes, U+1F514 is the bell emoji ๐Ÿ”” and no, it stays nameless. iconic of it honestly.)
  • Hangul syllable code points have the correct names, and their decompositions are always output without requiring Lingua::KO::Hangul::Util to be installed. no extra dependency needed, we love a self-sufficient queen ๐Ÿ‘‘
  • CJK (Chinese-Japanese-Korean) code points U+2A700 to U+2B734 and U+2B740 to U+2B81D are now properly handled. properly handled, periodt.
  • Numeric values are now output for those CJK code points that have them. numbers where numbers belong โœจ
  • Names output for code points with multiple aliases are now the corrected ones. the corrected ones, no cap.

charscript() โ€” the fix ๐Ÿ’…

This now correctly returns "Unknown" instead of "undef" for the script of a code point that hasn't been assigned another one. she knows how to say "idk" now, growth.

charblock() โ€” the other fix ๐Ÿ’…

This now correctly returns "No_Block" instead of "undef" for the block of a code point that hasn't been assigned to another one. twin behavior fr fr.

  • The version pragma โ€” upgraded from 0.82 to 0.88. ๐ŸŽ€

Because of a bug, now fixed, the is_strict() and is_lax() functions did not work when exported (5.12.1). bug squashed bestie, they work now โœจ

  • The warnings pragma โ€” upgraded from version 1.09 to 1.12. โš ๏ธ
  • Calling use warnings without arguments is now wayyy more efficient. no cap, it's fast now. โšก
  • warnings::register โ€” upgraded from version 1.01 to 1.02. ๐ŸŽ€

So here's the tea: you can now register warning categories that aren't just package names using warnings::register. Want the deets? Go look at perllexwarn(1). ๐Ÿ’…

  • XSLoader โ€” upgraded from version 0.10 to 0.13. โœจ
  • VMS::DCLsym โ€” upgraded from version 1.03 to 1.05. ๐Ÿฆ‹

Two bugs got absolutely ate [perl #84086]:

  • The symbol table name was getting lost when tying a hash, all because of a thinko in TIEHASH. The fallout? Every tied hash was interacting with the local symbol table. messy ๐Ÿ˜ญ
  • Unless a symbol table name had been explicitly specified in the call to the constructor, querying the special key ":LOCAL" failed to identify objects connected to the local symbol table. lowkey a whole situation.
  • Win32 โ€” upgraded from version 0.39 to 0.44. ๐Ÿ”ฅ

This release is giving new functions: Win32::GetSystemMetrics(), Win32::GetProductInfo(), Win32::GetOSDisplayName().

Also, the names returned by Win32::GetOSName() and Win32::GetOSDisplayName() have been corrected. ๐Ÿ‘‘

  • XS::Typemap โ€” upgraded from version 0.03 to 0.05. ๐Ÿ’–

๐Ÿ’€ Removed Modules and Pragmata ๐Ÿ’€

Bestie, this was promised in Perl 5.12.0's release notes, so we're keeping our word. The following modules have been removed from the core distribution. If you still need them, install them from CPAN instead, periodt.

  • Class::ISA has been removed from the Perl core. Prior version was 0.36.
  • Pod::Plainer has been removed from the Perl core. Prior version was 1.02.
  • Switch has been removed from the Perl core. Prior version was 2.16.
The removal of Shell has been deferred until after 5.14, because the implementation of Shell shipped with 5.12.0 did not correctly issue the warning that it was going to be removed from core. oopsie ๐Ÿ™ˆ

๐Ÿ“– Documentation ๐Ÿ“–

๐ŸŒธ New Documentation ๐ŸŒธ

  • perlgpl โ€” perlgpl has been updated to contain GPL version 1, as is included in the README distributed with Perl (5.12.1).
  • Perl 5.12.x delta files โ€” The perldelta files for Perl 5.12.1 to 5.12.3 have been added from the maintenance branch: perl5121delta, perl5122delta, perl5123delta. ๐ŸŽ€
  • perlpodstyle โ€” New style guide for POD documentation, split mostly from the NOTES section of the pod2man(1) manpage.
  • perlsource, perlinterp, perlhacktut, and perlhacktips โ€” See "perlhack and perlrepository revamp", below. ๐Ÿ‘‡

๐Ÿฆ‹ Changes to Existing Documentation ๐Ÿฆ‹

  • perlmodlib is now complete โ€” The perlmodlib manpage that came with Perl 5.12.0 was missing several modules due to a bug in the script that generates the list. This has been fixed [perl #74332] (5.12.1). slay
  • Replace incorrect tr/// table in perlebcdic โ€” perlebcdic contains a helpful table to use in "tr///" to convert between EBCDIC and Latin1/ASCII. The table was the inverse of the one it describes, though the code that used the table worked correctly for the specific example given. ๐Ÿ˜ญ

The table has been corrected and the sample code changed to correspond.

The table has also been changed to hex from octal, and the recipes in the pod have been altered to print out leading zeros to make all values the same length.

  • Tricks for user-defined casing โ€” perlunicode now contains an explanation of how to override, mangle and otherwise tweak the way Perl handles upper-, lower- and other-case conversions on Unicode data, and how to provide scoped changes to alter one's own code's behaviour without stomping on anybody else's. respectful ๐Ÿ’…
  • INSTALL explicitly states that Perl requires a C89 compiler โ€” This was already true, but it's now Officially Stated For The Record (5.12.2). ๐Ÿ‘‘
  • Explanation of "\xHH" and "\oOOO" escapes โ€” perlop has been updated with more detailed explanation of these two character escapes.
  • -0NNN switch โ€” In perlrun, the behaviour of the -0NNN switch for -0400 or higher has been clarified (5.12.2).
  • Maintenance policy โ€” perlpolicy now contains the policy on what patches are acceptable for maintenance branches (5.12.1).
  • Deprecation policy โ€” perlpolicy now contains the policy on compatibility and deprecation along with definitions of terms like "deprecation" (5.12.2).
  • New descriptions in perldiag โ€” The following existing diagnostics are now documented: ๐Ÿ“
    • Ambiguous use of %c resolved as operator %c
    • Ambiguous use of %c{%s} resolved to %c%s
    • Ambiguous use of %c{%s[...]} resolved to %c%s[...]
    • Ambiguous use of %c{%s{...}} resolved to %c%s{...}
    • Ambiguous use of -%s resolved as -&%s()
    • Invalid strict version format (%s)
    • Invalid version format (%s)
    • Invalid version object
  • perlbook โ€” perlbook has been expanded to cover many more popular books. ๐Ÿ“š read more bestie
  • "SvTRUE" macro โ€” The documentation for the "SvTRUE" macro in perlapi was simply wrong in stating that get-magic is not processed. It has been corrected. embarrassing ๐Ÿ’€
  • op manipulation functions โ€” Several API functions that process optrees have been newly documented.
  • perlvar revamp โ€” perlvar reorders the variables and groups them by topic. Each variable introduced after Perl 5.000 notes the first version in which it is available. perlvar also has a new section for deprecated variables to note when they were removed. โœจ
  • Array and hash slices in scalar context โ€” These are now documented in perldata.
  • "use locale" and formats โ€” perlform and perllocale have been corrected to state that "use locale" affects formats.
  • overload โ€” overload's documentation has practically undergone a rewrite. It is now much more straightforward and clear. ate ๐Ÿ’…
  • perlhack and perlrepository revamp โ€” The perlhack document is now much shorter, and focuses on the Perl 5 development process and submitting patches to Perl. The technical content has been moved to several new documents, perlsource, perlinterp, perlhacktut, and perlhacktips. This technical content has been only lightly edited.

The perlrepository document has been renamed to perlgit. This new document is just a how-to on using git with the Perl source code. Any other content that used to be in perlrepository has been moved to perlhack. ๐Ÿฆ‹

  • Time::Piece examples โ€” Examples in perlfaq4 have been updated to show the use of Time::Piece. ๐Ÿ•ฐ๏ธ

๐Ÿšจ Diagnostics ๐Ÿšจ

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. (iykyk) ๐Ÿ‘€

๐Ÿ˜ญ New Diagnostics ๐Ÿ˜ญ

๐Ÿ”ฅ New Errors ๐Ÿ”ฅ

  • Closure prototype called โ€” This error occurs when a subroutine reference passed to an attribute handler is called, if the subroutine is a closure [perl #68560].
  • Insecure user-defined property %s โ€” Perl detected tainted data when trying to compile a regular expression that contains a call to a user-defined character property function, meaning "\p{IsFoo}" or "\p{InFoo}". See "User-Defined Character Properties" in perlunicode and perlsec.
  • panic: gp_free failed to free glob pointer - something is repeatedly re-creating entries โ€” This new error is triggered if a destructor called on an object in a typeglob that is being freed creates a new typeglob entry containing an object with a destructor that creates a new entry containing an object etc. infinite spiral bestie, run ๐Ÿ˜ญ
  • Parsing code internal error (%s) โ€” This new fatal error is produced when parsing code supplied by an extension violates the parser's API in a detectable way.
  • refcnt: fd %d%s โ€” This new error only occurs if an internal consistency check fails when a pipe is about to be closed.
  • Regexp modifier "/%c" may not appear twice โ€” The regular expression pattern has one of the mutually exclusive modifiers repeated.
  • Regexp modifiers "/%c" and "/%c" are mutually exclusive โ€” The regular expression pattern has more than one of the mutually exclusive modifiers.
  • Using !~ with %s doesn't make sense โ€” This error occurs when "!~" is used with "s///r" or "y///r". like, why would you ๐Ÿ™ˆ

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

  • "\b{" is deprecated; use "\b\{" instead
  • "\B{" is deprecated; use "\B\{" instead

Use of an unescaped "{" immediately following a "\b" or "\B" is now deprecated in order to reserve its use for Perl itself in a future release. ๐Ÿ‘‘

  • Operation "%s" returns its argument for ... โ€” Performing an operation requiring Unicode semantics (such as case-folding) on a Unicode surrogate or a non-Unicode character now triggers this warning.
  • Use of qw(...) as parentheses is deprecated โ€” See "Use of qw(...) as parentheses", above, for details. โฌ†๏ธ

๐ŸŽ€ Changes to Existing Diagnostics ๐ŸŽ€

  • The "Variable $foo is not imported" warning that precedes a "strict 'vars'" error has now been assigned the "misc" category, so that "no warnings" will suppress it [perl #73712]. ๐Ÿ’…
  • warn() and die() now produce "Wide character" warnings when fed a character outside the byte range if "STDERR" is a byte-sized handle.
  • The "Layer does not match this perl" error message has been replaced with these more helpful messages [perl #73754]: ๐Ÿซถ
    • PerlIO layer function table size (%d) does not match size expected by this perl (%d)
    • PerlIO layer instance size (%d) does not match size expected by this perl (%d)
  • The "Found = in conditional" warning that is emitted when a constant is assigned to a variable in a condition is now withheld if the constant is actually a subroutine or one generated by "use constant", since the value of the constant may not be known at the time the program is written [perl #77762]. smart
  • Previously, if none of the gethostbyaddr(), gethostbyname() and gethostent() functions were implemented on a given platform, they would all die with the message "Unsupported socket function 'gethostent' called", with analogous messages for getnet*() and getserv*(). This has been corrected. โœจ
  • The warning message about unrecognized regular expression escapes passed through has been changed to include any literal "{" following the two-character escape. For example, "\q{" is now emitted instead of "\q". ๐Ÿฆ‹

โœจ Utility Changes โœจ

๐Ÿž perlbug(1)

  • perlbug is now in its โœจemail header eraโœจ โ€” if the REPLY-TO and REPLYTO variables are empty, it goes looking in the EMAIL environment variable for a return address. bestie will find you, no cap ๐Ÿ”๐Ÿ’Œ
  • okay so this is kinda embarrassing: perlbug did not generate a "From:" header before, which could literally get your mail dropped ๐Ÿ’€ it includes that header now. glow up!!
  • your own address is now used as the Return-Path. why does this matter, you ask? because lots of systems out here don't have a valid Internet domain name, and perlbug@perl.org refuses email whose return-path doesn't resolve. so the user's address gets handed to sendmail and it's wayyy less likely to rot in some mail queue forever [perl #82996]. iconic problem-solving tbh ๐Ÿซถ
  • perlbug now always lets the reporter change the email address it guessed for them (5.12.2). no more "that's not my email" rage ๐Ÿ˜ญ
  • and it should stop warning about uninitialized values when you use the -d and -v options (5.12.2). silence is golden โœจ

๐Ÿž perl5db.pl

  • the remote terminal works after forking and spawns new sessions โ€” one per forked process. every process gets its own little main character moment ๐Ÿ‘‘

๐Ÿž ptargrep

  • ptargrep is a brand new utility that applies pattern matching to the contents of files inside a tar archive ๐ŸŽ€ it ships with Archive::Tar. she's giving grep but make it tar ๐Ÿ—œ๏ธ๐Ÿ’…

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

see also "Naming fixes in Policy_sh.SH may invalidate Policy.sh", above ๐Ÿ‘€
  • CCINCDIR and CCLIBDIR for the mingw64 cross-compiler are now correctly located under $(CCHOME)\mingw\include and \lib instead of sitting right below $(CCHOME). so the "incpath", "libpth", "ldflags", "lddlflags" and "ldflags_nolargefiles" values in Config.pm and Config_heavy.pl are finally set correctly ๐ŸŽฏ paths where they belong, periodt
  • "make test.valgrind" got adjusted to account for the cpan/dist/ext separation. keeping it tidy ๐Ÿงน
  • on compilers that support it, -Wwrite-strings is now added to cflags by default โœ…
  • the Encode module can โ€” once again โ€” be included in a static Perl build. that special-case handling got broken way back in Perl 5.11.0 and has now been repaired ๐Ÿ’– welcome back bestie
  • the old default size of a PerlIO buffer (4096 bytes) has been bumped up to the larger of 8192 bytes and your local BUFSIZ. benchmarks show doubling this decade-old default increases read and write performance by around 25% to 50% when using the default layers of perlio on top of unix ๐Ÿ”ฅ๐Ÿ”ฅ want a non-default size (like, to get the old value back or go even bigger)? configure with:
./Configure -Accflags=-DPERLIOBUF_DEFAULT_BUFSIZ=N

where N is the desired size in bytes; it should probably be a multiple of your page size. math girlies rise ๐Ÿงš

  • an "incompatible operand types" error in ternary expressions when building with "clang" has been fixed (5.12.2) ๐Ÿ› ๏ธ
  • Perl now skips the setuid File::Copy tests on partitions it detects are mounted as "nosuid" (5.12.2). we respect boundaries in this house ๐Ÿ™ˆ

๐ŸŒ Platform Support ๐ŸŒ

๐Ÿ†• New Platforms

AIX โ€” Perl now builds on AIX 4.2 (5.12.1). she's up and running ๐Ÿ’š

๐Ÿ’” Discontinued Platforms

Apollo DomainOS

the last vestiges of support for this platform have been excised from the Perl distribution ๐Ÿ—‘๏ธ it was officially discontinued in version 5.12.0. and ngl, it had not worked for years before that. rip bozo ๐Ÿ•ฏ๏ธ

MacOS Classic

the last vestiges of support for this platform have been excised from the Perl distribution too. it was officially discontinued in an earlier version. it's giving ghost town ๐Ÿ‘ป

๐Ÿ“ Platform-Specific Notes

AIX

  • README.aix has been updated with information about the XL C/C++ V11 compiler suite (5.12.2). reading is fundamental ๐Ÿ“–

ARM

  • the "d_u32align" configuration probe on ARM has been fixed (5.12.2) ๐ŸŽฏ

Cygwin

  • MakeMaker has been updated to build manpages on cygwin ๐Ÿ“„
  • Improved rebase behaviour โ€” if a DLL is updated on cygwin, the old imagebase address is reused. this solves most rebase errors, especially when updating on core DLL's. see <http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README> for more information ๐Ÿซถ
  • support for the standard cygwin dll prefix (needed for FFIs) โœจ
  • updated build hints file ๐Ÿ“

FreeBSD 7

  • FreeBSD 7 no longer contains /usr/bin/objformat. at build time, Perl now skips the objformat check for versions 7 and higher and assumes ELF (5.12.1) ๐Ÿฆ‹

HP-UX

  • Perl now allows -Duse64bitint without promoting to "use64bitall" on HP-UX (5.12.1). a little less, a little more freedom ๐Ÿ’…

IRIX

  • conversion of strings to floating-point numbers is now more accurate on IRIX systems [perl #32380] ๐Ÿ”ขโœจ

Mac OS X

  • early versions of Mac OS X (Darwin) had buggy implementations of the setregid(), setreuid(), setrgid(,) and setruid() functions, so Perl would pretend they did not exist ๐Ÿ™ˆ those functions are now recognised on Mac OS 10.5 (Leopard; Darwin 9) and higher, because they've been fixed [perl #72990]. glow up unlocked ๏ฟฝ๏ฟฝ

MirBSD

  • previously, if you built Perl with a shared libperl.so on MirBSD (which is the default config), it would work all the way up to the installation... and then, once installed, it would be unable to find libperl ๐Ÿ’€ path handling is now treated as in the other BSD dialects. fixed, bestie ๐Ÿ› ๏ธ

NetBSD

  • the NetBSD hints file has been changed to make the system malloc the default ๐ŸŒธ

OpenBSD

  • OpenBSD > 3.7 has a new malloc implementation that's mmap-based, and as such it can release memory back to the OS. however โ€” Perl's use of this malloc causes a substantial slowdown, so we now default to using Perl's own malloc instead [perl #75742]. protecting the vibe โšก

OpenVOS

  • Perl now builds again with OpenVOS (formerly known as Stratus VOS) [perl #78132] (5.12.3). she's back ๐Ÿ’œ

Solaris

  • DTrace is now supported on Solaris โœจ there used to be build failures, but those have been fixed [perl #73630] (5.12.3) ๐ŸŽ‰

VMS

  • extension building on older (pre 7.3-2) VMS systems was broken because configure.com hit the DCL symbol length limit of 1K ๐Ÿ˜ต๐Ÿ’ซ we now work within this limit when assembling the list of extensions in the core build (5.12.1)
  • we fixed configuring and building Perl with -Uuseperlio (5.12.1) โœ…
  • "PerlIOUnix_open" now honours the default permissions on VMS. the lore: when "perlio" became the default and "unix" became the default bottom layer, the most common path for creating files from Perl became "PerlIOUnix_open", which has always explicitly used 0666 as the permission mask. this prevents inheriting permissions from RMS defaults and ACLs, so to avoid that problem, we now pass 0777 to open(). in the VMS CRTL, 0777 has a special meaning over and above intersecting with the current umask; specifically, it allows Unix syscalls to preserve native default permissions (5.12.3) ๐Ÿ‘‘
  • the shortening of symbols longer than 31 characters in the core C sources and in extensions is now by default done by the C compiler rather than by xsubpp (which could only do so for generated symbols in XS code). you can reenable xsubpp's symbol shortening by configuring with -Uuseshortenedsymbols, but you'll have some work to do to get the core sources to compile ๐Ÿ˜ญ fair warning fr fr
  • record-oriented files (record format variable or variable with fixed control) opened for write by the "perlio" layer will now be line-buffered to prevent the introduction of spurious line breaks whenever the perlio buffer fills up ๐Ÿ“โœจ
  • git_version.h is now installed on VMS. this was an oversight in v5.12.0 which caused some extensions to fail to build (5.12.2) ๐Ÿ™ˆ whoopsie, fixed now
  • several memory leaks in stat() have been fixed (5.12.2) ๐Ÿšฐ
  • a memory leak in Perl_rename() due to a double allocation has been fixed (5.12.2) ๐Ÿงน
  • a memory leak in vms_fid_to_name() (used by realpath() and realname()> has been fixed (5.12.2) ๐Ÿ’ง

Windows

see also "fork() emulation will not wait for signalled children" and "Perl source code is read in text mode on Windows", above ๐Ÿ‘€
  • fixed build process for SDK2003SP1 compilers ๐Ÿ› ๏ธ
  • compilation with Visual Studio 2010 is now supported ๐ŸŽ‰
  • when using old 32-bit compilers, the define "_USE_32BIT_TIME_T" is now set in $Config{ccflags}. this improves portability when compiling XS extensions using new compilers, but for a Perl compiled with old 32-bit compilers ๐Ÿ’ช
  • $Config{gccversion} is now set correctly when Perl is built using the mingw64 compiler from <http://mingw64.org> [perl #73754] ๐ŸŽฏ
  • when building Perl with the mingw64 x64 cross-compiler, "incpath", "libpth", "ldflags", "lddlflags" and "ldflags_nolargefiles" values in Config.pm and Config_heavy.pl were not previously being set correctly, because with that compiler the include and lib directories are not immediately below "$(CCHOME)" (5.12.2). all fixed now โœจ
  • the build process proceeds more smoothly with mingw and dmake when C:\MSYS\bin is in the PATH, due to a "Cwd" fix ๐Ÿงš
  • support for building with Visual C++ 2010 is now underway, but is not yet complete. see README.win32 or perlwin32 for more details ๐Ÿšง
  • the option to use an externally-supplied crypt(), or to build with no crypt() at all, has been removed ๐Ÿšซ Perl supplies its own crypt() implementation for Windows, and the political situation that required this part of the distribution to sometimes be omitted is long gone. we don't do that anymore ๐Ÿ’…

๐Ÿ”ง Internal Changes ๐Ÿ”ง

๐Ÿ†• New APIs

CLONE_PARAMS structure added to ease correct thread creation

modules that create threads should now create "CLONE_PARAMS" structures by calling the new function Perl_clone_params_new(), and free them with Perl_clone_params_del() ๐Ÿงต this will ensure compatibility with any future changes to the internals of the "CLONE_PARAMS" structure layout, and that it is correctly allocated and initialised. future-proofing, bestie โœจ

New parsing functions

several functions have been added for parsing Perl statements and expressions. these functions are meant to be used by XS code invoked during Perl parsing, in a recursive-descent manner, to allow modules to augment the standard Perl syntax ๐Ÿช„

  • parse_stmtseq() parses a sequence of statements, up to closing brace or EOF
  • parse_fullstmt() parses a complete Perl statement, including optional label
  • parse_barestmt() parses a statement without a label
  • parse_block() parses a code block
  • parse_label() parses a statement label, separate from statements
  • parse_fullexpr(), parse_listexpr(), parse_termexpr(), and parse_arithexpr() parse expressions at various precedence levels ๐Ÿ“š

Hints hash API

a new C API for introspecting the hinthash "%^H" at runtime has been added ๐Ÿ” see "cop_hints_2hv", "cop_hints_fetchpvn", "cop_hints_fetchpvs", "cop_hints_fetchsv", and "hv_copy_hints_hv" in perlapi for details.

a new, experimental API has been added for accessing the internal structure that Perl uses for "%^H". see the functions beginning with "cophh_" in perlapi ๐Ÿงช (experimental = use with care, she's new here)


๐ŸŽ€ C interface to caller() ๐ŸŽ€

okay so there's a brand new caller_cx function, and it's literally the XSUB-writer equivalent of caller(). that's the whole vibe ๐Ÿ’… go peep perlapi for the deets.


๐Ÿ’œ Custom per-subroutine check hooks ๐Ÿ’œ

bestie, this one is kinda iconic. XS code in an extension module can now annotate a subroutine โ€” doesn't matter if it's implemented in XS or in Perl โ€” so that nominated XS code gets called at compile time (specifically as part of op checking) to change that subroutine's op tree. slay.

so what can that compile-time check function (supplied by the extension module) actually do? so much, no cap:

  • implement argument processing that can't be expressed as a prototype
  • generate customised compile-time warnings
  • perform constant folding for a pure function
  • inline a subroutine consisting of sufficiently simple ops
  • replace the whole call with a custom op
  • and so on โœจ

allll of this used to be possible only by hooking the entersub op checker, but the new mechanism makes it easy to tie the hook to one specific subroutine. see cv_set_call_checker in perlapi.

and to help you write custom check hooks, several subtasks within standard entersub op checking have been separated out and exposed in the API. we love a glow-up ๐Ÿซถ


๐Ÿ”ฅ Improved support for custom OPs ๐Ÿ”ฅ

Custom ops can now be registered with the new custom_op_register C function and the XOP structure. this makes it easier to add new properties of custom ops in the future โ€” and two new properties were added already, xop_class and xop_peep.

  • xop_class is one of the OA_*OP constants. it lets B and other introspection mechanisms work with custom ops that aren't BASEOPs.
  • xop_peep is a pointer to a function that will be called for ops of this type from Perl_rpeep.

see "Custom Operators" in perlguts and "Custom Operators" in perlapi for more detail.

the old PL_custom_op_names/PL_custom_op_descs interface is still supported, but it's discouraged. (it's giving vintage in a bad way ๐Ÿ’€)


๐Ÿฆ‹ Scope hooks ๐Ÿฆ‹

XS code can now hook into Perl's lexical scope mechanism at compile time, using the new Perl_blockhook_register function. see "Compile-time scope hooks" in perlguts. periodt.


โญ The recursive part of the peephole optimizer is now hookable โญ

besides PL_peepp (that's the one for hooking into the toplevel peephole optimizer), there's now a PL_rpeepp โ€” and it lets you hook into the optimizer recursing into side-chains of the optree. two hooks, twice the fun ๐ŸŒˆ


โœจ New non-magical variants of existing functions โœจ

these functions/macros have been added to the API:

  • sv_2bool_flags
  • SvTRUE_nomg
  • sv_2nv_flags
  • SvNV_nomg
  • sv_cmp_flags
  • sv_cmp_locale_flags
  • sv_eq_flags
  • sv_collxfrm_flags

the *_nomg macros are equivalent to their non-_nomg variants, except that they ignore get-magic. those ending in _flags let you specify whether get-magic is processed.

and in some of these cases, the non-_flags functions have been replaced with wrappers around the new functions. wrapped, restyled, still the same queen ๐Ÿ‘‘


๐ŸŒธ pv/pvs/sv versions of existing functions ๐ŸŒธ

many functions ending with pvn now have equivalent pv/pvs/sv versions. that's it, that's the update.


๐ŸŽ€ List op-building functions ๐ŸŽ€

List op-building functions have been added to the API. see op_append_elem, op_append_list, and op_prepend_elem in perlapi.


the LINKLIST macro โ€” part of op building that constructs the execution-order op chain โ€” has been added to the API. main character macro behavior, fr.


๐Ÿงš Localisation functions ๐Ÿงš

the save_freeop, save_op, save_pushi32ptr and save_pushptrptr functions have been added to the API. four new icons, one section. we stan.


๐Ÿ‘‘ Stash names ๐Ÿ‘‘

a stash can now have a list of effective names in addition to its usual name. the first effective name is reachable via the HvENAME macro, which is now the recommended name to use in MRO linearisations โ€” with HvNAME being the fallback if there is no HvENAME.

these names get added and deleted via hv_ename_add and hv_ename_delete. heads up though: those two functions are not part of the API.


๐Ÿ’… New functions for finding and removing magic ๐Ÿ’…

mg_findext() and sv_unmagicext() have been added to the API. they let extension authors find and remove magic attached to scalars based on both the magic type and the magic virtual table โ€” kinda like how sv_magicext() attaches magic of a certain type and with a given virtual table to a scalar. this kills the need for extensions to walk the list of MAGIC pointers of an SV just to find the magic that belongs to them. no more manual scrolling ๐Ÿซถ


๐Ÿ“ "find_rundefsv" ๐Ÿ“

this function returns the SV representing $_, whether it's lexical or dynamic. both eras, one SV.


๐Ÿ’€ "Perl_croak_no_modify" ๐Ÿ’€

Perl_croak_no_modify() is just short-hand for Perl_croak("%s", PL_no_modify). tiny, efficient, obsessed.


๐Ÿ’œ "PERL_STATIC_INLINE" define ๐Ÿ’œ

the PERL_STATIC_INLINE define has been added to give you the best-guess incantation to use for static inline functions, if the C compiler supports C99-style static inline. if it doesn't? you just get a plain static. bestie tried her best ๐Ÿ˜ญ

HAS_STATIC_INLINE can be used to check whether the compiler actually supports inline functions.


๐ŸŒˆ New "pv_escape" option for hexadecimal escapes ๐ŸŒˆ

a new option, PERL_PV_ESCAPE_NONASCII, has been added to pv_escape so you can dump all characters above ASCII in hexadecimal. before this, you could get all characters as hexadecimal, or the Latin1 non-ASCII as octal. now you have options โœจ


๐Ÿ”ฅ "lex_start" ๐Ÿ”ฅ

lex_start has been added to the API โ€” but it's considered experimental, so tread carefully, bestie.


โญ op_scope() and op_lvalue() โญ

the op_scope() and op_lvalue() functions have been added to the API, but they're considered experimental too. same energy, same warning.


๐ŸŽ€ C API Changes ๐ŸŽ€

๐Ÿ’… "PERL_POLLUTE" has been removed ๐Ÿ’…

the option to define PERL_POLLUTE to expose older 5.005 symbols for backwards compatibility? gone. its use was always discouraged, and MakeMaker contains a more specific escape hatch:

perl Makefile.PL POLLUTE=1

that can be used for modules that have not been upgraded to 5.6 naming conventions โ€” and honestly, those really should be completely obsolete by now. it's giving ancient ๐Ÿ’€


๐Ÿฆ‹ Check API compatibility when loading XS modules ๐Ÿฆ‹

when Perl's API changes in incompatible ways (which usually happens between major releases), XS modules compiled for previous versions of Perl will no longer work. they need to be recompiled against the new Perl. no way around it.

so the XS_APIVERSION_BOOTCHECK macro has been added to make sure modules get recompiled, and to stop users from accidentally loading modules compiled for old perls into newer perls. that macro โ€” which is called when loading every newly compiled extension โ€” compares the API version of the running perl with the version a module has been compiled for, and raises an exception if they don't match. vibe check ๐Ÿ’…


๐ŸŒธ Perl_fetch_cop_label ๐ŸŒธ

the first argument of the C API function Perl_fetch_cop_label has changed from struct refcounted_he * to COP *, to insulate the user from implementation details.

this API function was marked as "may change", and it likely isn't in use outside the core. (neither an unpacked CPAN nor Google's codesearch finds any other references to it. iconic levels of unused.)


๐ŸŽ€ GvCV() and GvGP() are no longer lvalues ๐ŸŽ€

the new GvCV_set() and GvGP_set() macros are now provided to replace assignment to those two macros.

this allows a future commit to eliminate some backref magic between GV and CVs, which will require complete control over assignment to the gp_cv slot.


๐Ÿ’– CvGV() is no longer an lvalue ๐Ÿ’–

under some circumstances, the CvGV() field of a CV is now reference-counted. and to ensure consistent behaviour, direct assignment to it โ€” for example CvGV(cv) = gv โ€” is now a compile-time error.

a new macro, CvGV_set(cv,gv), has been introduced to run this operation safely. but note: modification of this field is not part of the public API, regardless of this new macro (and despite its being listed in this section). iykyk.


๐Ÿงš CvSTASH() is no longer an lvalue ๐Ÿงš

the CvSTASH() macro can now only be used as an rvalue. CvSTASH_set() has been added to replace assignment to CvSTASH(), and that's to make sure backreferences are handled properly. also: these macros are not part of the API.


๐Ÿ‘‘ Calling conventions for "newFOROP" and "newWHILEOP" ๐Ÿ‘‘

the way the parser handles labels has been cleaned up and refactored (glow-up for the parser ๐Ÿ’…). as a result, the newFOROP() constructor function no longer takes a parameter stating what label is to go in the state op.

and both newWHILEOP() and newFOROP() no longer accept a line number as a parameter.


๐Ÿ’… Flags passed to "uvuni_to_utf8_flags" and "utf8n_to_uvuni" ๐Ÿ’…

some of the flags parameters to uvuni_to_utf8_flags() and utf8n_to_uvuni() have changed. this is because Perl now allows internal storage and manipulation of code points that are problematic in some situations. hence, the default actions for these functions have been complemented to allow these code points. the new flags are documented in perlapi.

so listen: code that requires the problematic code points to be rejected needs to change to use the new flags. some flag names are retained for backward source compatibility, though they do nothing, because they are now the default.

however, the flags UNICODE_ALLOW_FDD0, UNICODE_ALLOW_FFFF, UNICODE_ILLEGAL, and UNICODE_IS_ILLEGAL have been removed โ€” they stem from a fundamentally broken model of how the Unicode non-character code points should be handled, which is now described in "Non-character code points" in perlunicode. see also the Unicode section under "Selected Bug Fixes".


๐Ÿ“ Deprecated C APIs ๐Ÿ“

๐Ÿ’€ "Perl_ptr_table_clear" ๐Ÿ’€

Perl_ptr_table_clear is no longer part of Perl's public API. calling it now generates a deprecation warning, and it will be removed in a future release. so likeโ€ฆ don't.


๐Ÿ˜ญ "sv_compile_2op" ๐Ÿ˜ญ

the sv_compile_2op() API function is now deprecated. searches suggest that nothing on CPAN is using it, so this should have zero impact.

it attempted to provide an API to compile code down to an optree, but it failed to bind correctly to lexicals in the enclosing scope. and it's not possible to fix this problem within the constraints of its parameters and return value. rip ๐Ÿชฆ


๐ŸŒธ "find_rundefsvoffset" ๐ŸŒธ

the find_rundefsvoffset function has been deprecated. it appeared that its design was insufficient for reliably getting the lexical $_ at run-time. flawed design era, over.

use the new find_rundefsv function or the UNDERBAR macro instead โ€” they directly return the right SV representing $_, whether it's lexical or dynamic. way cleaner, no notes.


๐ŸŽ€ "CALL_FPTR" and "CPERLscope" ๐ŸŽ€

those are leftovers from an old implementation of MULTIPLICITY using C++ objects, which was removed in Perl 5.8. nowadays these macros do exactly nothing, so they shouldn't be used anymore. they're giving haunted mansion vibes fr.

for compatibility, they are still defined for external XS code. only extensions defining PERL_CORE must be updated now.


โœจ Other Internal Changes โœจ

๐Ÿงš Stack unwinding ๐Ÿงš

The protocol for unwinding the C stack at the last stage of a die has changed how it identifies the target stack frame. It now uses a separate variable PL_restartjmpenv, where previously it relied on the blk_eval.cur_top_env pointer in the eval context frame that has nominally just been discarded. This change means that code running during various stages of Perl-level unwinding no longer needs to take care to avoid destroying the ghost frame. ๐Ÿ‘ปโœจ

Scope stack entries

The format of entries on the scope stack has been changed, and the glow-up is real: memory usage drops by about 10% ๐Ÿ’…. Specifically, the memory the scope stack uses to record each active lexical variable has been halved ๐ŸŽ€.

Memory allocation for pointer tables

Memory allocation for pointer tables has been changed. Bestie, here's the before: Perl_ptr_table_store allocated memory from the same arena system as SV bodies and HEs, and freed memory just stayed bound to those arenas until interpreter exit ๐Ÿ˜ญ. Now? It allocates memory from arenas private to the specific pointer table, and that memory gets returned to the system when Perl_ptr_table_free is called ๐ŸŒˆ. Bonus: allocation and release are both less CPU intensive ๐Ÿ”ฅ.

UNDERBAR

The UNDERBAR macro now calls find_rundefsv ๐Ÿฆ‹. dUNDERBAR is now a noop, but you should still use it to ensure past and future compatibility ๐Ÿ‘‘.

String comparison routines renamed

The ibcmp_* functions have been renamed and are now called foldEQ, foldEQ_locale, and foldEQ_utf8 โœจ. The old names are still available as macros, so nothing breaks ๐Ÿ’–.

chop and chomp implementations merged

The opcode bodies for chop and chomp โ€” and for schop and schomp โ€” have been merged ๐Ÿค. The implementation functions Perl_do_chop() and Perl_do_chomp(), which were never part of the public API, have been merged and moved to a static function in pp.c. This shrinks the Perl binary slightly, and should not affect any code outside the core (unless it is relying on the order of side-effects when chomp is passed a list of values) โš ๏ธ.


๐Ÿ’– Selected Bug Fixes ๐Ÿ’–

๐ŸŽ€ I/O ๐ŸŽ€

  • Perl no longer produces this warning:
$ perl -we 'open(my $f, ">", \my $x); binmode($f, "scalar")'
Use of uninitialized value in binmode at -e line 1.
  • Opening a glob reference via open($fh, ">", \*glob) no longer causes the glob to be corrupted when the filehandle is printed to ๐Ÿ˜ค. Previously this would cause Perl to crash whenever the glob's contents were accessed [perl #77492].
  • PerlIO no longer crashes when called recursively, such as from a signal handler ๐Ÿ™ˆ. Now it just leaks memory [perl #75556].
  • Most I/O functions were not warning for unopened handles unless the closed and unopened warnings categories were both enabled. Now only use warnings 'unopened' is necessary to trigger these warnings, as had always been the intention โœจ.
  • There have been several fixes to PerlIO layers:
    • When binmode(FH, ":crlf") pushes the :crlf layer on top of the stack, it no longer enables crlf layers lower in the stack, so as to avoid unexpected results [perl #38456].
    • Opening a file in :raw mode now does what it advertises to do (first open the file, then binmode it), instead of simply leaving off the top layer [perl #80764].
    • The three layers :pop, :utf8, and :bytes didn't allow stacking when opening a file. For example this:
open(FH, ">:pop:perlio", "some.file") or die $!;

would throw an Invalid argument error. This has been fixed in this release [perl #82484] ๐Ÿ’….

๐ŸŒธ Regular Expression Bug Fixes ๐ŸŒธ

  • The regular expression engine no longer loops when matching "\N{LATIN SMALL LIGATURE FF}" =~ /f+/i and similar expressions [perl #72998] (5.12.1).
  • The trie runtime code should no longer allocate massive amounts of memory, fixing #74484 ๐Ÿ˜ฎโ€๐Ÿ’จ.
  • Syntax errors in (?{...}) blocks no longer cause panic messages [perl #2353].
  • A pattern like (?:(o){2})? no longer causes a panic error [perl #39233].
  • A fatal error in regular expressions containing (.*?) when processing UTF-8 data has been fixed [perl #75680] (5.12.2).
  • An erroneous regular expression engine optimisation that caused regex verbs like *COMMIT sometimes to be ignored has been removed ๐Ÿ—‘๏ธ.
  • The regular expression bracketed character class [\8\9] was effectively the same as [89\000], incorrectly matching a NULL character. It also gave incorrect warnings that the 8 and 9 were ignored. Now [\8\9] is the same as [89] and gives legitimate warnings that \8 and \9 are unrecognized escape sequences, passed-through ๐Ÿ‘‘.
  • A regular expression match in the right-hand side of a global substitution (s///g) that is in the same scope will no longer cause match variables to have the wrong values on subsequent iterations. This can happen when an array or hash subscript is interpolated in the right-hand side, as in s|(.)|@a{ print($1), /./ }|g [perl #19078].
  • Several cases in which characters in the Latin-1 non-ASCII range (0x80 to 0xFF) used not to match themselves, or used to match both a character class and its complement, have been fixed ๐Ÿ˜Œ. For instance, U+00E2 could match both \w and \W [perl #78464] [perl #18281] [perl #60156].
  • Matching a Unicode character against an alternation containing characters that happened to match continuation bytes in the former's UTF8 representation (like qq{\x{30ab}} =~ /\xab|\xa9/) would cause erroneous warnings [perl #70998].
  • The trie optimisation was not taking empty groups into account, preventing "foo" from matching /\A(?:(?:)foo|bar|zot)\z/ [perl #78356].
  • A pattern containing a + inside a lookahead would sometimes cause an incorrect match failure in a global match (for example, /(?=(\S+))/g) [perl #68564].
  • A regular expression optimisation would sometimes cause a match with a {n,m} quantifier to fail when it should have matched [perl #79152].
  • Case-insensitive matching in regular expressions compiled under use locale now works much more sanely when the pattern or target string is internally encoded in UTF8 ๐ŸŒˆ. Previously, under these conditions the localeness was completely lost. Now, code points above 255 are treated as Unicode, but code points between 0 and 255 are treated using the current locale rules, regardless of whether the pattern or the string is encoded in UTF8. The few case-insensitive matches that cross the 255/256 boundary are not allowed. For example, 0xFF does not caselessly match the character at 0x178, LATIN CAPITAL LETTER Y WITH DIAERESIS, because 0xFF may not be LATIN SMALL LETTER Y in the current locale, and Perl has no way of knowing if that character even exists in the locale, much less what code point it is ๐Ÿซถ.
  • The (?|...) regular expression construct no longer crashes if the final branch has more sets of capturing parentheses than any other branch ๐Ÿ’€. This was fixed in Perl 5.10.1 for the case of a single branch, but that fix did not take multiple branches into account [perl #84746].
  • A bug has been fixed in the implementation of {...} quantifiers in regular expressions that prevented the code block in /((\w+)(?{ print $2 })){2}/ from seeing the $2 sometimes [perl #84294].

๐Ÿฆ‹ Syntax/Parsing Bugs ๐Ÿฆ‹

  • when (scalar) {...} no longer crashes, but produces a syntax error [perl #74114] (5.12.1).
  • A label right before a string eval (foo: eval $string) no longer causes the label to be associated also with the first statement inside the eval [perl #74290] (5.12.1).
  • The no 5.13.2 form of no no longer tries to turn on features or pragmata (like strict) [perl #70075] (5.12.2).
  • BEGIN {require 5.12.0} now behaves as documented, rather than behaving identically to use 5.12.0 ๐Ÿ™. Previously, require in a BEGIN block was erroneously executing the use feature ':5.12.0' and use strict behaviour, which only use was documented to provide [perl #69050].
  • A regression introduced in Perl 5.12.0, making my $x = 3; $x = length(undef) result in $x set to 3, has been fixed. $x will now be undef [perl #85508] (5.12.2).
  • When strict refs mode is off, %{...} in rvalue context returns undef if its argument is undefined. An optimisation introduced in Perl 5.12.0 to make keys %{...} faster when used as a boolean did not take this into account, causing keys %{+undef} (and keys %$foo when $foo is undefined) to be an error, which it should be so in strict mode only [perl #81750].
  • Constant-folding used to cause
$text =~ ( 1 ? /phoo/ : /bear/)

to turn into

$text =~ /phoo/

at compile time. Now it correctly matches against $_ [perl #20444] ๐Ÿ’….

  • Parsing Perl code (either with string eval or by loading modules) from within a UNITCHECK block no longer causes the interpreter to crash [perl #70614].
  • String evals no longer fail after 2 billion scopes have been compiled [perl #83364] ๐Ÿ˜ญ.
  • The parser no longer hangs when encountering certain Unicode characters, such as U+387 [perl #74022].
  • Defining a constant with the same name as one of Perl's special blocks (like INIT) stopped working in 5.12.0, but has now been fixed [perl #78634] โœจ.
  • A reference to a literal value used as a hash key ($hash{"foo"}) used to be stringified, even if the hash was tied [perl #79178].
  • A closure containing an if statement followed by a constant or variable is no longer treated as a constant [perl #63540].
  • state can now be used with attributes ๐Ÿ‘‘. It used to mean the same thing as my if any attributes were present [perl #68658].
  • Expressions like @$a > 3 no longer cause $a to be mentioned in the Use of uninitialized value in numeric gt warning when $a is undefined (since it is not part of the > expression, but the operand of the @) [perl #72090].
  • Accessing an element of a package array with a hard-coded number (as opposed to an arbitrary expression) would crash if the array did not exist ๐Ÿ’€. Usually the array would be autovivified during compilation, but typeglob manipulation could remove it, as in these two cases which used to crash:
*d = *a;  print $d[0];
undef *d; print $d[0];
  • The -C command-line option, when used on the shebang line, can now be followed by other options [perl #72434].
  • The B module was handing back B::OPs when it shoulda been handing back B::LOGOPs for entertry [perl #80622]. And bestie, that was not B's fault โ€” it was a bug in the Perl core itself. Not B catching strays for no reason ๐Ÿ’€

Stashes, Globs and Method Lookup ๐ŸŽ€

So back in 5.10.0, Perl got this shiny new internal mechanism for caching MROs โ€” that's method resolution orders, aka the list of parent classes, aka the "isa" caches โ€” all so method lookup would be speedy and @ISA arrays wouldn't have to get searched over and over again. Adorable concept. Chaotic rollout, though, because it dragged a whole pile of bugs in with it ๐Ÿ˜ญ Almost all of them are fixed now, plus a few MRO-related bugs that were lurking around even before 5.10.0:

  • The following used to have erratic effects on method resolution, because the "isa" caches weren't getting reset or ended up listing the wrong classes. All fixed now:
    • Aliasing packages by assigning to globs [perl #77358]
    • Deleting packages by deleting their containing stash elements
    • Undefining the glob containing a package (undef *Foo::)
    • Undefining an ISA glob (undef *Foo::ISA)
    • Deleting an ISA stash element (delete $Foo::{ISA})
    • Sharing @ISA arrays between classes (via *Foo::ISA = \@Bar::ISA or *Foo::ISA = *Bar::ISA) [perl #77238]

And undef *Foo::ISA would even stop a brand-new @Foo::ISA array from updating caches. rude.

  • Typeglob assignments would crash if the glob's stash no longer existed, so long as the glob assigned to were named ISA or the glob on either side of the assignment contained a subroutine.
  • PL_isarev, which is accessible to Perl via mro::get_isarev, is now updated properly when packages are deleted or removed from the @ISA of other classes. This allows many packages to be created and deleted without causing a memory leak [perl #75176]. we love a leak-free era ๐Ÿซถ

In addition, various other bugs related to typeglobs and stashes have been fixed:

  • Some work has been done on the internal pointers that link between symbol tables (stashes), typeglobs, and subroutines. The effect of this? Various edge cases related to deleting stashes or stash entries (for example, <%FOO:: = ()>), and complex typeglob or code-reference aliasing, will no longer crash the interpreter ๐Ÿ’…
  • Assigning a reference to a glob copy now assigns to a glob slot instead of overwriting the glob with a scalar [perl #1804] [perl #77508].
  • A bug when replacing the glob of a loop variable within the loop has been fixed [perl #21469]. Which means this code will no longer crash:
for $x (...) {
    *x = *y;
}
  • Assigning a glob to a PVLV used to convert it to a plain string. Now it works correctly, and a PVLV can hold a glob ๐ŸŒธ This would happen when a nonexistent hash or array element was passed to a subroutine:
sub { $_[0] = *foo }->($hash{key});
# $_[0] would have been the string "*main::foo"

It also happened when a glob was assigned to, or returned from, an element of a tied array or hash [perl #36051].

  • When trying to report Use of uninitialized value $Foo::BAR, crashes could occur if the glob holding the global variable in question had been detached from its original stash by, for example, delete $::{"Foo::"}. This has been fixed by disabling the reporting of variable names in those cases. (a trade, but a functional one โœจ)
  • During the restoration of a localised typeglob on scope exit, any destructors called as a result would be able to see the typeglob in an inconsistent state, containing freed entries, which could result in a crash. This would affect code like this:
local *@;
eval { die bless [] }; # puts an object in $@
sub DESTROY {
  local $@; # boom
}

Now the glob entries are cleared before any destructors are called. This also means that destructors can vivify entries in the glob. So Perl tries again and, if the entries are re-created too many times, dies with a panic: gp_free ... error message.

  • If a typeglob is freed while a subroutine attached to it is still referenced elsewhere, the subroutine is renamed to __ANON__ in the same package, unless the package has been undefined, in which case the __ANON__ package is used. This could cause packages to be sometimes autovivified, such as if the package had been deleted. Now this no longer occurs. The __ANON__ package is also now used when the original package is no longer attached to the symbol table. This avoids memory leaks in some cases [perl #87664].
  • Subroutines and package variables inside a package whose name ends with :: can now be accessed with a fully qualified name.

Unicode ๐ŸŒˆ

  • What has become known as "the Unicode Bug" is almost completely resolved in this release. Under use feature 'unicode_strings' (which is automatically selected by use 5.012 and above), the internal storage format of a string no longer affects the external semantics. [perl #58182].

There are two known exceptions:

  1. The now-deprecated, user-defined case-changing functions require utf8-encoded strings to operate. The CPAN module Unicode::Casing has been written to replace this feature without its drawbacks, and the feature is scheduled to be removed in 5.16.
  2. quotemeta() (and its in-line equivalent \Q) can also give different results depending on whether a string is encoded in UTF-8. See "The "Unicode Bug"" in perlunicode.
  • Handling of Unicode non-character code points has changed. Previously they were mostly considered illegal, except that in some place only one of the 66 of them was known. The Unicode Standard considers them all legal, but forbids their "open interchange". This is part of the change to allow internal use of any code point (see "Core Enhancements"). Together, these changes resolve [perl #38722], [perl #51918], [perl #51936], and [perl #63446].
  • Case-insensitive /i regular expression matching of Unicode characters that match multiple characters now works much more as intended ๐Ÿฆ‹ For example
"\N{LATIN SMALL LIGATURE FFI}" =~ /ffi/ui

and

"ffi" =~ /\N{LATIN SMALL LIGATURE FFI}/ui

are both true. Previously, there were many bugs with this feature. What hasn't been fixed are the places where the pattern contains the multiple characters, but the characters are split up by other things, such as in

"\N{LATIN SMALL LIGATURE FFI}" =~ /(f)(f)i/ui

or

"\N{LATIN SMALL LIGATURE FFI}" =~ /ffi*/ui

or

"\N{LATIN SMALL LIGATURE FFI}" =~ /[a-f][f-m][g-z]/ui

None of these match.

Also, this matching doesn't fully conform to the current Unicode Standard, which asks that the matching be made upon the NFD (Normalization Form Decomposed) of the text. However, as of this writing (April 2010), the Unicode Standard is currently in flux about what they will recommend doing with regard in such scenarios. It may be that they will throw out the whole concept of multi-character matches. [perl #71736].

  • Naming a deprecated character in \N{NAME} no longer leaks memory.
  • We fixed a bug that could cause \N{NAME} constructs followed by a single . to be parsed incorrectly [perl #74978] (5.12.1).
  • chop now correctly handles characters above \x{7fffffff} [perl #73246].
  • Passing to index an offset beyond the end of the string when the string is encoded internally in UTF8 no longer causes panics [perl #75898].
  • warn() and die() now respect utf8-encoded scalars [perl #45549].
  • Sometimes the UTF8 length cache would not be reset on a value returned by substr, causing length(substr($uni_string, ...)) to give wrong answers. With ${^UTF8CACHE} set to -1, it would also produce a panic error message [perl #77692].

Ties, Overloading and Other Magic โœจ

  • Overloading now works properly in conjunction with tied variables ๐Ÿ’– What formerly happened was that most ops checked their arguments for overloading before checking for magic, so for example an overloaded object returned by a tied array access would usually be treated as not overloaded [RT #57012].
  • Various instances of magic (like tie methods) being called on tied variables too many or too few times have been fixed:
    • $tied->() did not always call FETCH [perl #8438].
    • Filetest operators and y/// and tr/// were calling FETCH too many times.
    • The = operator used to ignore magic on its right-hand side if the scalar happened to hold a typeglob (if a typeglob was the last thing returned from or assigned to a tied scalar) [perl #77498].
    • Dereference operators used to ignore magic if the argument was a reference already (such as from a previous FETCH) [perl #72144].
    • splice now calls set-magic (so changes made by splice @ISA are respected by method calls) [perl #78400].
    • In-memory files created by open($fh, ">", \$buffer) were not calling FETCH/STORE at all [perl #43789] (5.12.2).
    • utf8::is_utf8() now respects get-magic (like $1) (5.12.1).
  • Non-commutative binary operators used to swap their operands if the same tied scalar was used for both operands and returned a different value for each FETCH. For instance, if $t returned 2 the first time and 3 the second, then $t/$t would evaluate to 1.5. This has been fixed [perl #87708]. no cap, that math was wild ๐Ÿ˜ญ
  • String eval now detects taintedness of overloaded or tied arguments [perl #75716].
  • String eval and regular expression matches against objects with string overloading no longer cause memory corruption or crashes [perl #77084].
  • readline now honors <> overloading on tied arguments.
  • <expr> always respects overloading now if the expression is overloaded.

Because <> as glob was parsed differently from <> as filehandle from 5.6 onwards, something like <$foo[0]> did not handle overloading, even if $foo[0] was an overloaded object. This was contrary to the documentation for overload, and meant that <> could not be used as a general overloaded iterator operator.

  • The fallback behaviour of overloading on binary operators was asymmetric [perl #71286].
  • Magic applied to variables in the main package no longer affects other packages. See "Magic variables outside the main package" above [perl #76138].
  • Sometimes magic (ties, taintedness, and all that cursed energy โœจ) stuck to your variables could make an object live way longer than it should, or straight up crash if a tied variable got freed from inside a tie method. All fixed now, bestie [perl #81230].
  • DESTROY methods on objects that implement ties can no longer crash by reaching for the tied variable through a weak reference [perl #86328]. No more ghost-touching a variable that's already gone ๐Ÿ’€
  • Fixed a regression in kill() when a match variable is used as the process ID to kill [perl #75812].
  • $AUTOLOAD used to stay tainted forever once it got tainted. Iconic behaviour change: now it's correctly untainted if an autoloaded method is called and the method name itself wasn't tainted. Growth ๐Ÿ’…
  • sprintf now dies when you hand it a tainted scalar as the format. It already died for arbitrary expressions, but not for simple scalars [perl #82250]. It said "not today, tainted string."
  • lc, uc, lcfirst, and ucfirst no longer hand you back untainted strings when the argument is tainted. This has been broken since perl 5.8.9, which is so embarrassing for everyone involved [perl #87336].

๐Ÿ’ป The Debugger ๐Ÿ’ป

  • The Perl debugger now also works in taint mode, finally [perl #76872]. Locked in.
  • Subroutine redefinition works once more in the debugger [perl #48332]. Redefine away, babe.
  • When -d is used on the shebang (#!) line, the debugger now has access to the lines of the main program. In the past this sometimes worked and sometimes didn't, depending on the order things happened to land in memory [perl #71806]. Pure chaos energy before, now it's just chill.
  • A possible memory leak when using caller() to set @DB::args has been fixed (5.12.2).
  • Perl no longer stomps on $DB::single, $DB::trace, and $DB::signal if those variables already have values when $^P gets assigned to [perl #72422]. Respect their boundaries, ngl.
  • #line directives in string evals were not properly updating the arrays of lines of code (@{"_< ..."}) that the debugger (or literally any debugging or profiling module) relies on. In threaded builds they weren't being updated at all. In non-threaded builds the line number was ignored, so any change to the existing line number would make the lines misnumbered [perl #79442]. Whole situation was a mess and now it's not ๐ŸŽ€

๐Ÿงต Threads ๐Ÿงต

  • Perl no longer accidentally clones lexicals that are in scope inside active stack frames in the parent when it's creating a child thread [perl #73086]. Boundaries!! We love to see it.
  • Several memory leaks in cloning and freeing threaded Perl interpreters have been fixed [perl #77352].
  • Creating a new thread when directory handles were open used to cause a crash, because the handles weren't cloned โ€” they were just handed straight to the new thread, which resulted in a double free. Yikes.

Now directory handles are cloned properly on Windows and on systems that have an fchdir function. On other systems, new threads simply do not inherit directory handles from their parent threads [perl #75154]. Them's the rules.

  • The typeglob *, โ€” which holds the scalar variable $, (the output field separator) โ€” had the wrong reference count in child threads.
  • [perl #78494] When pipes are shared between threads, the close function (and any implicit close, such as on thread exit) no longer blocks. Go off, non-blocking king ๐Ÿ‘‘
  • Perl now does a timely cleanup of SVs that got cloned into a new thread but were then discovered to be orphaned (that is, their owners weren't cloned). This eliminates several scalars leaked warnings when joining threads. Silence is golden ๐Ÿซถ

๐ŸŒธ Scoping and Subroutines ๐ŸŒธ

  • Lvalue subroutines are again able to return copy-on-write scalars. This had been broken since version 5.10.0 [perl #75656] (5.12.3). Welcome back, queen.
  • require no longer causes caller to return the wrong file name for the scope that called require, or for other scopes higher up that had the same file name [perl #68712]. Naming rights restored.
  • sort with a ($$)-prototyped comparison routine used to cause the value of @_ to leak out of the sort. Taking a reference to @_ inside the sorting routine could cause a crash [perl #72334]. Absolutely not the vibe, and it's fixed.
  • Match variables (like $1) no longer persist between calls to a sort subroutine [perl #76026]. Each call gets a fresh start, as it deserves.
  • Iterating with foreach over an array returned by an lvalue sub now works [perl #23790]. It's giving functional.
  • $@ is now localised during calls to binmode to prevent action at a distance [perl #78844]. We stan a function that minds its own business.
  • Calling a closure prototype (that's the thing passed to an attribute handler for a closure) now results in a Closure prototype called error message instead of a crash [perl #68560]. Error messages >>> segfaults, every single time.
  • Mentioning a read-only lexical variable from the enclosing scope inside a string eval no longer causes the variable to become writable [perl #19135]. Read-only means read-only, periodt.

๐Ÿšจ Signals ๐Ÿšจ

  • Within signal handlers, $! is now implicitly localized.
  • CHLD signals are no longer unblocked after a signal handler is called if they were blocked beforehand by POSIX::sigprocmask [perl #82040].
  • A signal handler called within a signal handler could cause leaks or double-frees. Now fixed [perl #76248]. Signal-ception is safe now ๐Ÿ”ฅ

๐Ÿซง Miscellaneous Memory Leaks ๐Ÿซง

  • Several memory leaks when loading XS modules were fixed (5.12.2).
  • substr(), pos(), keys(), and vec() could, when used in combination with lvalues, result in leaking the scalar value they operate on, and cause its destruction to happen too late. This has now been fixed. Memory restored, hydration level back to 100%.
  • The postincrement and postdecrement operators, ++ and --, used to cause leaks when used on references. This has now been fixed.
  • Nested map and grep blocks no longer leak memory when processing large lists [perl #48004].
  • use VERSION and no VERSION no longer leak memory [perl #78436] [perl #69050].
  • .= followed by <> or readline would leak memory if $/ contained characters beyond the octet range and the scalar assigned to happened to be encoded as UTF8 internally [perl #72246].
  • eval 'BEGIN{die}' no longer leaks memory on non-threaded builds.

๐Ÿ’ฅ Memory Corruption and Crashes ๐Ÿ’ฅ

  • glob() no longer crashes when %File::Glob:: is empty and CORE::GLOBAL::glob isn't present [perl #75464] (5.12.2).
  • readline() has been fixed when interrupted by signals, so it no longer returns the "same thing" as before or random memory. Random memory is not a feature, bestie.
  • When assigning a list with duplicated keys to a hash, the assignment used to return garbage and/or freed values:
@a = %h = (list with some duplicate keys);

This has now been fixed [perl #31865]. The garbage was not slaying, it was just trash.

  • The mechanism for freeing objects in globs used to leave dangling pointers to freed SVs, meaning Perl users could see corrupted state during destruction. Rude.

Perl now frees only the affected slots of the GV, rather than freeing the GV itself. This makes sure there are no dangling refs or corrupted state during destruction. Surgical. Precise. Iconic.

  • The interpreter no longer crashes when freeing deeply-nested arrays of arrays. Hashes have not been fixed yet [perl #44225]. One step at a time, we're getting there ๐Ÿ™ˆ
  • Concatenating long strings under use encoding no longer causes Perl to crash [perl #78674].
  • Calling ->import on a class that lacks an import method could corrupt the stack, resulting in the strangest behaviour. For instance:
push @a, "foo", $b = bar->import;

would assign "foo" to $b [perl #63790]. That's not a feature, that's a haunting.

  • The recv function could crash when called with the MSG_TRUNC flag [perl #75082].
  • formline no longer crashes when passed a tainted format picture. It also taints $^A now if its arguments are tainted [perl #79138].
  • A bug in how we process filetest operations could cause a segfault. Filetests don't always expect an op on the stack, so we now use TOPs only if we're sure we're not stating the _ filehandle. This is indicated by OPf_KIDS (as checked in ck_ftst) [perl #74542] (5.12.1). Deep-cut fix, but we needed it.
  • unpack() now handles scalar context correctly for %32H and %32u, fixing a potential crash. split() would crash because the third item on the stack wasn't the regular expression it expected. unpack("%2H", ...) would return both the unpacked result and the checksum on the stack, as would unpack("%2u", ...) [perl #73814] (5.12.2).

โœจ Fixes to Various Perl Operators โœจ

  • The &, |, and ^ bitwise operators no longer coerce read-only arguments [perl #20661]. Hands off the read-only stuff, thank you.
  • Stringifying a scalar containing -0.0 no longer has the effect of turning false into true [perl #45133]. Math girlies, we're safe.
  • Some numeric operators were converting integers to floating point, resulting in loss of precision on 64-bit platforms [perl #77456]. Precision is a love language ๐Ÿ’œ
  • sprintf() was ignoring locales when called with constant arguments [perl #78632].
  • Combining the vector (%v) flag and dynamic precision would cause sprintf to confuse the order of its arguments, making it treat the string as the precision and vice-versa [perl #83194]. Swapped order = chaos, and now it's fixed.

๐Ÿ›  Bugs Relating to the C API ๐Ÿ› 

  • The C-level lex_stuff_pvn function would sometimes cause a spurious syntax error on the last line of the file if it lacked a final semicolon [perl #74006] (5.12.1).
  • The eval_sv and eval_pv C functions now set $@ correctly when there is a syntax error and no G_KEEPERR flag, and they never set it if the G_KEEPERR flag is present [perl #3719].
  • The XS multicall API no longer causes subroutines to lose reference counts if called via the multicall interface from within those very subroutines. This affects modules like List::Util. Calling one of its functions with an active subroutine as the first argument could cause a crash [perl #78070]. Recursion said "let me cook" and Perl said "no ๐Ÿซถ"
  • The SvPVbyte function available to XS modules now calls magic before downgrading the SV, to avoid warnings about wide characters [perl #72398].
  • The ref types in the typemap for XS bindings now support magical variables [perl #72684].
  • sv_catsv_flags no longer calls mg_get on its second argument (the source string) if the flags passed to it do not include SV_GMAGIC. So it now actually matches the documentation, which is apparently a novelty here. Growth!
  • my_strftime no longer leaks memory. This fixes a memory leak in POSIX::strftime [perl #73520].
  • XSUB.h now correctly redefines fgets under PERL_IMPLICIT_SYS [perl #55049] (5.12.1).
  • XS code using fputc() or fputs() on Windows could cause an error due to their arguments being swapped [perl #72704] (5.12.1). Windows really said "let me swap these for fun."
  • A possible segfault in the T_PTROBJ default typemap has been fixed (5.12.2).
  • A bug that could cause Unknown error messages when call_sv(code, G_EVAL) is called from an XS destructor has been fixed (5.12.2). At least the error is known now, bestie ๐Ÿ’–

๐ŸŒธ Known Problems ๐ŸŒธ

okay bestie, real talk: this is the list of significant unresolved issues that are either regressions from earlier Perls or that mess with widely-used CPAN modules. Not fake problems. Actual ones. Sit with me:

  • List::Util::first genuinely misbehaves when there's a lexical $_ hanging around (usually because somebody wrote my $_ or given brought one in implicitly ๐Ÿ‘€). The variable that gets set on every iteration is the package variable $_, not the lexical $_. It's giving impostor syndrome but for variables.

And this same issue can pop up in other modules that hand you functions taking a block as their first argument, like:

foo { ... $_ ...} list

See also: <https://github.com/Perl/perl5/issues/9798> โ€” go read it, iykyk.

  • readline() returns an empty string instead of a cached previous value when it gets interrupted by a signal. ๐Ÿ’€ yeah.
  • The changes in prototype handling break Switch. A patch has been sent upstream and will hopefully appear on CPAN soon โ€” fingers crossed fr fr ๐Ÿคž
  • The upgrade to ExtUtils-MakeMaker-6.57_05 has caused some tests in the Module-Install distribution on CPAN to fail. And not, like, vaguely โ€” specifically: 02_mymeta.t tests 5 and 21; 18_all_from.t tests 6 and 15; 19_authors.t tests 5, 13, 21, and 29; and 20_authors_with_special_characters.t tests 6, 15, and 23 in version 1.00 of that distribution now fail. okay so that's the receipts. ๐Ÿงพ
  • On VMS, Time::HiRes tests will fail because of a bug in the CRTL's implementation of setitimer: previous timer values would get cleared if a timer expired, but not if the timer was reset before expiring. HP OpenVMS Engineering have corrected the problem and will release a patch in due course (Quix case # QXCM1001115136). โœจ slay for them honestly
  • On VMS, there were a handful of Module::Build test failures we didn't get to before the release; please watch CPAN for updates. ๐Ÿ™ˆ

๐Ÿ’… Errata ๐Ÿ’…

keys(), values(), and each() work on arrays ๐ŸŒˆ

Not me being late to the party but โ€” you can now use the keys(), values(), and each() builtins on arrays; previously you could only use them on hashes. See perlfunc for details. And the tea โ˜•: this is actually a change introduced in perl 5.12.0, but it got missed from that release's perl5120delta. we forgot to write it down. iconic behavior honestly.

split() and @_ ๐Ÿฆ‹

split() no longer modifies @_ when it's called in scalar or void context. In void context it now produces a "Useless use of split" warning. This was also a perl 5.12.0 change that missed the perldelta. we're doing our makeup in the car and we're telling you about it now.


๐Ÿ•Š๏ธ Obituary ๐Ÿ•Š๏ธ

Randy Kobes, creator of <http://kobesearch.cpan.org/> and contributor/maintainer to several core Perl toolchain modules, passed away on September 18, 2010 after a battle with lung cancer. The community was richer for his involvement. He will be missed. ๐Ÿ’œ


๐Ÿ‘‘ Acknowledgements ๐Ÿ‘‘

Perl 5.14.0 represents one year of development since Perl 5.12.0 and contains nearly 550,000 lines of changes across nearly 3,000 files from 150 authors and committers. like. the scale. ๐Ÿ˜ญ

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

Aaron Crane, Abhijit Menon-Sen, Abigail, ร†var Arnfjรถrรฐ Bjarmason, Alastair Douglas, Alexander Alekseev, Alexander Hartmaier, Alexandr Ciornii, Alex Davies, Alex Vandiver, Ali Polatel, Allen Smith, Andreas Kรถnig, Andrew Rodland, Andy Armstrong, Andy Dougherty, Aristotle Pagaltzis, Arkturuz, Arvan, A. Sinan Unur, Ben Morrow, Bo Lindbergh, Boris Ratner, Brad Gilbert, Bram, brian d foy, Brian Phillips, Casey West, Charles Bailey, Chas. Owens, Chip Salzenberg, Chris 'BinGOs' Williams, chromatic, Craig A. Berry, Curtis Jewell, Dagfinn Ilmari Mannsรฅker, Dan Dascalescu, Dave Rolsky, David Caldwell, David Cantrell, David Golden, David Leadbeater, David Mitchell, David Wheeler, Eric Brine, Father Chrysostomos, Fingle Nark, Florian Ragwitz, Frank Wiegand, Franz Fasching, Gene Sullivan, George Greer, Gerard Goossen, Gisle Aas, Goro Fuji, Grant McLean, gregor herrmann, H.Merijn Brand, Hongwen Qiu, Hugo van der Sanden, Ian Goodacre, James E Keenan, James Mastros, Jan Dubois, Jay Hannah, Jerry D. Hedden, Jesse Vincent, Jim Cromie, Jirka Hruลกka, John Peacock, Joshua ben Jore, Joshua Pritikin, Karl Williamson, Kevin Ryde, kmx, Lars Dษชแด‡แด„แด‹แดแดก ่ฟชๆ‹‰ๆ–ฏ, Larwan Berke, Leon Brocard, Leon Timmermans, Lubomir Rintel, Lukas Mai, Maik Hentsche, Marty Pauley, Marvin Humphrey, Matt Johnson, Matt S Trout, Max Maischein, Michael Breen, Michael Fig, Michael G Schwern, Michael Parker, Michael Stevens, Michael Witten, Mike Kelly, Moritz Lenz, Nicholas Clark, Nick Cleaton, Nick Johnston, Nicolas Kaiser, Niko Tyni, Noirin Shirley, Nuno Carvalho, Paul Evans, Paul Green, Paul Johnson, Paul Marquess, Peter J. Holzer, Peter John Acklam, Peter Martini, Philippe Bruhat (BooK), Piotr Fusik, Rafael Garcia-Suarez, Rainer Tammer, Reini Urban, Renee Baecker, Ricardo Signes, Richard Mรถhn, Richard Soderberg, Rob Hoelz, Robin Barker, Ruslan Zakirov, Salvador Fandiรฑo, Salvador Ortiz Garcia, Shlomi Fish, Sinan Unur, Sisyphus, Slaven Rezic, Steffen Mรผller, Steve Hay, Steven Schubiger, Steve Peters, Sullivan Beck, Tatsuhiko Miyagawa, Tim Bunce, Todd Rinaldo, Tom Christiansen, Tom Hukins, Tony Cook, Tye McQueen, Vadim Konovalov, Vernon Lyon, Vincent Pit, Walt Mankowski, Wolfram Humann, Yves Orton, Zefram, and Zsbรกn Ambrus.

okay so real talk: this is woefully incomplete because it's automatically generated from version control history. In particular, it doesn't include the names of the (very much appreciated ๐Ÿซถ) contributors who reported issues in previous versions of Perl that helped make Perl 5.14.0 better. For a more complete list of all of Perl's historical contributors, please see the "AUTHORS" file in the Perl 5.14.0 distribution.

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. ๐ŸŒธ


๐Ÿ› Reporting Bugs ๐Ÿ›

Found something you think is a bug? bestie, first check the articles recently posted to the comp.lang.perl.misc newsgroup and the Perl bug database at <http://rt.perl.org/perlbug/>. There may also be information at <http://www.perl.org/>, the Perl Home Page. do your research first ๐Ÿ’…

If you believe you have an unreported bug, please run the perlbug program included with your release. And be sure to trim your bug down to a tiny but sufficient test case โ€” nobody wants your 4000-line repro, we want the one line that breaks. Your bug report, along with the output of perl -V, will be sent off to perlbug@perl.org to be analysed by the Perl porting team.

SECURITY TEA, PAY ATTENTION: If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who are able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please use this address for security issues in the Perl core only, not for modules independently distributed on CPAN. ๐Ÿšจ

โœจ 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.

aaaand that's the whole page bestie, we made it to the end ๐ŸŽ€ this was perl v5.44.0, dated 2026-10-17, in PERL5140DELTA(1perl) flavor โ€” thanks for reading the whole thing with me, ur a real one for that ๐Ÿ’–โœจ go write something cursed in Perl, you've earned it ๐Ÿฆ‹

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