{
    "mode": "man",
    "parameter": "perl5004delta",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/perl5004delta/1/json",
    "generated": "2026-07-07T06:44:43Z",
    "sections": {
        "NAME": {
            "content": "perl5004delta - what's new for perl5.004\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This document describes differences between the 5.003 release (as documented in Programming\nPerl, second edition--the Camel Book) and this one.\n",
            "subsections": [
                {
                    "name": "Supported Environments",
                    "content": "Perl5.004 builds out of the box on Unix, Plan 9, LynxOS, VMS, OS/2, QNX, AmigaOS, and Windows\nNT.  Perl runs on Windows 95 as well, but it cannot be built there, for lack of a reasonable\ncommand interpreter.\n"
                },
                {
                    "name": "Core Changes",
                    "content": "Most importantly, many bugs were fixed, including several security problems.  See the Changes\nfile in the distribution for details.\n"
                },
                {
                    "name": "List assignment to %ENV works",
                    "content": "\"%ENV = ()\" and \"%ENV = @list\" now work as expected (except on VMS where it generates a fatal\nerror).\n"
                },
                {
                    "name": "Change to \"Can't locate Foo.pm in @INC\" error",
                    "content": "The error \"Can't locate Foo.pm in @INC\" now lists the contents of @INC for easier debugging.\n"
                },
                {
                    "name": "Compilation option: Binary compatibility with 5.003",
                    "content": "There is a new Configure question that asks if you want to maintain binary compatibility with\nPerl 5.003.  If you choose binary compatibility, you do not have to recompile your\nextensions, but you might have symbol conflicts if you embed Perl in another application,\njust as in the 5.003 release.  By default, binary compatibility is preserved at the expense\nof symbol table pollution.\n"
                },
                {
                    "name": "$PERL5OPT environment variable",
                    "content": "You may now put Perl options in the $PERL5OPT environment variable.  Unless Perl is running\nwith taint checks, it will interpret this variable as if its contents had appeared on a\n\"#!perl\" line at the beginning of your script, except that hyphens are optional.  PERL5OPT\nmay only be used to set the following switches: -[DIMUdmw].\n"
                },
                {
                    "name": "Limitations on -M, -m, and -T options",
                    "content": "The \"-M\" and \"-m\" options are no longer allowed on the \"#!\" line of a script.  If a script\nneeds a module, it should invoke it with the \"use\" pragma.\n\nThe -T option is also forbidden on the \"#!\" line of a script, unless it was present on the\nPerl command line.  Due to the way \"#!\"  works, this usually means that -T must be in the\nfirst argument.  Thus:\n\n#!/usr/bin/perl -T -w\n\nwill probably work for an executable script invoked as \"scriptname\", while:\n\n#!/usr/bin/perl -w -T\n\nwill probably fail under the same conditions.  (Non-Unix systems will probably not follow\nthis rule.)  But \"perl scriptname\" is guaranteed to fail, since then there is no chance of -T\nbeing found on the command line before it is found on the \"#!\" line.\n"
                },
                {
                    "name": "More precise warnings",
                    "content": "If you removed the -w option from your Perl 5.003 scripts because it made Perl too verbose,\nwe recommend that you try putting it back when you upgrade to Perl 5.004.  Each new perl\nversion tends to remove some undesirable warnings, while adding new warnings that may catch\nbugs in your scripts.\n"
                },
                {
                    "name": "Deprecated: Inherited \"AUTOLOAD\" for non-methods",
                    "content": "Before Perl 5.004, \"AUTOLOAD\" functions were looked up as methods (using the @ISA hierarchy),\neven when the function to be autoloaded was called as a plain function (e.g. \"Foo::bar()\"),\nnot a method (e.g. \"Foo->bar()\" or \"$obj->bar()\").\n\nPerl 5.005 will use method lookup only for methods' \"AUTOLOAD\"s.  However, there is a\nsignificant base of existing code that may be using the old behavior.  So, as an interim\nstep, Perl 5.004 issues an optional warning when a non-method uses an inherited \"AUTOLOAD\".\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"
                },
                {
                    "name": "Previously deprecated %OVERLOAD is no longer usable",
                    "content": "Using %OVERLOAD to define overloading was deprecated in 5.003.  Overloading is now defined\nusing the overload pragma. %OVERLOAD is still used internally but should not be used by Perl\nscripts. See overload for more details.\n"
                },
                {
                    "name": "Subroutine arguments created only when they're modified",
                    "content": "In Perl 5.004, nonexistent array and hash elements used as subroutine parameters are brought\ninto existence only if they are actually assigned to (via @).\n\nEarlier versions of Perl vary in their handling of such arguments.  Perl versions 5.002 and\n5.003 always brought them into existence.  Perl versions 5.000 and 5.001 brought them into\nexistence only if they were not the first argument (which was almost certainly a bug).\nEarlier versions of Perl never brought them into existence.\n\nFor example, given this code:\n\nundef @a; undef %a;\nsub show { print $[0] };\nsub change { $[0]++ };\nshow($a[2]);\nchange($a{b});\n\nAfter this code executes in Perl 5.004, $a{b} exists but $a[2] does not.  In Perl 5.002 and\n5.003, both $a{b} and $a[2] would have existed (but $a[2]'s value would have been undefined).\n"
                },
                {
                    "name": "Group vector changeable with $)",
                    "content": "The $) special variable has always (well, in Perl 5, at least) reflected not only the current\neffective group, but also the group list as returned by the \"getgroups()\" C function (if\nthere is one).  However, until this release, there has not been a way to call the\n\"setgroups()\" C function from Perl.\n\nIn Perl 5.004, assigning to $) is exactly symmetrical with examining it: The first number in\nits string value is used as the effective gid; if there are any numbers after the first one,\nthey are passed to the \"setgroups()\" C function (if there is one).\n"
                },
                {
                    "name": "Fixed parsing of $$<digit>, &$<digit>, etc.",
                    "content": "Perl versions before 5.004 misinterpreted any type marker followed by \"$\" and a digit.  For\nexample, \"$$0\" was incorrectly taken to mean \"${$}0\" instead of \"${$0}\".  This bug is\n(mostly) fixed in Perl 5.004.\n\nHowever, the developers of Perl 5.004 could not fix this bug completely, because at least two\nwidely-used modules depend on the old meaning of \"$$0\" in a string.  So Perl 5.004 still\ninterprets \"$$<digit>\" in the old (broken) way inside strings; but it generates this message\nas a warning.  And in Perl 5.005, this special treatment will cease.\n"
                },
                {
                    "name": "Fixed localization of $<digit>, $&, etc.",
                    "content": "Perl versions before 5.004 did not always properly localize the regex-related special\nvariables.  Perl 5.004 does localize them, as the documentation has always said it should.\nThis may result in $1, $2, etc. no longer being set where existing programs use them.\n"
                },
                {
                    "name": "No resetting of $. on implicit close",
                    "content": "The documentation for Perl 5.0 has always stated that $. is not reset when an already-open\nfile handle is reopened with no intervening call to \"close\".  Due to a bug, perl versions\n5.000 through 5.003 did reset $. under that circumstance; Perl 5.004 does not.\n"
                },
                {
                    "name": "\"wantarray\" may return undef",
                    "content": "The \"wantarray\" operator returns true if a subroutine is expected to return a list, and false\notherwise.  In Perl 5.004, \"wantarray\" can also return the undefined value if a subroutine's\nreturn value will not be used at all, which allows subroutines to avoid a time-consuming\ncalculation of a return value if it isn't going to be used.\n"
                },
                {
                    "name": "\"eval EXPR\" determines value of EXPR in scalar context",
                    "content": "Perl (version 5) used to determine the value of EXPR inconsistently, sometimes incorrectly\nusing the surrounding context for the determination.  Now, the value of EXPR (before being\nparsed by eval) is always determined in a scalar context.  Once parsed, it is executed as\nbefore, by providing the context that the scope surrounding the eval provided.  This change\nmakes the behavior Perl4 compatible, besides fixing bugs resulting from the inconsistent\nbehavior.  This program:\n\n@a = qw(time now is time);\nprint eval @a;\nprint '|', scalar eval @a;\n\nused to print something like \"timenowis881399109|4\", but now (and in perl4) prints \"4|4\".\n"
                },
                {
                    "name": "Changes to tainting checks",
                    "content": "A bug in previous versions may have failed to detect some insecure conditions when taint\nchecks are turned on.  (Taint checks are used in setuid or setgid scripts, or when explicitly\nturned on with the \"-T\" invocation option.)  Although it's unlikely, this may cause a\npreviously-working script to now fail, which should be construed as a blessing since that\nindicates a potentially-serious security hole was just plugged.\n\nThe new restrictions when tainting include:\n\nNo glob() or <*>\nThese operators may spawn the C shell (csh), which cannot be made safe.  This restriction\nwill be lifted in a future version of Perl when globbing is implemented without the use\nof an external program.\n\nNo spawning if tainted $CDPATH, $ENV, $BASHENV\nThese environment variables may alter the behavior of spawned programs (especially\nshells) in ways that subvert security.  So now they are treated as dangerous, in the\nmanner of $IFS and $PATH.\n\nNo spawning if tainted $TERM doesn't look like a terminal name\nSome termcap libraries do unsafe things with $TERM.  However, it would be unnecessarily\nharsh to treat all $TERM values as unsafe, since only shell metacharacters can cause\ntrouble in $TERM.  So a tainted $TERM is considered to be safe if it contains only\nalphanumerics, underscores, dashes, and colons, and unsafe if it contains other\ncharacters (including whitespace).\n"
                },
                {
                    "name": "New Opcode module and revised Safe module",
                    "content": "A new Opcode module supports the creation, manipulation and application of opcode masks.  The\nrevised Safe module has a new API and is implemented using the new Opcode module.  Please\nread the new Opcode and Safe documentation.\n"
                },
                {
                    "name": "Embedding improvements",
                    "content": "In older versions of Perl it was not possible to create more than one Perl interpreter\ninstance inside a single process without leaking like a sieve and/or crashing.  The bugs that\ncaused this behavior have all been fixed.  However, you still must take care when embedding\nPerl in a C program.  See the updated perlembed manpage for tips on how to manage your\ninterpreters.\n\nInternal change: FileHandle class based on IO::* classes\nFile handles are now stored internally as type IO::Handle.  The FileHandle module is still\nsupported for backwards compatibility, but it is now merely a front end to the IO::* modules,\nspecifically IO::Handle, IO::Seekable, and IO::File.  We suggest, but do not require, that\nyou use the IO::* modules in new code.\n\nIn harmony with this change, *GLOB{FILEHANDLE} is now just a backward-compatible synonym for\n*GLOB{IO}.\n"
                },
                {
                    "name": "Internal change: PerlIO abstraction interface",
                    "content": "It is now possible to build Perl with AT&T's sfio IO package instead of stdio.  See perlapio\nfor more details, and the INSTALL file for how to use it.\n"
                },
                {
                    "name": "New and changed syntax",
                    "content": "$coderef->(PARAMS)\nA subroutine reference may now be suffixed with an arrow and a (possibly empty) parameter\nlist.  This syntax denotes a call of the referenced subroutine, with the given parameters\n(if any).\n\nThis new syntax follows the pattern of \"$hashref->{FOO}\" and \"$aryref->[$foo]\": You may\nnow write \"&$subref($foo)\" as \"$subref->($foo)\".  All these arrow terms may be chained;\nthus, \"&{$table->{FOO}}($bar)\" may now be written \"$table->{FOO}->($bar)\".\n"
                },
                {
                    "name": "New and changed builtin constants",
                    "content": "PACKAGE\nThe current package name at compile time, or the undefined value if there is no current\npackage (due to a \"package;\" directive).  Like \"FILE\" and \"LINE\", \"PACKAGE\"\ndoes not interpolate into strings.\n"
                },
                {
                    "name": "New and changed builtin variables",
                    "content": "$^E Extended error message on some platforms.  (Also known as $EXTENDEDOSERROR if you \"use\nEnglish\").\n\n$^H The current set of syntax checks enabled by \"use strict\".  See the documentation of\n\"strict\" for more details.  Not actually new, but newly documented.  Because it is\nintended for internal use by Perl core components, there is no \"use English\" long name\nfor this variable.\n\n$^M By default, running out of memory it is not trappable.  However, if compiled for this,\nPerl may use the contents of $^M as an emergency pool after die()ing with this message.\nSuppose that your Perl were compiled with -DPERLEMERGENCYSBRK and used Perl's malloc.\nThen\n\n$^M = 'a' x (1<<16);\n\nwould allocate a 64K buffer for use when in emergency.  See the INSTALL file for\ninformation on how to enable this option.  As a disincentive to casual use of this\nadvanced feature, there is no \"use English\" long name for this variable.\n"
                },
                {
                    "name": "New and changed builtin functions",
                    "content": "delete on slices\nThis now works.  (e.g. \"delete @ENV{'PATH', 'MANPATH'}\")\n\nflock\nis now supported on more platforms, prefers fcntl to lockf when emulating, and always\nflushes before (un)locking.\n\nprintf and sprintf\nPerl now implements these functions itself; it doesn't use the C library function\nsprintf() any more, except for floating-point numbers, and even then only known flags are\nallowed.  As a result, it is now possible to know which conversions and flags will work,\nand what they will do.\n\nThe new conversions in Perl's sprintf() are:\n\n%i   a synonym for %d\n%p   a pointer (the address of the Perl value, in hexadecimal)\n%n   special: *stores* the number of characters output so far\ninto the next variable in the parameter list\n\nThe new flags that go between the \"%\" and the conversion are:\n\n#    prefix octal with \"0\", hex with \"0x\"\nh    interpret integer as C type \"short\" or \"unsigned short\"\nV    interpret integer as Perl's standard integer type\n\nAlso, where a number would appear in the flags, an asterisk (\"*\") may be used instead, in\nwhich case Perl uses the next item in the parameter list as the given number (that is, as\nthe field width or precision).  If a field width obtained through \"*\" is negative, it has\nthe same effect as the '-' flag: left-justification.\n\nSee \"sprintf\" in perlfunc for a complete list of conversion and flags.\n\nkeys as an lvalue\nAs an lvalue, \"keys\" allows you to increase the number of hash buckets allocated for the\ngiven hash.  This can gain you a measure of efficiency if you know the hash is going to\nget big.  (This is similar to pre-extending an array by assigning a larger number to\n$#array.)  If you say\n\nkeys %hash = 200;\n\nthen %hash will have at least 200 buckets allocated for it.  These buckets will be\nretained even if you do \"%hash = ()\"; use \"undef %hash\" if you want to free the storage\nwhile %hash is still in scope.  You can't shrink the number of buckets allocated for the\nhash using \"keys\" in this way (but you needn't worry about doing this by accident, as\ntrying has no effect).\n\nmy() in Control Structures\nYou can now use my() (with or without the parentheses) in the control expressions of\ncontrol structures such as:\n\nwhile (defined(my $line = <>)) {\n$line = lc $line;\n} continue {\nprint $line;\n}\n\nif ((my $answer = <STDIN>) =~ /^y(es)?$/i) {\nuseragrees();\n} elsif ($answer =~ /^n(o)?$/i) {\nuserdisagrees();\n} else {\nchomp $answer;\ndie \"`$answer' is neither `yes' nor `no'\";\n}\n\nAlso, you can declare a foreach loop control variable as lexical by preceding it with the\nword \"my\".  For example, in:\n\nforeach my $i (1, 2, 3) {\nsomefunction();\n}\n\n$i is a lexical variable, and the scope of $i extends to the end of the loop, but not\nbeyond it.\n\nNote that you still cannot use my() on global punctuation variables such as $ and the\nlike.\n\npack() and unpack()\nA new format 'w' represents a BER compressed integer (as defined in ASN.1).  Its format\nis a sequence of one or more bytes, each of which provides seven bits of the total value,\nwith the most significant first.  Bit eight of each byte is set, except for the last\nbyte, in which bit eight is clear.\n\nIf 'p' or 'P' are given undef as values, they now generate a NULL pointer.\n\nBoth pack() and unpack() now fail when their templates contain invalid types.  (Invalid\ntypes used to be ignored.)\n"
                },
                {
                    "name": "sysseek()",
                    "content": "The new sysseek() operator is a variant of seek() that sets and gets the file's system\nread/write position, using the lseek(2) system call.  It is the only reliable way to seek\nbefore using sysread() or syswrite().  Its return value is the new position, or the\nundefined value on failure.\n\nuse VERSION\nIf the first argument to \"use\" is a number, it is treated as a version number instead of\na module name.  If the version of the Perl interpreter is less than VERSION, then an\nerror message is printed and Perl exits immediately.  Because \"use\" occurs at compile\ntime, this check happens immediately during the compilation process, unlike \"require\nVERSION\", which waits until runtime for the check.  This is often useful if you need to\ncheck the current Perl version before \"use\"ing library modules which have changed in\nincompatible ways from older versions of Perl.  (We try not to do this more than we have\nto.)\n\nuse Module VERSION LIST\nIf the VERSION argument is present between Module and LIST, then the \"use\" will call the\nVERSION method in class Module with the given version as an argument.  The default\nVERSION method, inherited from the UNIVERSAL class, croaks if the given version is larger\nthan the value of the variable $Module::VERSION.  (Note that there is not a comma after\nVERSION!)\n\nThis version-checking mechanism is similar to the one currently used in the Exporter\nmodule, but it is faster and can be used with modules that don't use the Exporter.  It is\nthe recommended method for new code.\n\nprototype(FUNCTION)\nReturns the prototype of a function as a string (or \"undef\" if the function has no\nprototype).  FUNCTION is a reference to or the name of the function whose prototype you\nwant to retrieve.  (Not actually new; just never documented before.)\n\nsrand\nThe default seed for \"srand\", which used to be \"time\", has been changed.  Now it's a\nheady mix of difficult-to-predict system-dependent values, which should be sufficient for\nmost everyday purposes.\n\nPrevious to version 5.004, calling \"rand\" without first calling \"srand\" would yield the\nsame sequence of random numbers on most or all machines.  Now, when perl sees that you're\ncalling \"rand\" and haven't yet called \"srand\", it calls \"srand\" with the default seed.\nYou should still call \"srand\" manually if your code might ever be run on a pre-5.004\nsystem, of course, or if you want a seed other than the default.\n\n$ as Default\nFunctions documented in the Camel to default to $ now in fact do, and all those that do\nare so documented in perlfunc.\n\n\"m//gc\" does not reset search position on failure\nThe \"m//g\" match iteration construct has always reset its target string's search position\n(which is visible through the \"pos\" operator) when a match fails; as a result, the next\n\"m//g\" match after a failure starts again at the beginning of the string.  With Perl\n5.004, this reset may be disabled by adding the \"c\" (for \"continue\") modifier, i.e.\n\"m//gc\".  This feature, in conjunction with the \"\\G\" zero-width assertion, makes it\npossible to chain matches together.  See perlop and perlre.\n\n\"m//x\" ignores whitespace before ?*+{}\nThe \"m//x\" construct has always been intended to ignore all unescaped whitespace.\nHowever, before Perl 5.004, whitespace had the effect of escaping repeat modifiers like\n\"*\" or \"?\"; for example, \"/a *b/x\" was (mis)interpreted as \"/a\\*b/x\".  This bug has been\nfixed in 5.004.\n\nnested \"sub{}\" closures work now\nPrior to the 5.004 release, nested anonymous functions didn't work right.  They do now.\n\nformats work right on changing lexicals\nJust like anonymous functions that contain lexical variables that change (like a lexical\nindex variable for a \"foreach\" loop), formats now work properly.  For example, this\nsilently failed before (printed only zeros), but is fine now:\n\nmy $i;\nforeach $i ( 1 .. 10 ) {\nwrite;\n}\nformat =\nmy i is @#\n$i\n.\n\nHowever, it still fails (without a warning) if the foreach is within a subroutine:\n\nmy $i;\nsub foo {\nforeach $i ( 1 .. 10 ) {\nwrite;\n}\n}\nfoo;\nformat =\nmy i is @#\n$i\n.\n"
                },
                {
                    "name": "New builtin methods",
                    "content": "The \"UNIVERSAL\" package automatically contains the following methods that are inherited by\nall other classes:\n\nisa(CLASS)\n\"isa\" returns true if its object is blessed into a subclass of \"CLASS\"\n\n\"isa\" is also exportable and can be called as a sub with two arguments. This allows the\nability to check what a reference points to. Example:\n\nuse UNIVERSAL qw(isa);\n\nif(isa($ref, 'ARRAY')) {\n...\n}\n\ncan(METHOD)\n\"can\" checks to see if its object has a method called \"METHOD\", if it does then a\nreference to the sub is returned; if it does not then undef is returned.\n\nVERSION( [NEED] )\n\"VERSION\" returns the version number of the class (package).  If the NEED argument is\ngiven then it will check that the current version (as defined by the $VERSION variable in\nthe given package) not less than NEED; it will die if this is not the case.  This method\nis normally called as a class method.  This method is called automatically by the\n\"VERSION\" form of \"use\".\n\nuse A 1.2 qw(some imported subs);\n# implies:\nA->VERSION(1.2);\n\nNOTE: \"can\" directly uses Perl's internal code for method lookup, and \"isa\" uses a very\nsimilar method and caching strategy. This may cause strange effects if the Perl code\ndynamically changes @ISA in any package.\n\nYou may add other methods to the UNIVERSAL class via Perl or XS code.  You do not need to\n\"use UNIVERSAL\" in order to make these methods available to your program.  This is necessary\nonly if you wish to have \"isa\" available as a plain subroutine in the current package.\n"
                },
                {
                    "name": "TIEHANDLE now supported",
                    "content": "See perltie for other kinds of tie()s.\n\nTIEHANDLE classname, LIST\nThis is the constructor for the class.  That means it is expected to return an object of\nsome sort. The reference can be used to hold some internal information.\n\nsub TIEHANDLE {\nprint \"<shout>\\n\";\nmy $i;\nreturn bless \\$i, shift;\n}\n\nPRINT this, LIST\nThis method will be triggered every time the tied handle is printed to.  Beyond its self\nreference it also expects the list that was passed to the print function.\n\nsub PRINT {\n$r = shift;\n$$r++;\nreturn print join( $, => map {uc} @), $\\;\n}\n\nPRINTF this, LIST\nThis method will be triggered every time the tied handle is printed to with the\n\"printf()\" function.  Beyond its self reference it also expects the format and list that\nwas passed to the printf function.\n\nsub PRINTF {\nshift;\nmy $fmt = shift;\nprint sprintf($fmt, @).\"\\n\";\n}\n\nREAD this LIST\nThis method will be called when the handle is read from via the \"read\" or \"sysread\"\nfunctions.\n\nsub READ {\n$r = shift;\nmy($buf,$len,$offset) = @;\nprint \"READ called, \\$buf=$buf, \\$len=$len, \\$offset=$offset\";\n}\n\nREADLINE this\nThis method will be called when the handle is read from. The method should return undef\nwhen there is no more data.\n\nsub READLINE {\n$r = shift;\nreturn \"PRINT called $$r times\\n\"\n}\n\nGETC this\nThis method will be called when the \"getc\" function is called.\n\nsub GETC { print \"Don't GETC, Get Perl\"; return \"a\"; }\n\nDESTROY this\nAs with the other types of ties, this method will be called when the tied handle is about\nto be destroyed. This is useful for debugging and possibly for cleaning up.\n\nsub DESTROY {\nprint \"</shout>\\n\";\n}\n"
                },
                {
                    "name": "Malloc enhancements",
                    "content": "If perl is compiled with the malloc included with the perl distribution (that is, if \"perl\n-V:dmymalloc\" is 'define') then you can print memory statistics at runtime by running Perl\nthusly:\n\nenv PERLDEBUGMSTATS=2 perl yourscripthere\n\nThe value of 2 means to print statistics after compilation and on exit; with a value of 1,\nthe statistics are printed only on exit.  (If you want the statistics at an arbitrary time,\nyou'll need to install the optional module Devel::Peek.)\n\nThree new compilation flags are recognized by malloc.c.  (They have no effect if perl is\ncompiled with system malloc().)\n"
                },
                {
                    "name": "-DPERL_EMERGENCY_SBRK",
                    "content": "If this macro is defined, running out of memory need not be a fatal error: a memory pool\ncan allocated by assigning to the special variable $^M.  See \"$^M\".\n"
                },
                {
                    "name": "-DPACK_MALLOC",
                    "content": "Perl memory allocation is by bucket with sizes close to powers of two.  Because of these\nmalloc overhead may be big, especially for data of size exactly a power of two.  If\n\"PACKMALLOC\" is defined, perl uses a slightly different algorithm for small allocations\n(up to 64 bytes long), which makes it possible to have overhead down to 1 byte for\nallocations which are powers of two (and appear quite often).\n\nExpected memory savings (with 8-byte alignment in \"alignbytes\") is about 20% for typical\nPerl usage.  Expected slowdown due to additional malloc overhead is in fractions of a\npercent (hard to measure, because of the effect of saved memory on speed).\n"
                },
                {
                    "name": "-DTWO_POT_OPTIMIZE",
                    "content": "Similarly to \"PACKMALLOC\", this macro improves allocations of data with size close to a\npower of two; but this works for big allocations (starting with 16K by default).  Such\nallocations are typical for big hashes and special-purpose scripts, especially image\nprocessing.\n\nOn recent systems, the fact that perl requires 2M from system for 1M allocation will not\naffect speed of execution, since the tail of such a chunk is not going to be touched (and\nthus will not require real memory).  However, it may result in a premature out-of-memory\nerror.  So if you will be manipulating very large blocks with sizes close to powers of\ntwo, it would be wise to define this macro.\n\nExpected saving of memory is 0-100% (100% in applications which require most memory in\nsuch 2n chunks); expected slowdown is negligible.\n"
                },
                {
                    "name": "Miscellaneous efficiency enhancements",
                    "content": "Functions that have an empty prototype and that do nothing but return a fixed value are now\ninlined (e.g. \"sub PI () { 3.14159 }\").\n\nEach unique hash key is only allocated once, no matter how many hashes have an entry with\nthat key.  So even if you have 100 copies of the same hash, the hash keys never have to be\nreallocated.\n"
                },
                {
                    "name": "Support for More Operating Systems",
                    "content": "Support for the following operating systems is new in Perl 5.004.\n"
                },
                {
                    "name": "Win32",
                    "content": "Perl 5.004 now includes support for building a \"native\" perl under Windows NT, using the\nMicrosoft Visual C++ compiler (versions 2.0 and above) or the Borland C++ compiler (versions\n5.02 and above).  The resulting perl can be used under Windows 95 (if it is installed in the\nsame directory locations as it got installed in Windows NT).  This port includes support for\nperl extension building tools like ExtUtils::MakeMaker and h2xs, so that many extensions\navailable on the Comprehensive Perl Archive Network (CPAN) can now be readily built under\nWindows NT.  See http://www.perl.com/ for more information on CPAN and README.win32 in the\nperl distribution for more details on how to get started with building this port.\n\nThere is also support for building perl under the Cygwin32 environment.  Cygwin32 is a set of\nGNU tools that make it possible to compile and run many Unix programs under Windows NT by\nproviding a mostly Unix-like interface for compilation and execution.  See README.cygwin32 in\nthe perl distribution for more details on this port and how to obtain the Cygwin32 toolkit.\n"
                },
                {
                    "name": "Plan 9",
                    "content": "See README.plan9 in the perl distribution.\n\nQNX\nSee README.qnx in the perl distribution.\n"
                },
                {
                    "name": "AmigaOS",
                    "content": "See README.amigaos in the perl distribution.\n"
                }
            ]
        },
        "Pragmata": {
            "content": "Six new pragmatic modules exist:\n\nuse autouse MODULE => qw(sub1 sub2 sub3)\nDefers \"require MODULE\" until someone calls one of the specified subroutines (which must\nbe exported by MODULE).  This pragma should be used with caution, and only when\nnecessary.\n\nuse blib\nuse blib 'dir'\nLooks for MakeMaker-like 'blib' directory structure starting in dir (or current\ndirectory) and working back up to five levels of parent directories.\n\nIntended for use on command line with -M option as a way of testing arbitrary scripts\nagainst an uninstalled version of a package.\n\nuse constant NAME => VALUE\nProvides a convenient interface for creating compile-time constants, See \"Constant\nFunctions\" in perlsub.\n\nuse locale\nTells the compiler to enable (or disable) the use of POSIX locales for builtin\noperations.\n\nWhen \"use locale\" is in effect, the current LCCTYPE locale is used for regular\nexpressions and case mapping; LCCOLLATE for string ordering; and LCNUMERIC for numeric\nformatting in printf and sprintf (but not in print).  LCNUMERIC is always used in write,\nsince lexical scoping of formats is problematic at best.\n\nEach \"use locale\" or \"no locale\" affects statements to the end of the enclosing BLOCK or,\nif not inside a BLOCK, to the end of the current file.  Locales can be switched and\nqueried with POSIX::setlocale().\n\nSee perllocale for more information.\n\nuse ops\nDisable unsafe opcodes, or any named opcodes, when compiling Perl code.\n\nuse vmsish\nEnable VMS-specific language features.  Currently, there are three VMS-specific features\navailable: 'status', which makes $? and \"system\" return genuine VMS status values instead\nof emulating POSIX; 'exit', which makes \"exit\" take a genuine VMS status value instead of\nassuming that \"exit 1\" is an error; and 'time', which makes all times relative to the\nlocal time zone, in the VMS tradition.\n",
            "subsections": []
        },
        "Modules": {
            "content": "",
            "subsections": [
                {
                    "name": "Required Updates",
                    "content": "Though Perl 5.004 is compatible with almost all modules that work with Perl 5.003, there are\na few exceptions:\n\nModule   Required Version for Perl 5.004\n------   -------------------------------\nFilter   Filter-1.12\nLWP      libwww-perl-5.08\nTk       Tk400.202 (-w makes noise)\n\nAlso, the majordomo mailing list program, version 1.94.1, doesn't work with Perl 5.004 (nor\nwith perl 4), because it executes an invalid regular expression.  This bug is fixed in\nmajordomo version 1.94.2.\n"
                },
                {
                    "name": "Installation directories",
                    "content": "The installperl script now places the Perl source files for extensions in the architecture-\nspecific library directory, which is where the shared libraries for extensions have always\nbeen.  This change is intended to allow administrators to keep the Perl 5.004 library\ndirectory unchanged from a previous version, without running the risk of binary\nincompatibility between extensions' Perl source and shared libraries.\n"
                },
                {
                    "name": "Module information summary",
                    "content": "Brand new modules, arranged by topic rather than strictly alphabetically:\n\nCGI.pm               Web server interface (\"Common Gateway Interface\")\nCGI/Apache.pm        Support for Apache's Perl module\nCGI/Carp.pm          Log server errors with helpful context\nCGI/Fast.pm          Support for FastCGI (persistent server process)\nCGI/Push.pm          Support for server push\nCGI/Switch.pm        Simple interface for multiple server types\n\nCPAN                 Interface to Comprehensive Perl Archive Network\nCPAN::FirstTime      Utility for creating CPAN configuration file\nCPAN::Nox            Runs CPAN while avoiding compiled extensions\n\nIO.pm                Top-level interface to IO::* classes\nIO/File.pm           IO::File extension Perl module\nIO/Handle.pm         IO::Handle extension Perl module\nIO/Pipe.pm           IO::Pipe extension Perl module\nIO/Seekable.pm       IO::Seekable extension Perl module\nIO/Select.pm         IO::Select extension Perl module\nIO/Socket.pm         IO::Socket extension Perl module\n\nOpcode.pm            Disable named opcodes when compiling Perl code\n\nExtUtils/Embed.pm    Utilities for embedding Perl in C programs\nExtUtils/testlib.pm  Fixes up @INC to use just-built extension\n\nFindBin.pm           Find path of currently executing program\n\nClass/Struct.pm      Declare struct-like datatypes as Perl classes\nFile/stat.pm         By-name interface to Perl's builtin stat\nNet/hostent.pm       By-name interface to Perl's builtin gethost*\nNet/netent.pm        By-name interface to Perl's builtin getnet*\nNet/protoent.pm      By-name interface to Perl's builtin getproto*\nNet/servent.pm       By-name interface to Perl's builtin getserv*\nTime/gmtime.pm       By-name interface to Perl's builtin gmtime\nTime/localtime.pm    By-name interface to Perl's builtin localtime\nTime/tm.pm           Internal object for Time::{gm,local}time\nUser/grent.pm        By-name interface to Perl's builtin getgr*\nUser/pwent.pm        By-name interface to Perl's builtin getpw*\n\nTie/RefHash.pm       Base class for tied hashes with references as keys\n\nUNIVERSAL.pm         Base class for *ALL* classes\n"
                },
                {
                    "name": "Fcntl",
                    "content": "New constants in the existing Fcntl modules are now supported, provided that your operating\nsystem happens to support them:\n\nFGETOWN FSETOWN\nOASYNC ODEFER ODSYNC OFSYNC OSYNC\nOEXLOCK OSHLOCK\n\nThese constants are intended for use with the Perl operators sysopen() and fcntl() and the\nbasic database modules like SDBMFile.  For the exact meaning of these and other Fcntl\nconstants please refer to your operating system's documentation for fcntl() and open().\n\nIn addition, the Fcntl module now provides these constants for use with the Perl operator\nflock():\n\nLOCKSH LOCKEX LOCKNB LOCKUN\n\nThese constants are defined in all environments (because where there is no flock() system\ncall, Perl emulates it).  However, for historical reasons, these constants are not exported\nunless they are explicitly requested with the \":flock\" tag (e.g. \"use Fcntl ':flock'\").\n\nIO\nThe IO module provides a simple mechanism to load all the IO modules at one go.  Currently\nthis includes:\n\nIO::Handle\nIO::Seekable\nIO::File\nIO::Pipe\nIO::Socket\n\nFor more information on any of these modules, please see its respective documentation.\n"
                },
                {
                    "name": "Math::Complex",
                    "content": "The Math::Complex module has been totally rewritten, and now supports more operations.  These\nare overloaded:\n\n+ - * /  <=> neg ~ abs sqrt exp log sin cos atan2 \"\" (stringify)\n\nAnd these functions are now exported:\n\npi i Re Im arg\nlog10 logn ln cbrt root\ntan\ncsc sec cot\nasin acos atan\nacsc asec acot\nsinh cosh tanh\ncsch sech coth\nasinh acosh atanh\nacsch asech acoth\ncplx cplxe\n"
                },
                {
                    "name": "Math::Trig",
                    "content": "This new module provides a simpler interface to parts of Math::Complex for those who need\ntrigonometric functions only for real numbers.\n\nDBFile\nThere have been quite a few changes made to DBFile. Here are a few of the highlights:\n\n•   Fixed a handful of bugs.\n\n•   By public demand, added support for the standard hash function exists().\n\n•   Made it compatible with Berkeley DB 1.86.\n\n•   Made negative subscripts work with RECNO interface.\n\n•   Changed the default flags from ORDWR to OCREAT|ORDWR and the default mode from 0640 to\n0666.\n\n•   Made DBFile automatically import the open() constants (ORDWR, OCREAT etc.) from Fcntl,\nif available.\n\n•   Updated documentation.\n\nRefer to the HISTORY section in DBFile.pm for a complete list of changes. Everything after\nDBFile 1.01 has been added since 5.003.\n"
                },
                {
                    "name": "Net::Ping",
                    "content": "Major rewrite - support added for both udp echo and real icmp pings.\n"
                },
                {
                    "name": "Object-oriented overrides for builtin operators",
                    "content": "Many of the Perl builtins returning lists now have object-oriented overrides.  These are:\n\nFile::stat\nNet::hostent\nNet::netent\nNet::protoent\nNet::servent\nTime::gmtime\nTime::localtime\nUser::grent\nUser::pwent\n\nFor example, you can now say\n\nuse File::stat;\nuse User::pwent;\n$his = (stat($filename)->stuid == pwent($whoever)->pwuid);\n"
                },
                {
                    "name": "Utility Changes",
                    "content": ""
                },
                {
                    "name": "pod2html",
                    "content": "Sends converted HTML to standard output\nThe pod2html utility included with Perl 5.004 is entirely new.  By default, it sends the\nconverted HTML to its standard output, instead of writing it to a file like Perl 5.003's\npod2html did.  Use the --outfile=FILENAME option to write to a file.\n"
                },
                {
                    "name": "xsubpp",
                    "content": "\"void\" XSUBs now default to returning nothing\nDue to a documentation/implementation bug in previous versions of Perl, XSUBs with a\nreturn type of \"void\" have actually been returning one value.  Usually that value was the\nGV for the XSUB, but sometimes it was some already freed or reused value, which would\nsometimes lead to program failure.\n\nIn Perl 5.004, if an XSUB is declared as returning \"void\", it actually returns no value,\ni.e. an empty list (though there is a backward-compatibility exception; see below).  If\nyour XSUB really does return an SV, you should give it a return type of \"SV *\".\n\nFor backward compatibility, xsubpp tries to guess whether a \"void\" XSUB is really \"void\"\nor if it wants to return an \"SV *\".  It does so by examining the text of the XSUB: if\nxsubpp finds what looks like an assignment to ST(0), it assumes that the XSUB's return\ntype is really \"SV *\".\n"
                },
                {
                    "name": "C Language API Changes",
                    "content": "\"gvfetchmethod\" and \"perlcallsv\"\nThe \"gvfetchmethod\" function finds a method for an object, just like in Perl 5.003.  The\nGV it returns may be a method cache entry.  However, in Perl 5.004, method cache entries\nare not visible to users; therefore, they can no longer be passed directly to\n\"perlcallsv\".  Instead, you should use the \"GvCV\" macro on the GV to extract its CV,\nand pass the CV to \"perlcallsv\".\n\nThe most likely symptom of passing the result of \"gvfetchmethod\" to \"perlcallsv\" is\nPerl's producing an \"Undefined subroutine called\" error on the second call to a given\nmethod (since there is no cache on the first call).\n\n\"perlevalpv\"\nA new function handy for eval'ing strings of Perl code inside C code.  This function\nreturns the value from the eval statement, which can be used instead of fetching globals\nfrom the symbol table.  See perlguts, perlembed and perlcall for details and examples.\n\nExtended API for manipulating hashes\nInternal handling of hash keys has changed.  The old hashtable API is still fully\nsupported, and will likely remain so.  The additions to the API allow passing keys as\n\"SV*\"s, so that \"tied\" hashes can be given real scalars as keys rather than plain strings\n(nontied hashes still can only use strings as keys).  New extensions must use the new\nhash access functions and macros if they wish to use \"SV*\" keys.  These additions also\nmake it feasible to manipulate \"HE*\"s (hash entries), which can be more efficient.  See\nperlguts for details.\n"
                },
                {
                    "name": "Documentation Changes",
                    "content": "Many of the base and library pods were updated.  These new pods are included in section 1:\n\nperldelta\nThis document.\n\nperlfaq\nFrequently asked questions.\n\nperllocale\nLocale support (internationalization and localization).\n\nperltoot\nTutorial on Perl OO programming.\n\nperlapio\nPerl internal IO abstraction interface.\n\nperlmodlib\nPerl module library and recommended practice for module creation.  Extracted from perlmod\n(which is much smaller as a result).\n\nperldebug\nAlthough not new, this has been massively updated.\n\nperlsec\nAlthough not new, this has been massively updated.\n"
                },
                {
                    "name": "New Diagnostics",
                    "content": "Several new conditions will trigger warnings that were silent before.  Some only affect\ncertain platforms.  The following new warnings and errors outline these.  These messages are\nclassified as follows (listed in increasing order of desperation):\n\n(W) A warning (optional).\n(D) A deprecation (optional).\n(S) A severe warning (mandatory).\n(F) A fatal error (trappable).\n(P) An internal error you should never see (trappable).\n(X) A very fatal error (nontrappable).\n(A) An alien error message (not generated by Perl).\n\n\"my\" variable %s masks earlier declaration in same scope\n(W) A lexical variable has been redeclared in the same scope, effectively eliminating all\naccess to the previous instance.  This is almost always a typographical error.  Note that\nthe earlier variable will still exist until the end of the scope or until all closure\nreferents to it are destroyed.\n\n%s argument is not a HASH element or slice\n(F) The argument to delete() must be either a hash element, such as\n\n$foo{$bar}\n$ref->[12]->{\"susie\"}\n\nor a hash slice, such as\n\n@foo{$bar, $baz, $xyzzy}\n@{$ref->[12]}{\"susie\", \"queue\"}\n\nAllocation too large: %lx\n(X) You can't allocate more than 64K on an MS-DOS machine.\n\nAllocation too large\n(F) You can't allocate more than 2^31+\"small amount\" bytes.\n\nApplying %s to %s will act on scalar(%s)\n(W) The pattern match (//), substitution (s///), and transliteration (tr///) operators\nwork on scalar values.  If you apply one of them to an array or a hash, it will convert\nthe array or hash to a scalar value (the length of an array or the population info of a\nhash) and then work on that scalar value.  This is probably not what you meant to do.\nSee \"grep\" in perlfunc and \"map\" in perlfunc for alternatives.\n\nAttempt to free nonexistent shared string\n(P) Perl maintains a reference counted internal table of strings to optimize the storage\nand access of hash keys and other strings.  This indicates someone tried to decrement the\nreference count of a string that can no longer be found in the table.\n\nAttempt to use reference as lvalue in substr\n(W) You supplied a reference as the first argument to substr() used as an lvalue, which\nis pretty strange.  Perhaps you forgot to dereference it first.  See \"substr\" in\nperlfunc.\n\nBareword \"%s\" refers to nonexistent package\n(W) You used a qualified bareword of the form \"Foo::\", but the compiler saw no other uses\nof that namespace before that point.  Perhaps you need to predeclare a package?\n\nCan't redefine active sort subroutine %s\n(F) Perl optimizes the internal handling of sort subroutines and keeps pointers into\nthem.  You tried to redefine one such sort subroutine when it was currently active, which\nis not allowed.  If you really want to do this, you should write \"sort { &func } @x\"\ninstead of \"sort func @x\".\n\nCan't use bareword (\"%s\") as %s ref while \"strict refs\" in use\n(F) Only hard references are allowed by \"strict refs\".  Symbolic references are\ndisallowed.  See perlref.\n\nCannot resolve method `%s' overloading `%s' in package `%s'\n(P) Internal error trying to resolve overloading specified by a method name (as opposed\nto a subroutine reference).\n\nConstant subroutine %s redefined\n(S) You redefined a subroutine which had previously been eligible for inlining.  See\n\"Constant Functions\" in perlsub for commentary and workarounds.\n\nConstant subroutine %s undefined\n(S) You undefined a subroutine which had previously been eligible for inlining.  See\n\"Constant Functions\" in perlsub for commentary and workarounds.\n\nCopy method did not return a reference\n(F) The method which overloads \"=\" is buggy. See \"Copy Constructor\" in overload.\n\nDied\n(F) You passed die() an empty string (the equivalent of \"die \"\"\") or you called it with\nno args and both $@ and $ were empty.\n\nExiting pseudo-block via %s\n(W) You are exiting a rather special block construct (like a sort block or subroutine) by\nunconventional means, such as a goto, or a loop control statement.  See \"sort\" in\nperlfunc.\n\nIdentifier too long\n(F) Perl limits identifiers (names for variables, functions, etc.) to 252 characters for\nsimple names, somewhat more for compound names (like $A::B).  You've exceeded Perl's\nlimits.  Future versions of Perl are likely to eliminate these arbitrary limitations.\n\nIllegal character %s (carriage return)\n(F) A carriage return character was found in the input.  This is an error, and not a\nwarning, because carriage return characters can break multi-line strings, including here\ndocuments (e.g., \"print <<EOF;\").\n\nIllegal switch in PERL5OPT: %s\n(X) The PERL5OPT environment variable may only be used to set the following switches:\n-[DIMUdmw].\n\nInteger overflow in hex number\n(S) The literal hex number you have specified is too big for your architecture. On a\n32-bit architecture the largest hex literal is 0xFFFFFFFF.\n\nInteger overflow in octal number\n(S) The literal octal number you have specified is too big for your architecture. On a\n32-bit architecture the largest octal literal is 037777777777.\n\ninternal error: glob failed\n(P) Something went wrong with the external program(s) used for \"glob\" and \"<*.c>\".  This\nmay mean that your csh (C shell) is broken.  If so, you should change all of the csh-\nrelated variables in config.sh:  If you have tcsh, make the variables refer to it as if\nit were csh (e.g. \"fullcsh='/usr/bin/tcsh'\"); otherwise, make them all empty (except\nthat \"dcsh\" should be 'undef') so that Perl will think csh is missing.  In either case,\nafter editing config.sh, run \"./Configure -S\" and rebuild Perl.\n\nInvalid conversion in %s: \"%s\"\n(W) Perl does not understand the given format conversion.  See \"sprintf\" in perlfunc.\n\nInvalid type in pack: '%s'\n(F) The given character is not a valid pack type.  See \"pack\" in perlfunc.\n\nInvalid type in unpack: '%s'\n(F) The given character is not a valid unpack type.  See \"unpack\" in perlfunc.\n\nName \"%s::%s\" used only once: possible typo\n(W) Typographical errors often show up as unique variable names.  If you had a good\nreason for having a unique name, then just mention it again somehow to suppress the\nmessage (the \"use vars\" pragma is provided for just this purpose).\n\nNull picture in formline\n(F) The first argument to formline must be a valid format picture specification.  It was\nfound to be empty, which probably means you supplied it an uninitialized value.  See\nperlform.\n\nOffset outside string\n(F) You tried to do a read/write/send/recv operation with an offset pointing outside the\nbuffer.  This is difficult to imagine.  The sole exception to this is that \"sysread()\"ing\npast the buffer will extend the buffer and zero pad the new area.\n\nOut of memory!\n(X|F) The malloc() function returned 0, indicating there was insufficient remaining\nmemory (or virtual memory) to satisfy the request.\n\nThe request was judged to be small, so the possibility to trap it depends on the way Perl\nwas compiled.  By default it is not trappable.  However, if compiled for this, Perl may\nuse the contents of $^M as an emergency pool after die()ing with this message.  In this\ncase the error is trappable once.\n\nOut of memory during request for %s\n(F) The malloc() function returned 0, indicating there was insufficient remaining memory\n(or virtual memory) to satisfy the request. However, the request was judged large enough\n(compile-time default is 64K), so a possibility to shut down by trapping this error is\ngranted.\n\npanic: frexp\n(P) The library function frexp() failed, making printf(\"%f\") impossible.\n\nPossible attempt to put comments in qw() list\n(W) qw() lists contain items separated by whitespace; as with literal strings, comment\ncharacters are not ignored, but are instead treated as literal data.  (You may have used\ndifferent delimiters than the parentheses shown here; braces are also frequently used.)\n\nYou probably wrote something like this:\n\n@list = qw(\na # a comment\nb # another comment\n);\n\nwhen you should have written this:\n\n@list = qw(\na\nb\n);\n\nIf you really want comments, build your list the old-fashioned way, with quotes and\ncommas:\n\n@list = (\n'a',    # a comment\n'b',    # another comment\n);\n\nPossible attempt to separate words with commas\n(W) qw() lists contain items separated by whitespace; therefore commas aren't needed to\nseparate the items. (You may have used different delimiters than the parentheses shown\nhere; braces are also frequently used.)\n\nYou probably wrote something like this:\n\nqw! a, b, c !;\n\nwhich puts literal commas into some of the list items.  Write it without commas if you\ndon't want them to appear in your data:\n\nqw! a b c !;\n\nScalar value @%s{%s} better written as $%s{%s}\n(W) You've used a hash slice (indicated by @) to select a single element of a hash.\nGenerally it's better to ask for a scalar value (indicated by $).  The difference is that\n$foo{&bar} always behaves like a scalar, both when assigning to it and when evaluating\nits argument, while @foo{&bar} behaves like a list when you assign to it, and provides a\nlist context to its subscript, which can do weird things if you're expecting only one\nsubscript.\n\nStub found while resolving method `%s' overloading `%s' in %s\n(P) Overloading resolution over @ISA tree may be broken by importing stubs.  Stubs should\nnever be implicitly created, but explicit calls to \"can\" may break this.\n\nToo late for \"-T\" option\n(X) The #! line (or local equivalent) in a Perl script contains the -T option, but Perl\nwas not invoked with -T in its argument list.  This is an error because, by the time Perl\ndiscovers a -T in a script, it's too late to properly taint everything from the\nenvironment.  So Perl gives up.\n\nuntie attempted while %d inner references still exist\n(W) A copy of the object returned from \"tie\" (or \"tied\") was still valid when \"untie\" was\ncalled.\n\nUnrecognized character %s\n(F) The Perl parser has no idea what to do with the specified character in your Perl\nscript (or eval).  Perhaps you tried to run a compressed script, a binary program, or a\ndirectory as a Perl program.\n\nUnsupported function fork\n(F) Your version of executable does not support forking.\n\nNote that under some systems, like OS/2, there may be different flavors of Perl\nexecutables, some of which may support fork, some not. Try changing the name you call\nPerl by to \"perl\", \"perl\", and so on.\n\nUse of \"$$<digit>\" to mean \"${$}<digit>\" is deprecated\n(D) Perl versions before 5.004 misinterpreted any type marker followed by \"$\" and a\ndigit.  For example, \"$$0\" was incorrectly taken to mean \"${$}0\" instead of \"${$0}\".\nThis bug is (mostly) fixed in Perl 5.004.\n\nHowever, the developers of Perl 5.004 could not fix this bug completely, because at least\ntwo widely-used modules depend on the old meaning of \"$$0\" in a string.  So Perl 5.004\nstill interprets \"$$<digit>\" in the old (broken) way inside strings; but it generates\nthis message as a warning.  And in Perl 5.005, this special treatment will cease.\n\nValue of %s can be \"0\"; test with defined()\n(W) In a conditional expression, you used <HANDLE>, <*> (glob), \"each()\", or \"readdir()\"\nas a boolean value.  Each of these constructs can return a value of \"0\"; that would make\nthe conditional expression false, which is probably not what you intended.  When using\nthese constructs in conditional expressions, test their values with the \"defined\"\noperator.\n\nVariable \"%s\" may be unavailable\n(W) An inner (nested) anonymous subroutine is inside a named subroutine, and outside that\nis another subroutine; and the anonymous (innermost) subroutine is referencing a lexical\nvariable defined in the outermost subroutine.  For example:\n\nsub outermost { my $a; sub middle { sub { $a } } }\n\nIf the anonymous subroutine is called or referenced (directly or indirectly) from the\noutermost subroutine, it will share the variable as you would expect.  But if the\nanonymous subroutine is called or referenced when the outermost subroutine is not active,\nit will see the value of the shared variable as it was before and during the *first* call\nto the outermost subroutine, which is probably not what you want.\n\nIn these circumstances, it is usually best to make the middle subroutine anonymous, using\nthe \"sub {}\" syntax.  Perl has specific support for shared variables in nested anonymous\nsubroutines; a named subroutine in between interferes with this feature.\n\nVariable \"%s\" will not stay shared\n(W) An inner (nested) named subroutine is referencing a lexical variable defined in an\nouter subroutine.\n\nWhen the inner subroutine is called, it will probably see the value of the outer\nsubroutine's variable as it was before and during the *first* call to the outer\nsubroutine; in this case, after the first call to the outer subroutine is complete, the\ninner and outer subroutines will no longer share a common value for the variable.  In\nother words, the variable will no longer be shared.\n\nFurthermore, if the outer subroutine is anonymous and references a lexical variable\noutside itself, then the outer and inner subroutines will never share the given variable.\n\nThis problem can usually be solved by making the inner subroutine anonymous, using the\n\"sub {}\" syntax.  When inner anonymous subs that reference variables in outer subroutines\nare called or referenced, they are automatically rebound to the current values of such\nvariables.\n\nWarning: something's wrong\n(W) You passed warn() an empty string (the equivalent of \"warn \"\"\") or you called it with\nno args and $ was empty.\n\nIll-formed logical name |%s| in primeenviter\n(W) A warning peculiar to VMS.  A logical name was encountered when preparing to iterate\nover %ENV which violates the syntactic rules governing logical names.  Since it cannot be\ntranslated normally, it is skipped, and will not appear in %ENV.  This may be a benign\noccurrence, as some software packages might directly modify logical name tables and\nintroduce nonstandard names, or it may indicate that a logical name table has been\ncorrupted.\n\nGot an error from DosAllocMem\n(P) An error peculiar to OS/2.  Most probably you're using an obsolete version of Perl,\nand this should not happen anyway.\n\nMalformed PERLLIBPREFIX\n(F) An error peculiar to OS/2.  PERLLIBPREFIX should be of the form\n\nprefix1;prefix2\n\nor\n\nprefix1 prefix2\n\nwith nonempty prefix1 and prefix2.  If \"prefix1\" is indeed a prefix of a builtin library\nsearch path, prefix2 is substituted.  The error may appear if components are not found,\nor are too long.  See \"PERLLIBPREFIX\" in README.os2.\n\nPERLSHDIR too long\n(F) An error peculiar to OS/2. PERLSHDIR is the directory to find the \"sh\"-shell in.\nSee \"PERLSHDIR\" in README.os2.\n\nProcess terminated by SIG%s\n(W) This is a standard message issued by OS/2 applications, while *nix applications die\nin silence.  It is considered a feature of the OS/2 port.  One can easily disable this by\nappropriate sighandlers, see \"Signals\" in perlipc.  See also \"Process terminated by\nSIGTERM/SIGINT\" in README.os2.\n"
                }
            ]
        },
        "BUGS": {
            "content": "If you find what you think is a bug, you might check the headers of recently posted articles\nin the comp.lang.perl.misc newsgroup.  There may also be information at\nhttp://www.perl.com/perl/ , the Perl Home Page.\n\nIf you believe you have an unreported bug, please run the perlbug program included with your\nrelease.  Make sure you trim your bug down to a tiny but sufficient test case.  Your bug\nreport, along with the output of \"perl -V\", will be sent off to <perlbug@perl.com> to be\nanalysed by the Perl porting team.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "The Changes file for exhaustive details on what changed.\n\nThe INSTALL file for how to build Perl.  This file has been significantly updated for 5.004,\nso even veteran users should look through it.\n\nThe README file for general stuff.\n\nThe Copying file for copyright information.\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "Constructed by Tom Christiansen, grabbing material with permission from innumerable\ncontributors, with kibitzing by more than a few Perl porters.\n\nLast update: Wed May 14 11:14:09 EDT 1997\n\n\n\nperl v5.34.0                                 2026-06-23                             PERL5004DELTA(1)",
            "subsections": []
        }
    },
    "summary": "perl5004delta - what's new for perl5.004",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "If this macro is defined, running out of memory need not be a fatal error: a memory pool can allocated by assigning to the special variable $^M. See \"$^M\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Perl memory allocation is by bucket with sizes close to powers of two. Because of these malloc overhead may be big, especially for data of size exactly a power of two. If \"PACKMALLOC\" is defined, perl uses a slightly different algorithm for small allocations (up to 64 bytes long), which makes it possible to have overhead down to 1 byte for allocations which are powers of two (and appear quite often). Expected memory savings (with 8-byte alignment in \"alignbytes\") is about 20% for typical Perl usage. Expected slowdown due to additional malloc overhead is in fractions of a percent (hard to measure, because of the effect of saved memory on speed)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Similarly to \"PACKMALLOC\", this macro improves allocations of data with size close to a power of two; but this works for big allocations (starting with 16K by default). Such allocations are typical for big hashes and special-purpose scripts, especially image processing. On recent systems, the fact that perl requires 2M from system for 1M allocation will not affect speed of execution, since the tail of such a chunk is not going to be touched (and thus will not require real memory). However, it may result in a premature out-of-memory error. So if you will be manipulating very large blocks with sizes close to powers of two, it would be wise to define this macro. Expected saving of memory is 0-100% (100% in applications which require most memory in such 2n chunks); expected slowdown is negligible."
        }
    ],
    "examples": [],
    "see_also": []
}