PERLDEPRECATION(1perl)
๐ PERLDEPRECATION(1perl) ๐
Perl Programmers Reference Guide โ PERLDEPRECATION(1perl)
okay bestie, gather round, because this is literally the receipts page ๐โจ
๐ธ NAME ๐ธ
perldeprecation โ the list of Perl deprecations, aka everything Perl is side-eyeing and getting ready to ghost ๐
๐ฆ DESCRIPTION ๐ฆ
So the whole point of this doc is to spill the tea on what's been deprecated in Perl, and which version it's gonna fully disappear in โ or, for the stuff that's already gone, when exactly it got removed. ๐
It also tries to talk about what alternatives exist for each deprecated thing, so you're not just standing there like "okay but what do I do now ๐ญ".
Everything is grouped by the Perl version where it'll get yeeted out. ๐ฎ
โจ Unscheduled Deprecations โจ
๐ Unicode Delimiter Will be Paired ๐
Some Unicode delimiters used to be allowed as lonely little single characters, but in the future they'll be part of a balanced pair. This deprecation category marks the ones that are gonna switch from unpaired to paired. glow-up arc, honestly ๐
Category: deprecated::delimiter_will_be_paired
๐ Dot In Inc ๐
The current working directory "." used to just auto-include itself in @INC, but in Perl 5.26 that got removed for security reasons (periodt, safety first ๐ก๏ธ). Ever since then, a warning gets produced when a user does do EXPR and EXPR doesn't include a path, and the file wasn't found in any directory in @INC but was located in ".". The file will not be loaded โ you just get a deprecated warning instead. ๐
Category: deprecated::dot_in_inc
๐ง Unicode Property Name ๐ง
Various types of Unicode property name will generate deprecated warnings when used in a regex pattern. For instance, surrogate characters will result in deprecation warnings. ๐
Category: deprecated::unicode_property_name
โญ Perl 5.46 โญ
๐ Changing use VERSION while another use VERSION is in scope ๐
A use VERSION declaration has so many implicit effects on the surrounding scope โ strict and feature flags, importing builtin functions, the whole vibe. So once you've got a use VERSION statement in scope, another use VERSION statement with a different version is now deprecated as of Perl 5.39.8, because swapping from one prevailing version to another got way too complex. it's giving chaos ๐ตโ๐ซ
Category: deprecated::subsequent_use_version
๐ฅ Perl 5.44 ๐ฅ
๐ฆ Goto Block Construct ๐ฆ
goto LABEL; now throws an exception when you try to jump into the body of a loop or other block construct from outside. For instance:
while (should_loop($x)) {
LABEL:
do_stuff();
}
goto LABEL;
now throws an exception indicating that this behavior is no longer permitted. ma'am, that door is closed ๐ช๐
Category: deprecated::goto_construct
๐ Perl 5.42 ๐
There were no deprecations or fatalizations in Perl 5.42. (Lowkey there were deprecations we planned to do in Perl 5.42 but failed to carry out. One was accomplished in Perl 5.44; one was cancelled; one is now unscheduled.) so basically the to-do list said "later" ๐
๐ Perl 5.40 ๐
๐ธ Downgrading a use VERSION to below v5.11 ๐ธ
Once Perl has seen a use VERSION declaration requesting version v5.11 or above, a subsequent second declaration requesting an earlier version will print a deprecation warning. For example:
use v5.14;
say "We can use v5.14's features here";
use v5.10; # This prints a warning
This was deprecated in Perl 5.36 and is now fatal. not a drill ๐จ
This is because of an intended related change to the interaction between use VERSION and use strict. If you specify a version >= 5.11, strict gets enabled implicitly. If you request a version < 5.11, strict will become disabled โ even if you had previously written use strict. That's not how use VERSION used to behave, which at present tracks explicitly-enabled strictness flags independently. messy ๐ซ
Category: deprecated::version_downgrade
โจ Perl 5.38 โจ
๐ Pod::Html utility functions ๐
The definition and documentation of three utility functions that were previously importable from Pod::Html got moved to the new package Pod::Html::Util in Perl 5.36. While they stayed importable from Pod::Html in Perl 5.36, as of Perl 5.38 they're only importable, on request, from Pod::Html::Util. they moved out, changed their number, new address bestie ๐
๐ฆ Perl 5.34 ๐ฆ
There were no deprecations or fatalizations in Perl 5.34. a peaceful era, we miss her ๐ฟ
๐ Perl 5.32 ๐
๐ Constants from lexical variables potentially modified elsewhere ๐
You wrote something like:
my $var;
$sub = sub () { $var };
but $var is referenced elsewhere and could be modified after the sub expression is evaluated. Either it's explicitly modified elsewhere ($var = 3) or it's passed to a subroutine or to an operator like printf or map, which may or may not modify the variable. ๐ฌ
Traditionally, Perl captured the value of the variable at that point and turned the subroutine into a constant eligible for inlining. But in those cases where the variable can be modified elsewhere, that breaks the behavior of closures โ because in a closure the subroutine captures the variable itself, not its value, so future changes to the variable show up in the subroutine's return value.
If you intended for the subroutine to be eligible for inlining, then make sure the variable isn't referenced elsewhere, possibly by copying it:
my $var2 = $var;
$sub = sub () { $var2 };
If you do want this subroutine to be a closure that reflects future changes to the variable it closes over, add an explicit return:
my $var;
$sub = sub () { return $var };
This usage was deprecated and as of Perl 5.32 is no longer allowed. ๐ซ
๐ Use of strings with code points over 0xFF as arguments to vec ๐
vec views its string argument as a sequence of bits. A string containing a code point over 0xFF is nonsensical. This usage is deprecated in Perl 5.28, and was removed in Perl 5.32.
๐ Use of code points over 0xFF in string bitwise operators ๐
The string bitwise operators โ &, |, ^, and ~ โ treat their operands as strings of bytes. As such, values above 0xFF are nonsensical. Some instances of these have been deprecated since Perl 5.24, and were made fatal in 5.28, but it turns out that in cases where the wide characters didn't affect the end result, no deprecation notice was raised, and so they remain legal. Now, all occurrences either are fatal or raise a deprecation warning, so that the remaining legal occurrences became fatal in 5.32. ๐
An example of this is:
"" & "\x{100}"
The wide character isn't used in the & operation because the left operand is shorter. This now throws an exception. ๐ญ
โญ hostname() doesn't accept any arguments โญ
The function hostname() in the Sys::Hostname module has always been documented to be called with no arguments. Historically it has not enforced this, and has actually accepted and ignored any arguments. As a result, some users got the mistaken impression that an argument does something useful. To avoid these bugs, the function is being made strict. Passing arguments was deprecated in Perl 5.28 and became fatal in Perl 5.32. no notes, no args ๐ต
๐ Unescaped left braces in regular expressions ๐
The simple rule to remember: if you want to match a literal { character (U+007B LEFT CURLY BRACKET) in a regular expression pattern, escape each literal instance of it in some way. Generally easiest is to precede it with a backslash, like \{, or enclose it in square brackets ([{]). If the pattern delimiters are also braces, any matching right brace (}) should also be escaped to avoid confusing the parser, for example:
qr{abc\{def\}ghi}
Forcing literal { characters to be escaped will enable the Perl language to be extended in various ways in future releases. To avoid needlessly breaking existing code, the restriction isn't enforced in contexts where there are unlikely to ever be extensions that could conflict with the use of { as a literal. A non-deprecation warning that the left brace is being taken literally is raised in contexts where there could be confusion about it.
Literal uses of { were deprecated in Perl 5.20, and some uses of it started to give deprecation warnings since. These cases were made fatal in Perl 5.26. Due to an oversight, not all cases of a use of a literal { got a deprecation warning. Some cases started warning in Perl 5.26, and were made fatal in Perl 5.30. Other cases started in Perl 5.28, and were made fatal in 5.32. the timeline is a mess but we're here now ๐ซถ
๐ง In XS code, use of various macros dealing with UTF-8 ๐ง
The macros below now require an extra parameter compared to versions prior to Perl 5.32. The final parameter in each one is a pointer into the string supplied by the first parameter, beyond which the input will not be read. This prevents potential reading beyond the end of the buffer. ๐
isALPHANUMERIC_utf8, isASCII_utf8, isBLANK_utf8, isCNTRL_utf8, isDIGIT_utf8, isIDFIRST_utf8, isPSXSPC_utf8, isSPACE_utf8, isVERTWS_utf8, isWORDCHAR_utf8, isXDIGIT_utf8, isALPHANUMERIC_LC_utf8, isALPHA_LC_utf8, isASCII_LC_utf8, isBLANK_LC_utf8, isCNTRL_LC_utf8, isDIGIT_LC_utf8, isGRAPH_LC_utf8, isIDCONT_LC_utf8, isIDFIRST_LC_utf8, isLOWER_LC_utf8, isPRINT_LC_utf8, isPSXSPC_LC_utf8, isPUNCT_LC_utf8, isSPACE_LC_utf8, isUPPER_LC_utf8, isWORDCHAR_LC_utf8, isXDIGIT_LC_utf8, toFOLD_utf8, toLOWER_utf8, toTITLE_utf8, and toUPPER_utf8.
Since Perl 5.26, this functionality with the extra parameter has been available by using a corresponding macro to each one of these, whose name is formed by appending _safe to the base name. There's no change to the functionality of those. For example, isDIGIT_utf8_safe corresponds to isDIGIT_utf8, and both now behave identically. All are documented in "Character case changing" in perlapi and "Character classification" in perlapi.
This change was originally scheduled for 5.30, but was delayed until 5.32. classic โจ
๐ File::Glob::glob() was removed ๐
File::Glob had a function called glob, which just called bsd_glob.
File::Glob::glob() was deprecated in Perl 5.8. A deprecation message was issued from Perl 5.26 onwards, the function became fatal in Perl 5.30, and was removed entirely in Perl 5.32.
Code using File::Glob::glob() should call File::Glob::bsd_glob() instead. simple swap, you got this ๐ซถ
๐ฅ Perl 5.30 ๐ฅ
๐ $* is no longer supported ๐
Before Perl 5.10, setting $* to a true value globally enabled multi-line matching within a string. This relic from the past lost its special meaning in 5.10. Use of this variable became a fatal error in Perl 5.30, freeing the variable up for a future special meaning. ๐ new slot unlocked
To enable multiline matching you should use the /m regexp modifier (possibly in combination with /s). This can be set on a per match basis, or can be enabled per lexical scope (including a whole file) with use re '/m'. ๐
๐ $# is no longer supported ๐
This variable used to have a special meaning โ it could be used to control how numbers were formatted when printed. This seldom used functionality was removed in Perl 5.10. In order to free up the variable for a future special meaning, its use became a fatal error in Perl 5.30. rip bozo ๐ชฆ
...and bestie, we're only like a third of the way through, so don't go anywhere ๐
okay so real quick โ if you wanna control how numbers get formatted when they're printed, the move is printf or sprintf. that's the advice, bestie, take it. ๐
Assigning non-zero to $[ is fatal ๐
This variable (and the corresponding array_base feature and arybase module) allowed changing the base for array and string indexing operations.
Setting this to a non-zero value has been deprecated since Perl 5.12 and throws a fatal error as of Perl 5.30.
Unqualified dump() ๐
Use of dump() instead of CORE::dump() was deprecated in Perl 5.8, and an unqualified dump() is no longer available as of Perl 5.30. periodt.
See "dump" in perlfunc.
Using my() in false conditional ๐ญ
There has been a long-standing bug in Perl that causes a lexical variable not to be cleared at scope exit when its declaration includes a false conditional. Some people have exploited this bug to achieve a kind of static variable. To allow us to fix this bug, people should not be relying on this behavior. (no more exploiting the bug, we're cleaning house โจ)
Instead, it's recommended one uses state variables to achieve the same effect:
use 5.10.0;
sub count {state $counter; return ++ $counter}
say count (); # Prints 1
say count (); # Prints 2
state variables were introduced in Perl 5.10.
Alternatively, you can achieve a similar static effect by declaring the variable in a separate block outside the function, e.g.,
sub f { my $x if 0; return $x++ }
becomes
{ my $x; sub f { return $x++ } }
The use of my() in a false conditional has been deprecated in Perl 5.10, and became a fatal error in Perl 5.30. ๐ฅ
Reading/writing bytes from/to :utf8 handles ๐
The sysread(), recv(), syswrite() and send() operators are deprecated on handles that have the ":utf8" layer, either explicitly, or implicitly, eg., with the :encoding(UTF-16LE) layer.
Both sysread() and recv() currently use only the ":utf8" flag for the stream, ignoring the actual layers. Since sysread() and recv() do no UTF-8 validation they can end up creating invalidly encoded scalars. ๐ฌ
Similarly, syswrite() and send() use only the ":utf8" flag, otherwise ignoring any layers. If the flag is set, both write the value UTF-8 encoded, even if the layer is some different encoding, such as the UTF-16LE example above.
Ideally, all of these operators would completely ignore the ":utf8" state, working only with bytes, but this would result in silently breaking existing code. To avoid this a future version of perl will throw an exception when any of sysread(), recv(), syswrite() or send() are called on handles with the ":utf8" layer. heads up, future you is gonna get yelled at by perl โจ
As of Perl 5.30, it is no longer possible to use sysread(), recv(), syswrite() or send() to read or send bytes from/to ":utf8" handles.
Use of unassigned code point or non-standalone grapheme for a delimiter ๐ง
A grapheme is what appears to a native speaker of a language to be a character. In Unicode (and hence Perl) a grapheme may actually be several adjacent characters that together form a complete grapheme. For example, there can be a base character, like "R" and an accent, like a circumflex "^", that appear to be a single character when displayed, with the circumflex hovering over the "R".
As of Perl 5.30, use of delimiters which are non-standalone graphemes is fatal, in order to move the language to be able to accept multi-character graphemes as delimiters. ๐
Also, as of Perl 5.30, delimiters which are unassigned code points but that may someday become assigned are prohibited. Otherwise, code that works today would fail to compile if the currently unassigned delimiter ends up being something that isn't a stand-alone grapheme. Because Unicode is never going to assign non-character code points, nor code points that are above the legal Unicode maximum, those can be delimiters.
Perl 5.28 โญ
Attributes ":locked" and ":unique"
The attributes ":locked" (on code references) and ":unique" (on array, hash and scalar references) have had no effect since Perl 5.005 and Perl 5.8.8 respectively. Their use has been deprecated since.
As of Perl 5.28, these attributes are syntax errors. Since the attributes do not do anything, removing them from your code fixes the syntax error; and removing them will not influence the behaviour of your code. free cleanup, no downside, slay ๐
Bare here-document terminators
Perl has allowed you to use a bare here-document terminator "<<" to have the here-document end at the first empty line. This practise was deprecated in Perl 5.000; as of Perl 5.28, using a bare here-document terminator throws a fatal error.
You are encouraged to use the explicitly quoted form if you wish to use an empty line as the terminator of the here-document:
print <<"";
Print this line.
# Previous blank line ends the here-document.
Setting $/ to a reference to a non-positive integer
You assigned a reference to a scalar to $/ where the referenced item is not a positive integer. In older perls this appeared to work the same as setting it to "undef" but was in fact internally different, less efficient and with very bad luck could have resulted in your file being split by a stringified form of the reference. very bad luck fr fr ๐ญ
In Perl 5.20.0 this was changed so that it would be exactly the same as setting $/ to "undef", with the exception that this warning would be thrown.
As of Perl 5.28, setting $/ to a reference to a non-positive integer throws a fatal error.
You are recommended to change your code to set $/ to "undef" explicitly if you wish to slurp the file.
Limit on the value of Unicode code points
Unicode only allows code points up to 0x10FFFF, but Perl allows much larger ones. Up till Perl 5.28, it was allowed to use code points exceeding the maximum value of an integer (IV_MAX). However, that did break the perl interpreter in some constructs, including causing it to hang in a few cases. The known problem areas were in tr///, regular expression pattern matching using quantifiers, as quote delimiters in qX...X (where X is the chr() of a large code point), and as the upper limits in loops.
The use of out-of-range code points was deprecated in Perl 5.24; as of Perl 5.28 using a code point exceeding IV_MAX throws a fatal error.
If your code is to run on various platforms, keep in mind that the upper limit depends on the platform. It is much larger on 64-bit word sizes than 32-bit ones. For 32-bit integers, IV_MAX equals 0x7FFFFFFF; for 64-bit integers, IV_MAX equals 0x7FFFFFFFFFFFFFFF. numbers, memorized, iconic ๐
Use of comma-less variable list in formats
It was allowed to use a list of variables in a format, without separating them with commas. This usage has been deprecated for a long time, and as of Perl 5.28, this throws a fatal error.
Use of "\N{}"
Use of "\N{}" with nothing between the braces was deprecated in Perl 5.24, and throws a fatal error as of Perl 5.28.
Since such a construct is equivalent to using an empty string, you are recommended to remove such "\N{}" constructs. ๐ซถ
Using the same symbol to open a filehandle and a dirhandle
It used to be legal to use open() to associate both a filehandle and a dirhandle to the same symbol (glob or scalar). This idiom is likely to be confusing, and it was deprecated in Perl 5.10.
Using the same symbol to open() a filehandle and a dirhandle throws a fatal error as of Perl 5.28.
You should be using two different symbols instead.
${^ENCODING} is no longer supported
The special variable "${^ENCODING}" was used to implement the "encoding" pragma. Setting this variable to anything other than "undef" was deprecated in Perl 5.22. Full deprecation of the variable happened in Perl 5.25.3.
Setting this variable to anything other than an undefined value throws a fatal error as of Perl 5.28.
"B::OP::terse"
This method, which just calls "B::Concise::b_terse", has been deprecated, and disappeared in Perl 5.28. Please use B::Concise instead.
Use of inherited AUTOLOAD for non-method %s::%s() is no longer allowed
As an (ahem) accidental feature, "AUTOLOAD" subroutines were looked up as methods (using the @ISA hierarchy) even when the subroutines to be autoloaded were called as plain functions (e.g. Foo::bar()), not as methods (e.g. "Foo->bar()" or "$obj->bar()").
This bug was deprecated in Perl 5.004 and has been rectified in Perl 5.28 by using method lookup only for methods' "AUTOLOAD"s.
The simple rule is: Inheritance will not work when autoloading non-methods. The simple fix for old code is: In any module that used to depend on inheriting "AUTOLOAD" for non-methods from a base class named "BaseClass", execute *AUTOLOAD = \&BaseClass::AUTOLOAD during startup.
In code that currently says use AutoLoader; @ISA = qw(AutoLoader); you should remove AutoLoader from @ISA and change use AutoLoader; to use AutoLoader 'AUTOLOAD';.
the way that copy-paste fix is literally one line, bestie, do it ๐
In XS code, use of to_utf8_case()
This function has been removed as of Perl 5.28; instead convert to call the appropriate one of: "toFOLD_utf8_safe". "toLOWER_utf8_safe", "toTITLE_utf8_safe", or "toUPPER_utf8_safe".
Perl 5.26 ๐
"--libpods" in Pod::Html
Since Perl 5.18, the option "--libpods" has been deprecated, and using this option did not do anything other than producing a warning.
The "--libpods" option is no longer recognized as of Perl 5.26.
The utilities c2ph and pstruct
These old, perl3-era utilities have been deprecated in favour of h2xs for a long time. As of Perl 5.26, they have been removed. ๐
Trapping $SIG{__DIE__} other than during program exit
The $SIG{__DIE__} hook is called even inside an eval(). It was never intended to happen this way, but an implementation glitch made this possible. This used to be deprecated, as it allowed strange action at a distance like rewriting a pending exception in $@. Plans to rectify this have been scrapped, as users found that rewriting a pending exception is actually a useful feature, and not a bug. plot twist: it's a feature now โจ
Perl never issued a deprecation warning for this; the deprecation was by documentation policy only. But this deprecation has been lifted as of Perl 5.26. ๐
Malformed UTF-8 string in "%s"
This message indicates a bug either in the Perl core or in XS code. Such code was trying to find out if a character, allegedly stored internally encoded as UTF-8, was of a given type, such as being punctuation or a digit. But the character was not encoded in legal UTF-8. The %s is replaced by a string that can be used by knowledgeable people to determine what the type being checked against was.
Passing malformed strings was deprecated in Perl 5.18, and became fatal in Perl 5.26.
Perl 5.24 ๐ฆ
Use of *glob{FILEHANDLE}
The use of *glob{FILEHANDLE} was deprecated in Perl 5.8. The intention was to use *glob{IO} instead, for which *glob{FILEHANDLE} is an alias.
However, this feature was undeprecated in Perl 5.24. (glow up era, we unbanned it ๐)
๐ Calling POSIX::%s() is deprecated
ok so listen bestie, these POSIX functions are gone gone. Like, no longer available at all. R.I.P. ๐ชฆ
isalnumisalphaiscntrlisdigitisgraphislowerisprintispunctisspaceisupperisxdigit
the tea? โ these functions are buggy and literally do not work on UTF-8 encoded strings. it's giving broken. ๐ญ if you wanna know more, go check out their entries in POSIX.
they got deprecated in Perl 5.20, and then straight up removed in Perl 5.24. periodt.
๐ธ Perl 5.16
๐ Use of %s on a handle without * is deprecated
so back in the day, you could use tie, tied or untie on a scalar while that scalar was holding a typeglob, and it would tie its filehandle instead. chaotic behavior, honestly. ๐
and the consequences?? it left you with no way to tie the scalar itself when it held a typeglob, and no way to untie a scalar that had a typeglob assigned to it. trapped. no escape. ๐
this got deprecated in Perl 5.14, and the bug got fixed in Perl 5.16. slay.
so now, tie $scalar will always tie the scalar โ not the handle it holds. that's the rule, that's the vibe. โจ
wanna tie the handle instead? use tie *$scalar โ yes with an explicit asterisk, don't forget it bestie. same energy applies to tied *$scalar and untie *$scalar. ๐
โจ SEE ALSO โจ
warningsdiagnostics
and that's a wrap on this lil deprecation tour, bestie ๐ซถ this page is from perl v5.44.0, dated 2026-10-17, and it's PERLDEPRECATION(1perl) โ go forth and don't use the deprecated stuff, ok? ily, bye! ๐๐
๐ฆ 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