{
    "mode": "man",
    "parameter": "perldeprecation",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/perldeprecation/1/json",
    "generated": "2026-06-16T10:19:14Z",
    "sections": {
        "NAME": {
            "content": "perldeprecation - list Perl deprecations\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The purpose of this document is to document what has been deprecated in Perl, and by which\nversion the deprecated feature will disappear, or, for already removed features, when it was\nremoved.\n\nThis document will try to discuss what alternatives for the deprecated features are\navailable.\n\nThe deprecated features will be grouped by the version of Perl in which they will be removed.\n",
            "subsections": [
                {
                    "name": "Perl 5.34",
                    "content": "There are no deprecations or fatalizations scheduled for Perl 5.34.\n"
                },
                {
                    "name": "Perl 5.32",
                    "content": "Constants from lexical variables potentially modified elsewhere\n\nYou wrote something like\n\nmy $var;\n$sub = sub () { $var };\n\nbut $var is referenced elsewhere and could be modified after the \"sub\" expression is\nevaluated.  Either it is explicitly modified elsewhere (\"$var = 3\") or it is passed to a\nsubroutine or to an operator like \"printf\" or \"map\", which may or may not modify the\nvariable.\n\nTraditionally, Perl has captured the value of the variable at that point and turned the\nsubroutine into a constant eligible for inlining.  In those cases where the variable can be\nmodified elsewhere, this breaks the behavior of closures, in which the subroutine captures\nthe variable itself, rather than its value, so future changes to the variable are reflected\nin the subroutine's return value.\n\nIf you intended for the subroutine to be eligible for inlining, then make sure the variable\nis not referenced elsewhere, possibly by copying it:\n\nmy $var2 = $var;\n$sub = sub () { $var2 };\n\nIf you do want this subroutine to be a closure that reflects future changes to the variable\nthat it closes over, add an explicit \"return\":\n\nmy $var;\n$sub = sub () { return $var };\n\nThis usage was deprecated and as of Perl 5.32 is no longer allowed.\n\nUse of strings with code points over 0xFF as arguments to \"vec\"\n\n\"vec\" views its string argument as a sequence of bits.  A string containing a code point over\n0xFF is nonsensical.  This usage is deprecated in Perl 5.28, and was removed in Perl 5.32.\n\nUse of code points over 0xFF in string bitwise operators\n\nThe string bitwise operators, \"&\", \"|\", \"^\", and \"~\", treat their operands as strings of\nbytes. As such, values above 0xFF are nonsensical. Some instances of these have been\ndeprecated since Perl 5.24, and were made fatal in 5.28, but it turns out that in cases where\nthe wide characters did not affect the end result, no deprecation notice was raised, and so\nremain legal.  Now, all occurrences either are fatal or raise a deprecation warning, so that\nthe remaining legal occurrences became fatal in 5.32.\n\nAn example of this is\n\n\"\" & \"\\x{100}\"\n\nThe wide character is not used in the \"&\" operation because the left operand is shorter.\nThis now throws an exception.\n\nhhoossttnnaammee(()) doesn't accept any arguments\n\nThe function \"hostname()\" in the Sys::Hostname module has always been documented to be called\nwith no arguments.  Historically it has not enforced this, and has actually accepted and\nignored any arguments.  As a result, some users have got the mistaken impression that an\nargument does something useful.  To avoid these bugs, the function is being made strict.\nPassing arguments was deprecated in Perl 5.28 and became fatal in Perl 5.32.\n\nUnescaped left braces in regular expressions\n\nThe simple rule to remember, if you want to match a literal \"{\" character (U+007B \"LEFT CURLY\nBRACKET\") in a regular expression pattern, is to escape each literal instance of it in some\nway.  Generally easiest is to precede it with a backslash, like \"\\{\" or enclose it in square\nbrackets (\"[{]\").  If the pattern delimiters are also braces, any matching right brace (\"}\")\nshould also be escaped to avoid confusing the parser, for example,\n\nqr{abc\\{def\\}ghi}\n\nForcing literal \"{\" characters to be escaped will enable the Perl language to be extended in\nvarious ways in future releases.  To avoid needlessly breaking existing code, the restriction\nis not enforced in contexts where there are unlikely to ever be extensions that could\nconflict with the use there of \"{\" as a literal.  A non-deprecation warning that the left\nbrace is being taken literally is raised in contexts where there could be confusion about it.\n\nLiteral uses of \"{\" were deprecated in Perl 5.20, and some uses of it started to give\ndeprecation warnings since. These cases were made fatal in Perl 5.26. Due to an oversight,\nnot all cases of a use of a literal \"{\" got a deprecation warning.  Some cases started\nwarning in Perl 5.26, and were made fatal in Perl 5.30.  Other cases started in Perl 5.28,\nand were made fatal in 5.32.\n\nIn XS code, use of various macros dealing with UTF-8.\n\nThe macros below now require an extra parameter than in versions prior to Perl 5.32.  The\nfinal parameter in each one is a pointer into the string supplied by the first parameter\nbeyond which the input will not be read.  This prevents potential reading beyond the end of\nthe buffer.  \"isALPHANUMERICutf8\", \"isASCIIutf8\", \"isBLANKutf8\", \"isCNTRLutf8\",\n\"isDIGITutf8\", \"isIDFIRSTutf8\", \"isPSXSPCutf8\", \"isSPACEutf8\", \"isVERTWSutf8\",\n\"isWORDCHARutf8\", \"isXDIGITutf8\", \"isALPHANUMERICLCutf8\", \"isALPHALCutf8\",\n\"isASCIILCutf8\", \"isBLANKLCutf8\", \"isCNTRLLCutf8\", \"isDIGITLCutf8\",\n\"isGRAPHLCutf8\", \"isIDCONTLCutf8\", \"isIDFIRSTLCutf8\", \"isLOWERLCutf8\",\n\"isPRINTLCutf8\", \"isPSXSPCLCutf8\", \"isPUNCTLCutf8\", \"isSPACELCutf8\",\n\"isUPPERLCutf8\", \"isWORDCHARLCutf8\", \"isXDIGITLCutf8\", \"toFOLDutf8\", \"toLOWERutf8\",\n\"toTITLEutf8\", and \"toUPPERutf8\".\n\nSince Perl 5.26, this functionality with the extra parameter has been available by using a\ncorresponding macro to each one of these, and whose name is formed by appending \"safe\" to\nthe base name.  There is no change to the functionality of those.  For example,\n\"isDIGITutf8safe\" corresponds to \"isDIGITutf8\", and both now behave identically.  All are\ndocumented in \"Character case changing\" in perlapi and \"Character classification\" in perlapi.\n\nThis change was originally scheduled for 5.30, but was delayed until 5.32.\n\n\"File::Glob::glob()\" was removed\n\n\"File::Glob\" has a function called \"glob\", which just calls \"bsdglob\".\n\n\"File::Glob::glob()\" was deprecated in Perl 5.8. A deprecation message was issued from Perl\n5.26 onwards, and the function has now disappeared in Perl 5.30.\n\nCode using \"File::Glob::glob()\" should call \"File::Glob::bsdglob()\" instead.\n"
                },
                {
                    "name": "Perl 5.30",
                    "content": "$* is no longer supported\n\nBefore Perl 5.10, setting $* to a true value globally enabled multi-line matching within a\nstring. This relique from the past lost its special meaning in 5.10. Use of this variable\nwill be a fatal error in Perl 5.30, freeing the variable up for a future special meaning.\n\nTo enable multiline matching one should use the \"/m\" regexp modifier (possibly in combination\nwith \"/s\"). This can be set on a per match bases, or can be enabled per lexical scope\n(including a whole file) with \"use re '/m'\".\n\n$# is no longer supported\n\nThis variable used to have a special meaning -- it could be used to control how numbers were\nformatted when printed. This seldom used functionality was removed in Perl 5.10. In order to\nfree up the variable for a future special meaning, its use will be a fatal error in Perl\n5.30.\n\nTo specify how numbers are formatted when printed, one is advised to use \"printf\" or\n\"sprintf\" instead.\n\nAssigning non-zero to $[ is fatal\n\nThis variable (and the corresponding \"arraybase\" feature and arybase module) allowed\nchanging the base for array and string indexing operations.\n\nSetting this to a non-zero value has been deprecated since Perl 5.12 and throws a fatal error\nas of Perl 5.30.\n\n\"File::Glob::glob()\" will disappear\n\n\"File::Glob\" has a function called \"glob\", which just calls \"bsdglob\". However, its\nprototype is different from the prototype of \"CORE::glob\", and hence, \"File::Glob::glob\"\nshould not be used.\n\n\"File::Glob::glob()\" was deprecated in Perl 5.8. A deprecation message was issued from Perl\n5.26 onwards, and the function will disappear in Perl 5.30.\n\nCode using \"File::Glob::glob()\" should call \"File::Glob::bsdglob()\" instead.\n\nUnescaped left braces in regular expressions (for 5.30)\n\nSee \"Unescaped left braces in regular expressions\" above.\n\nUnqualified \"dump()\"\n\nUse of \"dump()\" instead of \"CORE::dump()\" was deprecated in Perl 5.8, and an unqualified\n\"dump()\" will no longer be available in Perl 5.30.\n\nSee \"dump\" in perlfunc.\n\nUsing mmyy(()) in false conditional.\n\nThere has been a long-standing bug in Perl that causes a lexical variable not to be cleared\nat scope exit when its declaration includes a false conditional.  Some people have exploited\nthis bug to achieve a kind of static variable.  To allow us to fix this bug, people should\nnot be relying on this behavior.\n\nInstead, it's recommended one uses \"state\" variables to achieve the same effect:\n\nuse 5.10.0;\nsub count {state $counter; return ++ $counter}\nsay count ();    # Prints 1\nsay count ();    # Prints 2\n\n\"state\" variables were introduced in Perl 5.10.\n\nAlternatively, you can achieve a similar static effect by declaring the variable in a\nseparate block outside the function, e.g.,\n\nsub f { my $x if 0; return $x++ }\n\nbecomes\n\n{ my $x; sub f { return $x++ } }\n\nThe use of \"my()\" in a false conditional has been deprecated in Perl 5.10, and became a fatal\nerror in Perl 5.30.\n\nReading/writing bytes from/to :utf8 handles.\n\nThe sysread(), recv(), syswrite() and send() operators are deprecated on handles that have\nthe \":utf8\" layer, either explicitly, or implicitly, eg., with the \":encoding(UTF-16LE)\"\nlayer.\n\nBoth sysread() and recv() currently use only the \":utf8\" flag for the stream, ignoring the\nactual layers.  Since sysread() and recv() do no UTF-8 validation they can end up creating\ninvalidly encoded scalars.\n\nSimilarly, syswrite() and send() use only the \":utf8\" flag, otherwise ignoring any layers.\nIf the flag is set, both write the value UTF-8 encoded, even if the layer is some different\nencoding, such as the example above.\n\nIdeally, all of these operators would completely ignore the \":utf8\" state, working only with\nbytes, but this would result in silently breaking existing code.  To avoid this a future\nversion of perl will throw an exception when any of sysread(), recv(), syswrite() or send()\nare called on handle with the \":utf8\" layer.\n\nIn Perl 5.30, it will no longer be possible to use sysread(), recv(), syswrite() or send() to\nread or send bytes from/to :utf8 handles.\n\nUse of unassigned code point or non-standalone grapheme for a delimiter.\n\nA grapheme is what appears to a native-speaker of a language to be a character.  In Unicode\n(and hence Perl) a grapheme may actually be several adjacent characters that together form a\ncomplete grapheme.  For example, there can be a base character, like \"R\" and an accent, like\na circumflex \"^\", that appear to be a single character when displayed, with the circumflex\nhovering over the \"R\".\n\nAs of Perl 5.30, use of delimiters which are non-standalone graphemes is fatal, in order to\nmove the language to be able to accept multi-character graphemes as delimiters.\n\nAlso, as of Perl 5.30, delimiters which are unassigned code points but that may someday\nbecome assigned are prohibited.  Otherwise, code that works today would fail to compile if\nthe currently unassigned delimiter ends up being something that isn't a stand-alone grapheme.\nBecause Unicode is never going to assign non-character code points, nor code points that are\nabove the legal Unicode maximum, those can be delimiters.\n"
                },
                {
                    "name": "Perl 5.28",
                    "content": "Attributes \":locked\" and \":unique\"\n\nThe attributes \":locked\" (on code references) and \":unique\" (on array, hash and scalar\nreferences) have had no effect since Perl 5.005 and Perl 5.8.8 respectively. Their use has\nbeen deprecated since.\n\nAs of Perl 5.28, these attributes are syntax errors. Since the attributes do not do anything,\nremoving them from your code fixes the syntax error; and removing them will not influence the\nbehaviour of your code.\n\nBare here-document terminators\n\nPerl has allowed you to use a bare here-document terminator to have the here-document end at\nthe first empty line. This practise was deprecated in Perl 5.000; as of Perl 5.28, using a\nbare here-document terminator throws a fatal error.\n\nYou are encouraged to use the explicitly quoted form if you wish to use an empty line as the\nterminator of the here-document:\n\nprint <<\"\";\nPrint this line.\n\n# Previous blank line ends the here-document.\n\nSetting $/ to a reference to a non-positive integer\n\nYou assigned a reference to a scalar to $/ where the referenced item is not a positive\ninteger.  In older perls this appeared to work the same as setting it to \"undef\" but was in\nfact internally different, less efficient and with very bad luck could have resulted in your\nfile being split by a stringified form of the reference.\n\nIn Perl 5.20.0 this was changed so that it would be exactly the same as setting $/ to undef,\nwith the exception that this warning would be thrown.\n\nAs of Perl 5.28, setting $/ to a reference of a non-positive integer throws a fatal error.\n\nYou are recommended to change your code to set $/ to \"undef\" explicitly if you wish to slurp\nthe file.\n\nLimit on the value of Unicode code points.\n\nUnicode only allows code points up to 0x10FFFF, but Perl allows much larger ones. Up till\nPerl 5.28, it was allowed to use code points exceeding the maximum value of an integer\n(\"IVMAX\").  However, that did break the perl interpreter in some constructs, including\ncausing it to hang in a few cases.  The known problem areas were in \"tr///\", regular\nexpression pattern matching using quantifiers, as quote delimiters in \"qX...X\" (where X is\nthe \"chr()\" of a large code point), and as the upper limits in loops.\n\nThe use of out of range code points was deprecated in Perl 5.24; as of Perl 5.28 using a code\npoint exceeding \"IVMAX\" throws a fatal error.\n\nIf your code is to run on various platforms, keep in mind that the upper limit depends on the\nplatform. It is much larger on 64-bit word sizes than 32-bit ones. For 32-bit integers,\n\"IVMAX\" equals 0x7FFFFFFF, for 64-bit integers, \"IVMAX\" equals 0x7FFFFFFFFFFFFFFF.\n\nUse of comma-less variable list in formats.\n\nIt was allowed to use a list of variables in a format, without separating them with commas.\nThis usage has been deprecated for a long time, and as of Perl 5.28, this throws a fatal\nerror.\n\nUse of \"\\N{}\"\n\nUse of \"\\N{}\" with nothing between the braces was deprecated in Perl 5.24, and throws a fatal\nerror as of Perl 5.28.\n\nSince such a construct is equivalent to using an empty string, you are recommended to remove\nsuch \"\\N{}\" constructs.\n\nUsing the same symbol to open a filehandle and a dirhandle\n\nIt used to be legal to use \"open()\" to associate both a filehandle and a dirhandle to the\nsame symbol (glob or scalar).  This idiom is likely to be confusing, and it was deprecated in\nPerl 5.10.\n\nUsing the same symbol to \"open()\" a filehandle and a dirhandle throws a fatal error as of\nPerl 5.28.\n\nYou should be using two different symbols instead.\n\n${^ENCODING} is no longer supported.\n\nThe special variable \"${^ENCODING}\" was used to implement the \"encoding\" pragma. Setting this\nvariable to anything other than \"undef\" was deprecated in Perl 5.22. Full deprecation of the\nvariable happened in Perl 5.25.3.\n\nSetting this variable to anything other than an undefined value throws a fatal error as of\nPerl 5.28.\n\n\"B::OP::terse\"\n\nThis method, which just calls \"B::Concise::bterse\", has been deprecated, and disappeared in\nPerl 5.28. Please use \"B::Concise\" instead.\n\nUse of inherited AUTOLOAD for non-method %s::%s() is no longer allowed\n\nAs an (ahem) accidental feature, \"AUTOLOAD\" subroutines were looked up as methods (using the\n@ISA hierarchy) even when the subroutines to be autoloaded were called as plain functions\n(e.g. \"Foo::bar()\"), not as methods (e.g. \"Foo->bar()\" or \"$obj->bar()\").\n\nThis bug was deprecated in Perl 5.004, has been rectified in Perl 5.28 by using method lookup\nonly for methods' \"AUTOLOAD\"s.\n\nThe simple rule is:  Inheritance will not work when autoloading non-methods.  The simple fix\nfor old code is:  In any module that used to depend on inheriting \"AUTOLOAD\" for non-methods\nfrom a base class named \"BaseClass\", execute \"*AUTOLOAD = \\&BaseClass::AUTOLOAD\" during\nstartup.\n\nIn code that currently says \"use AutoLoader; @ISA = qw(AutoLoader);\" you should remove\nAutoLoader from @ISA and change \"use AutoLoader;\" to \"use AutoLoader 'AUTOLOAD';\".\n\nUse of code points over 0xFF in string bitwise operators\n\nThe string bitwise operators, \"&\", \"|\", \"^\", and \"~\", treat their operands as strings of\nbytes. As such, values above 0xFF are nonsensical. Using such code points with these\noperators was deprecated in Perl 5.24, and is fatal as of Perl 5.28.\n\nIn XS code, use of \"toutf8case()\"\n\nThis function has been removed as of Perl 5.28; instead convert to call the appropriate one\nof: \"toFOLDutf8safe\".  \"toLOWERutf8safe\", \"toTITLEutf8safe\", or \"toUPPERutf8safe\".\n"
                },
                {
                    "name": "Perl 5.26",
                    "content": "\"--libpods\" in \"Pod::Html\"\n\nSince Perl 5.18, the option \"--libpods\" has been deprecated, and using this option did not do\nanything other than producing a warning.\n\nThe \"--libpods\" option is no longer recognized as of Perl 5.26.\n\nThe utilities \"c2ph\" and \"pstruct\"\n\nThese old, perl3-era utilities have been deprecated in favour of \"h2xs\" for a long time. As\nof Perl 5.26, they have been removed.\n\nTrapping \"$SIG {DIE}\" other than during program exit.\n\nThe $SIG{DIE} hook is called even inside an \"eval()\". It was never intended to happen\nthis way, but an implementation glitch made this possible. This used to be deprecated, as it\nallowed strange action at a distance like rewriting a pending exception in $@. Plans to\nrectify this have been scrapped, as users found that rewriting a pending exception is\nactually a useful feature, and not a bug.\n\nPerl never issued a deprecation warning for this; the deprecation was by documentation policy\nonly. But this deprecation has been lifted as of Perl 5.26.\n\nMalformed UTF-8 string in \"%s\"\n\nThis message indicates a bug either in the Perl core or in XS code. Such code was trying to\nfind out if a character, allegedly stored internally encoded as UTF-8, was of a given type,\nsuch as being punctuation or a digit.  But the character was not encoded in legal UTF-8.  The\n%s is replaced by a string that can be used by knowledgeable people to determine what the\ntype being checked against was.\n\nPassing malformed strings was deprecated in Perl 5.18, and became fatal in Perl 5.26.\n"
                },
                {
                    "name": "Perl 5.24",
                    "content": "Use of *glob{FILEHANDLE}\n\nThe use of *glob{FILEHANDLE} was deprecated in Perl 5.8.  The intention was to use *glob{IO}\ninstead, for which *glob{FILEHANDLE} is an alias.\n\nHowever, this feature was undeprecated in Perl 5.24.\n\nCalling POSIX::%s() is deprecated\n\nThe following functions in the \"POSIX\" module are no longer available: \"isalnum\", \"isalpha\",\n\"iscntrl\", \"isdigit\", \"isgraph\", \"islower\", \"isprint\", \"ispunct\", \"isspace\", \"isupper\", and\n\"isxdigit\".  The functions are buggy and don't work on UTF-8 encoded strings.  See their\nentries in POSIX for more information.\n\nThe functions were deprecated in Perl 5.20, and removed in Perl 5.24.\n"
                },
                {
                    "name": "Perl 5.16",
                    "content": "Use of %s on a handle without * is deprecated\n\nIt used to be possible to use \"tie\", \"tied\" or \"untie\" on a scalar while the scalar holds a\ntypeglob. This caused its filehandle to be tied. It left no way to tie the scalar itself when\nit held a typeglob, and no way to untie a scalar that had had a typeglob assigned to it.\n\nThis was deprecated in Perl 5.14, and the bug was fixed in Perl 5.16.\n\nSo now \"tie $scalar\" will always tie the scalar, not the handle it holds.  To tie the handle,\nuse \"tie *$scalar\" (with an explicit asterisk).  The same applies to \"tied *$scalar\" and\n\"untie *$scalar\".\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "warnings, diagnostics.\n\n\n\nperl v5.34.0                                 2025-07-25                           PERLDEPRECATION(1)",
            "subsections": []
        }
    },
    "summary": "perldeprecation - list Perl deprecations",
    "flags": [],
    "examples": [],
    "see_also": []
}