Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/man/1perl/perl5004delta

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "PERL5004DELTA 1"
.TH PERL5004DELTA 1 "2002-11-24" "perl v5.8.0" "Perl Programmers Reference Guide"
.SH "NAME"
perl5004delta \- what's new for perl5.004
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This document describes differences between the 5.003 release (as
documented in \fIProgramming Perl\fR, second edition\*(--the Camel Book) and
this one.
.SH "Supported Environments"
.IX Header "Supported Environments"
Perl5.004 builds out of the box on Unix, Plan 9, LynxOS, \s-1VMS\s0, \s-1OS/2\s0,
\&\s-1QNX\s0, AmigaOS, and Windows \s-1NT\s0.  Perl runs on Windows 95 as well, but it
cannot be built there, for lack of a reasonable command interpreter.
.SH "Core Changes"
.IX Header "Core Changes"
Most importantly, many bugs were fixed, including several security
problems.  See the \fIChanges\fR file in the distribution for details.
.ie n .Sh "List assignment to %ENV works"
.el .Sh "List assignment to \f(CW%ENV\fP works"
.IX Subsection "List assignment to %ENV works"
\&\f(CW\*(C`%ENV = ()\*(C'\fR and \f(CW\*(C`%ENV = @list\*(C'\fR now work as expected (except on \s-1VMS\s0
where it generates a fatal error).
.ie n .Sh "Change to ""Can't locate Foo.pm in @INC"" error"
.el .Sh "Change to ``Can't locate Foo.pm in \f(CW@INC\fP'' error"
.IX Subsection "Change to Can't locate Foo.pm in @INC error"
The error \*(L"Can't locate Foo.pm in \f(CW@INC\fR\*(R" now lists the contents of \f(CW@INC\fR
for easier debugging.
.Sh "Compilation option: Binary compatibility with 5.003"
.IX Subsection "Compilation option: Binary compatibility with 5.003"
There is a new Configure question that asks if you want to maintain
binary compatibility with Perl 5.003.  If you choose binary
compatibility, you do not have to recompile your extensions, but you
might have symbol conflicts if you embed Perl in another application,
just as in the 5.003 release.  By default, binary compatibility
is preserved at the expense of symbol table pollution.
.Sh "$PERL5OPT environment variable"
.IX Subsection "$PERL5OPT environment variable"
You may now put Perl options in the \f(CW$PERL5OPT\fR environment variable.
Unless Perl is running with taint checks, it will interpret this
variable as if its contents had appeared on a \*(L"#!perl\*(R" line at the
beginning of your script, except that hyphens are optional.  \s-1PERL5OPT\s0
may only be used to set the following switches: \fB\-[DIMUdmw]\fR.
.Sh "Limitations on \fB\-M\fP, \fB\-m\fP, and \fB\-T\fP options"
.IX Subsection "Limitations on -M, -m, and -T options"
The \f(CW\*(C`\-M\*(C'\fR and \f(CW\*(C`\-m\*(C'\fR options are no longer allowed on the \f(CW\*(C`#!\*(C'\fR line of
a script.  If a script needs a module, it should invoke it with the
\&\f(CW\*(C`use\*(C'\fR pragma.
.PP
The \fB\-T\fR option is also forbidden on the \f(CW\*(C`#!\*(C'\fR line of a script,
unless it was present on the Perl command line.  Due to the way \f(CW\*(C`#!\*(C'\fR
works, this usually means that \fB\-T\fR must be in the first argument.
Thus:
.PP
.Vb 1
\&    #!/usr/bin/perl -T -w
.Ve
.PP
will probably work for an executable script invoked as \f(CW\*(C`scriptname\*(C'\fR,
while:
.PP
.Vb 1
\&    #!/usr/bin/perl -w -T
.Ve
.PP
will probably fail under the same conditions.  (Non\-Unix systems will
probably not follow this rule.)  But \f(CW\*(C`perl scriptname\*(C'\fR is guaranteed
to fail, since then there is no chance of \fB\-T\fR being found on the
command line before it is found on the \f(CW\*(C`#!\*(C'\fR line.
.Sh "More precise warnings"
.IX Subsection "More precise warnings"
If you removed the \fB\-w\fR option from your Perl 5.003 scripts because it
made Perl too verbose, we recommend that you try putting it back when
you upgrade to Perl 5.004.  Each new perl version tends to remove some
undesirable warnings, while adding new warnings that may catch bugs in
your scripts.
.ie n .Sh "Deprecated: Inherited ""AUTOLOAD"" for non-methods"
.el .Sh "Deprecated: Inherited \f(CWAUTOLOAD\fP for non-methods"
.IX Subsection "Deprecated: Inherited AUTOLOAD for non-methods"
Before Perl 5.004, \f(CW\*(C`AUTOLOAD\*(C'\fR functions were looked up as methods
(using the \f(CW@ISA\fR hierarchy), even when the function to be autoloaded
was called as a plain function (e.g. \f(CW\*(C`Foo::bar()\*(C'\fR), not a method
(e.g. \f(CW\*(C`Foo\->bar()\*(C'\fR or \f(CW\*(C`$obj\->bar()\*(C'\fR).
.PP
Perl 5.005 will use method lookup only for methods' \f(CW\*(C`AUTOLOAD\*(C'\fRs.
However, there is a significant base of existing code that may be using
the old behavior.  So, as an interim step, Perl 5.004 issues an optional
warning when a non-method uses an inherited \f(CW\*(C`AUTOLOAD\*(C'\fR.
.PP
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 \f(CW\*(C`AUTOLOAD\*(C'\fR for non-methods from a base class named
\&\f(CW\*(C`BaseClass\*(C'\fR, execute \f(CW\*(C`*AUTOLOAD = \e&BaseClass::AUTOLOAD\*(C'\fR during startup.
.ie n .Sh "Previously deprecated %OVERLOAD is no longer usable"
.el .Sh "Previously deprecated \f(CW%OVERLOAD\fP is no longer usable"
.IX Subsection "Previously deprecated %OVERLOAD is no longer usable"
Using \f(CW%OVERLOAD\fR to define overloading was deprecated in 5.003.
Overloading is now defined using the overload pragma. \f(CW%OVERLOAD\fR is
still used internally but should not be used by Perl scripts. See
overload for more details.
.Sh "Subroutine arguments created only when they're modified"
.IX Subsection "Subroutine arguments created only when they're modified"
In Perl 5.004, nonexistent array and hash elements used as subroutine
parameters are brought into existence only if they are actually
assigned to (via \f(CW@_\fR).
.PP
Earlier versions of Perl vary in their handling of such arguments.
Perl versions 5.002 and 5.003 always brought them into existence.
Perl versions 5.000 and 5.001 brought them into existence only if
they were not the first argument (which was almost certainly a bug).
Earlier versions of Perl never brought them into existence.
.PP
For example, given this code:
.PP
.Vb 5
\&     undef @a; undef %a;
\&     sub show { print $_[0] };
\&     sub change { $_[0]++ };
\&     show($a[2]);
\&     change($a{b});
.Ve
.PP
After this code executes in Perl 5.004, \f(CW$a\fR{b} exists but \f(CW$a\fR[2] does
not.  In Perl 5.002 and 5.003, both \f(CW$a\fR{b} and \f(CW$a\fR[2] would have existed
(but \f(CW$a\fR[2]'s value would have been undefined).
.ie n .Sh "Group vector changeable with $)"
.el .Sh "Group vector changeable with \f(CW$)\fP"
.IX Subsection "Group vector changeable with $)"
The \f(CW$)\fR special variable has always (well, in Perl 5, at least)
reflected not only the current effective group, but also the group list
as returned by the \f(CW\*(C`getgroups()\*(C'\fR C function (if there is one).
However, until this release, there has not been a way to call the
\&\f(CW\*(C`setgroups()\*(C'\fR C function from Perl.
.PP
In Perl 5.004, assigning to \f(CW$)\fR is exactly symmetrical with examining
it: The first number in its string value is used as the effective gid;
if there are any numbers after the first one, they are passed to the
\&\f(CW\*(C`setgroups()\*(C'\fR C function (if there is one).
.Sh "Fixed parsing of $$<digit>, &$<digit>, etc."
.IX Subsection "Fixed parsing of $$<digit>, &$<digit>, etc."
Perl versions before 5.004 misinterpreted any type marker followed by
\&\*(L"$\*(R" and a digit.  For example, \*(L"$$0\*(R" was incorrectly taken to mean
\&\*(L"${$}0\*(R" instead of \*(L"${$0}\*(R".  This bug is (mostly) fixed in Perl 5.004.
.PP
However, the developers of Perl 5.004 could not fix this bug completely,
because at least two widely-used modules depend on the old meaning of
\&\*(L"$$0\*(R" in a string.  So Perl 5.004 still interprets \*(L"$$<digit>\*(R" in the
old (broken) way inside strings; but it generates this message as a
warning.  And in Perl 5.005, this special treatment will cease.
.Sh "Fixed localization of $<digit>, $&, etc."
.IX Subsection "Fixed localization of $<digit>, $&, etc."
Perl versions before 5.004 did not always properly localize the
regex-related special variables.  Perl 5.004 does localize them, as
the documentation has always said it should.  This may result in \f(CW$1\fR,
\&\f(CW$2\fR, etc. no longer being set where existing programs use them.
.Sh "No resetting of $. on implicit close"
.IX Subsection "No resetting of $. on implicit close"
The documentation for Perl 5.0 has always stated that \f(CW$.\fR is \fInot\fR
reset when an already-open file handle is reopened with no intervening
call to \f(CW\*(C`close\*(C'\fR.  Due to a bug, perl versions 5.000 through 5.003
\&\fIdid\fR reset \f(CW$.\fR under that circumstance; Perl 5.004 does not.
.ie n .Sh """wantarray"" may return undef"
.el .Sh "\f(CWwantarray\fP may return undef"
.IX Subsection "wantarray may return undef"
The \f(CW\*(C`wantarray\*(C'\fR operator returns true if a subroutine is expected to
return a list, and false otherwise.  In Perl 5.004, \f(CW\*(C`wantarray\*(C'\fR can
also return the undefined value if a subroutine's return value will
not be used at all, which allows subroutines to avoid a time-consuming
calculation of a return value if it isn't going to be used.
.ie n .Sh """eval EXPR"" determines value of \s-1EXPR\s0 in scalar context"
.el .Sh "\f(CWeval EXPR\fP determines value of \s-1EXPR\s0 in scalar context"
.IX Subsection "eval EXPR determines value of EXPR in scalar context"
Perl (version 5) used to determine the value of \s-1EXPR\s0 inconsistently,
sometimes incorrectly using the surrounding context for the determination.
Now, the value of \s-1EXPR\s0 (before being parsed by eval) is always determined in
a scalar context.  Once parsed, it is executed as before, by providing
the context that the scope surrounding the eval provided.  This change
makes the behavior Perl4 compatible, besides fixing bugs resulting from
the inconsistent behavior.  This program:
.PP
.Vb 3
\&    @a = qw(time now is time);
\&    print eval @a;
\&    print '|', scalar eval @a;
.Ve
.PP
used to print something like \*(L"timenowis881399109|4\*(R", but now (and in perl4)
prints \*(L"4|4\*(R".
.Sh "Changes to tainting checks"
.IX Subsection "Changes to tainting checks"
A bug in previous versions may have failed to detect some insecure
conditions when taint checks are turned on.  (Taint checks are used
in setuid or setgid scripts, or when explicitly turned on with the
\&\f(CW\*(C`\-T\*(C'\fR invocation option.)  Although it's unlikely, this may cause a
previously-working script to now fail \*(-- which should be construed
as a blessing, since that indicates a potentially-serious security
hole was just plugged.
.PP
The new restrictions when tainting include:
.IP "No \fIglob()\fR or <*>" 4
.IX Item "No glob() or <*>"
These operators may spawn the C shell (csh), which cannot be made
safe.  This restriction will be lifted in a future version of Perl
when globbing is implemented without the use of an external program.
.ie n .IP "No spawning if tainted $CDPATH\fR, \f(CW$ENV\fR, \f(CW$BASH_ENV" 4
.el .IP "No spawning if tainted \f(CW$CDPATH\fR, \f(CW$ENV\fR, \f(CW$BASH_ENV\fR" 4
.IX Item "No spawning if tainted $CDPATH, $ENV, $BASH_ENV"
These environment variables may alter the behavior of spawned programs
(especially shells) in ways that subvert security.  So now they are
treated as dangerous, in the manner of \f(CW$IFS\fR and \f(CW$PATH\fR.
.ie n .IP "No spawning if tainted $TERM doesn't look like a terminal name" 4
.el .IP "No spawning if tainted \f(CW$TERM\fR doesn't look like a terminal name" 4
.IX Item "No spawning if tainted $TERM doesn't look like a terminal name"
Some termcap libraries do unsafe things with \f(CW$TERM\fR.  However, it would be
unnecessarily harsh to treat all \f(CW$TERM\fR values as unsafe, since only shell
metacharacters can cause trouble in \f(CW$TERM\fR.  So a tainted \f(CW$TERM\fR is
considered to be safe if it contains only alphanumerics, underscores,
dashes, and colons, and unsafe if it contains other characters (including
whitespace).
.Sh "New Opcode module and revised Safe module"
.IX Subsection "New Opcode module and revised Safe module"
A new Opcode module supports the creation, manipulation and
application of opcode masks.  The revised Safe module has a new \s-1API\s0
and is implemented using the new Opcode module.  Please read the new
Opcode and Safe documentation.
.Sh "Embedding improvements"
.IX Subsection "Embedding improvements"
In older versions of Perl it was not possible to create more than one
Perl interpreter instance inside a single process without leaking like a
sieve and/or crashing.  The bugs that caused this behavior have all been
fixed.  However, you still must take care when embedding Perl in a C
program.  See the updated perlembed manpage for tips on how to manage
your interpreters.
.Sh "Internal change: FileHandle class based on IO::* classes"
.IX Subsection "Internal change: FileHandle class based on IO::* classes"
File handles are now stored internally as type IO::Handle.  The
FileHandle module is still supported for backwards compatibility, but
it is now merely a front end to the IO::* modules \*(-- specifically,
IO::Handle, IO::Seekable, and IO::File.  We suggest, but do not
require, that you use the IO::* modules in new code.
.PP
In harmony with this change, \f(CW*GLOB{FILEHANDLE}\fR is now just a
backward-compatible synonym for \f(CW*GLOB{IO}\fR.
.Sh "Internal change: PerlIO abstraction interface"
.IX Subsection "Internal change: PerlIO abstraction interface"
It is now possible to build Perl with \s-1AT&T\s0's sfio \s-1IO\s0 package
instead of stdio.  See perlapio for more details, and
the \fI\s-1INSTALL\s0\fR file for how to use it.
.Sh "New and changed syntax"
.IX Subsection "New and changed syntax"
.IP "$coderef\->(\s-1PARAMS\s0)" 4
.IX Item "$coderef->(PARAMS)"
A subroutine reference may now be suffixed with an arrow and a
(possibly empty) parameter list.  This syntax denotes a call of the
referenced subroutine, with the given parameters (if any).
.Sp
This new syntax follows the pattern of \f(CW\*(C`$hashref\->{FOO}\*(C'\fR and
\&\f(CW\*(C`$aryref\->[$foo]\*(C'\fR: You may now write \f(CW\*(C`&$subref($foo)\*(C'\fR as
\&\f(CW\*(C`$subref\->($foo)\*(C'\fR.  All these arrow terms may be chained;
thus, \f(CW\*(C`&{$table\->{FOO}}($bar)\*(C'\fR may now be written
\&\f(CW\*(C`$table\->{FOO}\->($bar)\*(C'\fR.
.Sh "New and changed builtin constants"
.IX Subsection "New and changed builtin constants"
.IP "_\|_PACKAGE_\|_" 4
.IX Item "__PACKAGE__"
The current package name at compile time, or the undefined value if
there is no current package (due to a \f(CW\*(C`package;\*(C'\fR directive).  Like
\&\f(CW\*(C`_\|_FILE_\|_\*(C'\fR and \f(CW\*(C`_\|_LINE_\|_\*(C'\fR, \f(CW\*(C`_\|_PACKAGE_\|_\*(C'\fR does \fInot\fR interpolate
into strings.
.Sh "New and changed builtin variables"
.IX Subsection "New and changed builtin variables"
.IP "$^E" 4
.IX Item "$^E"
Extended error message on some platforms.  (Also known as
\&\f(CW$EXTENDED_OS_ERROR\fR if you \f(CW\*(C`use English\*(C'\fR).
.IP "$^H" 4
.IX Item "$^H"
The current set of syntax checks enabled by \f(CW\*(C`use strict\*(C'\fR.  See the
documentation of \f(CW\*(C`strict\*(C'\fR for more details.  Not actually new, but
newly documented.
Because it is intended for internal use by Perl core components,
there is no \f(CW\*(C`use English\*(C'\fR long name for this variable.
.IP "$^M" 4
.IX Item "$^M"
By default, running out of memory it is not trappable.  However, if
compiled for this, Perl may use the contents of \f(CW$^M\fR as an emergency
pool after \fIdie()\fRing with this message.  Suppose that your Perl were
compiled with \-DPERL_EMERGENCY_SBRK and used Perl's malloc.  Then
.Sp
.Vb 1
\&    $^M = 'a' x (1<<16);
.Ve
.Sp
would allocate a 64K buffer for use when in emergency.
See the \fI\s-1INSTALL\s0\fR file for information on how to enable this option.
As a disincentive to casual use of this advanced feature,
there is no \f(CW\*(C`use English\*(C'\fR long name for this variable.
.Sh "New and changed builtin functions"
.IX Subsection "New and changed builtin functions"
.IP "delete on slices" 4
.IX Item "delete on slices"
This now works.  (e.g. \f(CW\*(C`delete @ENV{'PATH', 'MANPATH'}\*(C'\fR)
.IP "flock" 4
.IX Item "flock"
is now supported on more platforms, prefers fcntl to lockf when
emulating, and always flushes before (un)locking.
.IP "printf and sprintf" 4
.IX Item "printf and sprintf"
Perl now implements these functions itself; it doesn't use the C
library function \fIsprintf()\fR any more, except for floating-point
numbers, and even then only known flags are allowed.  As a result, it
is now possible to know which conversions and flags will work, and
what they will do.
.Sp
The new conversions in Perl's \fIsprintf()\fR are:
.Sp
.Vb 4
\&   %i   a synonym for %d
\&   %p   a pointer (the address of the Perl value, in hexadecimal)
\&   %n   special: *stores* the number of characters output so far
\&        into the next variable in the parameter list
.Ve
.Sp
The new flags that go between the \f(CW\*(C`%\*(C'\fR and the conversion are:
.Sp
.Vb 3
\&   #    prefix octal with "0", hex with "0x"
\&   h    interpret integer as C type "short" or "unsigned short"
\&   V    interpret integer as Perl's standard integer type
.Ve
.Sp
Also, where a number would appear in the flags, an asterisk (\*(L"*\*(R") may
be used instead, in which case Perl uses the next item in the
parameter list as the given number (that is, as the field width or
precision).  If a field width obtained through \*(L"*\*(R" is negative, it has
the same effect as the '\-' flag: left\-justification.
.Sp
See \*(L"sprintf\*(R" in perlfunc for a complete list of conversion and flags.
.IP "keys as an lvalue" 4
.IX Item "keys as an lvalue"
As an lvalue, \f(CW\*(C`keys\*(C'\fR allows you to increase the number of hash buckets
allocated for the given hash.  This can gain you a measure of efficiency if
you know the hash is going to get big.  (This is similar to pre-extending
an array by assigning a larger number to $#array.)  If you say
.Sp
.Vb 1
\&    keys %hash = 200;
.Ve
.Sp
then \f(CW%hash\fR will have at least 200 buckets allocated for it.  These
buckets will be retained even if you do \f(CW\*(C`%hash = ()\*(C'\fR; use \f(CW\*(C`undef
%hash\*(C'\fR if you want to free the storage while \f(CW%hash\fR is still in scope.
You can't shrink the number of buckets allocated for the hash using
\&\f(CW\*(C`keys\*(C'\fR in this way (but you needn't worry about doing this by accident,
as trying has no effect).
.IP "\fImy()\fR in Control Structures" 4
.IX Item "my() in Control Structures"
You can now use \fImy()\fR (with or without the parentheses) in the control
expressions of control structures such as:
.Sp
.Vb 5
\&    while (defined(my $line = <>)) {
\&        $line = lc $line;
\&    } continue {
\&        print $line;
\&    }
.Ve
.Sp
.Vb 8
\&    if ((my $answer = <STDIN>) =~ /^y(es)?$/i) {
\&        user_agrees();
\&    } elsif ($answer =~ /^n(o)?$/i) {
\&        user_disagrees();
\&    } else {
\&        chomp $answer;
\&        die "`$answer' is neither `yes' nor `no'";
\&    }
.Ve
.Sp
Also, you can declare a foreach loop control variable as lexical by
preceding it with the word \*(L"my\*(R".  For example, in:
.Sp
.Vb 3
\&    foreach my $i (1, 2, 3) {
\&        some_function();
\&    }
.Ve
.Sp
$i is a lexical variable, and the scope of \f(CW$i\fR extends to the end of
the loop, but not beyond it.
.Sp
Note that you still cannot use \fImy()\fR on global punctuation variables
such as \f(CW$_\fR and the like.
.IP "\fIpack()\fR and \fIunpack()\fR" 4
.IX Item "pack() and unpack()"
A new format 'w' represents a \s-1BER\s0 compressed integer (as defined in
\&\s-1ASN\s0.1).  Its format is a sequence of one or more bytes, each of which
provides seven bits of the total value, with the most significant
first.  Bit eight of each byte is set, except for the last byte, in
which bit eight is clear.
.Sp
If 'p' or 'P' are given undef as values, they now generate a \s-1NULL\s0
pointer.
.Sp
Both \fIpack()\fR and \fIunpack()\fR now fail when their templates contain invalid
types.  (Invalid types used to be ignored.)
.IP "\fIsysseek()\fR" 4
.IX Item "sysseek()"
The new \fIsysseek()\fR operator is a variant of \fIseek()\fR that sets and gets the
file's system read/write position, using the \fIlseek\fR\|(2) system call.  It is
the only reliable way to seek before using \fIsysread()\fR or \fIsyswrite()\fR.  Its
return value is the new position, or the undefined value on failure.
.IP "use \s-1VERSION\s0" 4
.IX Item "use VERSION"
If the first argument to \f(CW\*(C`use\*(C'\fR is a number, it is treated as a version
number instead of a module name.  If the version of the Perl interpreter
is less than \s-1VERSION\s0, then an error message is printed and Perl exits
immediately.  Because \f(CW\*(C`use\*(C'\fR occurs at compile time, this check happens
immediately during the compilation process, unlike \f(CW\*(C`require VERSION\*(C'\fR,
which waits until runtime for the check.  This is often useful if you
need to check the current Perl version before \f(CW\*(C`use\*(C'\fRing library modules
which have changed in incompatible ways from older versions of Perl.
(We try not to do this more than we have to.)
.IP "use Module \s-1VERSION\s0 \s-1LIST\s0" 4
.IX Item "use Module VERSION LIST"
If the \s-1VERSION\s0 argument is present between Module and \s-1LIST\s0, then the
\&\f(CW\*(C`use\*(C'\fR will call the \s-1VERSION\s0 method in class Module with the given
version as an argument.  The default \s-1VERSION\s0 method, inherited from
the \s-1UNIVERSAL\s0 class, croaks if the given version is larger than the
value of the variable \f(CW$Module::VERSION\fR.  (Note that there is not a
comma after \s-1VERSION\s0!)
.Sp
This version-checking mechanism is similar to the one currently used
in the Exporter module, but it is faster and can be used with modules
that don't use the Exporter.  It is the recommended method for new
code.
.IP "prototype(\s-1FUNCTION\s0)" 4
.IX Item "prototype(FUNCTION)"
Returns the prototype of a function as a string (or \f(CW\*(C`undef\*(C'\fR if the
function has no prototype).  \s-1FUNCTION\s0 is a reference to or the name of the
function whose prototype you want to retrieve.
(Not actually new; just never documented before.)
.IP "srand" 4
.IX Item "srand"
The default seed for \f(CW\*(C`srand\*(C'\fR, which used to be \f(CW\*(C`time\*(C'\fR, has been changed.
Now it's a heady mix of difficult-to-predict system-dependent values,
which should be sufficient for most everyday purposes.
.Sp
Previous to version 5.004, calling \f(CW\*(C`rand\*(C'\fR without first calling \f(CW\*(C`srand\*(C'\fR
would yield the same sequence of random numbers on most or all machines.
Now, when perl sees that you're calling \f(CW\*(C`rand\*(C'\fR and haven't yet called
\&\f(CW\*(C`srand\*(C'\fR, it calls \f(CW\*(C`srand\*(C'\fR with the default seed. You should still call
\&\f(CW\*(C`srand\*(C'\fR manually if your code might ever be run on a pre\-5.004 system,
of course, or if you want a seed other than the default.
.IP "$_ as Default" 4
.IX Item "$_ as Default"
Functions documented in the Camel to default to \f(CW$_\fR now in
fact do, and all those that do are so documented in perlfunc.
.ie n .IP """m//gc"" does not reset search position on failure" 4
.el .IP "\f(CWm//gc\fR does not reset search position on failure" 4
.IX Item "m//gc does not reset search position on failure"
The \f(CW\*(C`m//g\*(C'\fR match iteration construct has always reset its target
string's search position (which is visible through the \f(CW\*(C`pos\*(C'\fR operator)
when a match fails; as a result, the next \f(CW\*(C`m//g\*(C'\fR match after a failure
starts again at the beginning of the string.  With Perl 5.004, this
reset may be disabled by adding the \*(L"c\*(R" (for \*(L"continue\*(R") modifier,
i.e. \f(CW\*(C`m//gc\*(C'\fR.  This feature, in conjunction with the \f(CW\*(C`\eG\*(C'\fR zero-width
assertion, makes it possible to chain matches together.  See perlop
and perlre.
.ie n .IP """m//x"" ignores whitespace before ?*+{}" 4
.el .IP "\f(CWm//x\fR ignores whitespace before ?*+{}" 4
.IX Item "m//x ignores whitespace before ?*+{}"
The \f(CW\*(C`m//x\*(C'\fR construct has always been intended to ignore all unescaped
whitespace.  However, before Perl 5.004, whitespace had the effect of
escaping repeat modifiers like \*(L"*\*(R" or \*(L"?\*(R"; for example, \f(CW\*(C`/a *b/x\*(C'\fR was
(mis)interpreted as \f(CW\*(C`/a\e*b/x\*(C'\fR.  This bug has been fixed in 5.004.
.ie n .IP "nested ""sub{}"" closures work now" 4
.el .IP "nested \f(CWsub{}\fR closures work now" 4
.IX Item "nested sub{} closures work now"
Prior to the 5.004 release, nested anonymous functions didn't work
right.  They do now.
.IP "formats work right on changing lexicals" 4
.IX Item "formats work right on changing lexicals"
Just like anonymous functions that contain lexical variables
that change (like a lexical index variable for a \f(CW\*(C`foreach\*(C'\fR loop),
formats now work properly.  For example, this silently failed
before (printed only zeros), but is fine now:
.Sp
.Vb 8
\&    my $i;
\&    foreach $i ( 1 .. 10 ) {
\&        write;
\&    }
\&    format =
\&        my i is @#
\&        $i
\&    .
.Ve
.Sp
However, it still fails (without a warning) if the foreach is within a
subroutine:
.Sp
.Vb 11
\&    my $i;
\&    sub foo {
\&      foreach $i ( 1 .. 10 ) {
\&        write;
\&      }
\&    }
\&    foo;
\&    format =
\&        my i is @#
\&        $i
\&    .
.Ve
.Sh "New builtin methods"
.IX Subsection "New builtin methods"
The \f(CW\*(C`UNIVERSAL\*(C'\fR package automatically contains the following methods that
are inherited by all other classes:
.IP "isa(\s-1CLASS\s0)" 4
.IX Item "isa(CLASS)"
\&\f(CW\*(C`isa\*(C'\fR returns \fItrue\fR if its object is blessed into a subclass of \f(CW\*(C`CLASS\*(C'\fR
.Sp
\&\f(CW\*(C`isa\*(C'\fR is also exportable and can be called as a sub with two arguments. This
allows the ability to check what a reference points to. Example:
.Sp
.Vb 1
\&    use UNIVERSAL qw(isa);
.Ve
.Sp
.Vb 3
\&    if(isa($ref, 'ARRAY')) {
\&       ...
\&    }
.Ve
.IP "can(\s-1METHOD\s0)" 4
.IX Item "can(METHOD)"
\&\f(CW\*(C`can\*(C'\fR checks to see if its object has a method called \f(CW\*(C`METHOD\*(C'\fR,
if it does then a reference to the sub is returned; if it does not then
\&\fIundef\fR is returned.
.IP "\s-1VERSION\s0( [\s-1NEED\s0] )" 4
.IX Item "VERSION( [NEED] )"
\&\f(CW\*(C`VERSION\*(C'\fR returns the version number of the class (package).  If the
\&\s-1NEED\s0 argument is given then it will check that the current version (as
defined by the \f(CW$VERSION\fR variable in the given package) not less than
\&\s-1NEED\s0; it will die if this is not the case.  This method is normally
called as a class method.  This method is called automatically by the
\&\f(CW\*(C`VERSION\*(C'\fR form of \f(CW\*(C`use\*(C'\fR.
.Sp
.Vb 3
\&    use A 1.2 qw(some imported subs);
\&    # implies:
\&    A->VERSION(1.2);
.Ve
.PP
\&\fB\s-1NOTE:\s0\fR \f(CW\*(C`can\*(C'\fR directly uses Perl's internal code for method lookup, and
\&\f(CW\*(C`isa\*(C'\fR uses a very similar method and caching strategy. This may cause
strange effects if the Perl code dynamically changes \f(CW@ISA\fR in any package.
.PP
You may add other methods to the \s-1UNIVERSAL\s0 class via Perl or \s-1XS\s0 code.
You do not need to \f(CW\*(C`use UNIVERSAL\*(C'\fR in order to make these methods
available to your program.  This is necessary only if you wish to
have \f(CW\*(C`isa\*(C'\fR available as a plain subroutine in the current package.
.Sh "\s-1TIEHANDLE\s0 now supported"
.IX Subsection "TIEHANDLE now supported"
See perltie for other kinds of \fItie()\fRs.
.IP "\s-1TIEHANDLE\s0 classname, \s-1LIST\s0" 4
.IX Item "TIEHANDLE classname, LIST"
This is the constructor for the class.  That means it is expected to
return an object of some sort. The reference can be used to
hold some internal information.
.Sp
.Vb 5
\&    sub TIEHANDLE {
\&        print "<shout>\en";
\&        my $i;
\&        return bless \e$i, shift;
\&    }
.Ve
.IP "\s-1PRINT\s0 this, \s-1LIST\s0" 4
.IX Item "PRINT this, LIST"
This method will be triggered every time the tied handle is printed to.
Beyond its self reference it also expects the list that was passed to
the print function.
.Sp
.Vb 5
\&    sub PRINT {
\&        $r = shift;
\&        $$r++;
\&        return print join( $, => map {uc} @_), $\e;
\&    }
.Ve
.IP "\s-1PRINTF\s0 this, \s-1LIST\s0" 4
.IX Item "PRINTF this, LIST"
This method will be triggered every time the tied handle is printed to
with the \f(CW\*(C`printf()\*(C'\fR function.
Beyond its self reference it also expects the format and list that was
passed to the printf function.
.Sp
.Vb 5
\&    sub PRINTF {
\&        shift;
\&          my $fmt = shift;
\&        print sprintf($fmt, @_)."\en";
\&    }
.Ve
.IP "\s-1READ\s0 this \s-1LIST\s0" 4
.IX Item "READ this LIST"
This method will be called when the handle is read from via the \f(CW\*(C`read\*(C'\fR
or \f(CW\*(C`sysread\*(C'\fR functions.
.Sp
.Vb 5
\&    sub READ {
\&        $r = shift;
\&        my($buf,$len,$offset) = @_;
\&        print "READ called, \e$buf=$buf, \e$len=$len, \e$offset=$offset";
\&    }
.Ve
.IP "\s-1READLINE\s0 this" 4
.IX Item "READLINE this"
This method will be called when the handle is read from. The method
should return undef when there is no more data.
.Sp
.Vb 4
\&    sub READLINE {
\&        $r = shift;
\&        return "PRINT called $$r times\en"
\&    }
.Ve
.IP "\s-1GETC\s0 this" 4
.IX Item "GETC this"
This method will be called when the \f(CW\*(C`getc\*(C'\fR function is called.
.Sp
.Vb 1
\&    sub GETC { print "Don't GETC, Get Perl"; return "a"; }
.Ve
.IP "\s-1DESTROY\s0 this" 4
.IX Item "DESTROY this"
As with the other types of ties, this method will be called when the
tied handle is about to be destroyed. This is useful for debugging and
possibly for cleaning up.
.Sp
.Vb 3
\&    sub DESTROY {
\&        print "</shout>\en";
\&    }
.Ve
.Sh "Malloc enhancements"
.IX Subsection "Malloc enhancements"
If perl is compiled with the malloc included with the perl distribution
(that is, if \f(CW\*(C`perl \-V:d_mymalloc\*(C'\fR is 'define') then you can print
memory statistics at runtime by running Perl thusly:
.PP
.Vb 1
\&  env PERL_DEBUG_MSTATS=2 perl your_script_here
.Ve
.PP
The value of 2 means to print statistics after compilation and on
exit; with a value of 1, the statistics are printed only on exit.
(If you want the statistics at an arbitrary time, you'll need to
install the optional module Devel::Peek.)
.PP
Three new compilation flags are recognized by malloc.c.  (They have no
effect if perl is compiled with system \fImalloc()\fR.)
.IP "\-DPERL_EMERGENCY_SBRK" 4
.IX Item "-DPERL_EMERGENCY_SBRK"
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 \f(CW$^M\fR.  See \*(L"$^M\*(R".
.IP "\-DPACK_MALLOC" 4
.IX Item "-DPACK_MALLOC"
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 \f(CW\*(C`PACK_MALLOC\*(C'\fR 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).
.Sp
Expected memory savings (with 8\-byte alignment in \f(CW\*(C`alignbytes\*(C'\fR) 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).
.IP "\-DTWO_POT_OPTIMIZE" 4
.IX Item "-DTWO_POT_OPTIMIZE"
Similarly to \f(CW\*(C`PACK_MALLOC\*(C'\fR, 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.
.Sp
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.
.Sp
Expected saving of memory is 0\-100% (100% in applications which
require most memory in such 2**n chunks); expected slowdown is
negligible.
.Sh "Miscellaneous efficiency enhancements"
.IX Subsection "Miscellaneous efficiency enhancements"
Functions that have an empty prototype and that do nothing but return
a fixed value are now inlined (e.g. \f(CW\*(C`sub PI () { 3.14159 }\*(C'\fR).
.PP
Each unique hash key is only allocated once, no matter how many hashes
have an entry with that key.  So even if you have 100 copies of the
same hash, the hash keys never have to be reallocated.
.SH "Support for More Operating Systems"
.IX Header "Support for More Operating Systems"
Support for the following operating systems is new in Perl 5.004.
.Sh "Win32"
.IX Subsection "Win32"
Perl 5.004 now includes support for building a \*(L"native\*(R" perl under
Windows \s-1NT\s0, using the Microsoft Visual \*(C+ compiler (versions 2.0
and above) or the Borland \*(C+ compiler (versions 5.02 and above).
The resulting perl can be used under Windows 95 (if it
is installed in the same directory locations as it got installed
in Windows \s-1NT\s0).  This port includes support for perl extension
building tools like MakeMaker and h2xs, so that many extensions
available on the Comprehensive Perl Archive Network (\s-1CPAN\s0) can now be
readily built under Windows \s-1NT\s0.  See http://www.perl.com/ for more
information on \s-1CPAN\s0 and \fI\s-1README\s0.win32\fR in the perl distribution for more
details on how to get started with building this port.
.PP
There is also support for building perl under the Cygwin32 environment.
Cygwin32 is a set of \s-1GNU\s0 tools that make it possible to compile and run
many Unix programs under Windows \s-1NT\s0 by providing a mostly Unix-like 
interface for compilation and execution.  See \fI\s-1README\s0.cygwin32\fR in the
perl distribution for more details on this port and how to obtain the
Cygwin32 toolkit.
.Sh "Plan 9"
.IX Subsection "Plan 9"
See \fI\s-1README\s0.plan9\fR in the perl distribution.
.Sh "\s-1QNX\s0"
.IX Subsection "QNX"
See \fI\s-1README\s0.qnx\fR in the perl distribution.
.Sh "AmigaOS"
.IX Subsection "AmigaOS"
See \fI\s-1README\s0.amigaos\fR in the perl distribution.
.SH "Pragmata"
.IX Header "Pragmata"
Six new pragmatic modules exist:
.IP "use autouse \s-1MODULE\s0 => qw(sub1 sub2 sub3)" 4
.IX Item "use autouse MODULE => qw(sub1 sub2 sub3)"
Defers \f(CW\*(C`require MODULE\*(C'\fR until someone calls one of the specified
subroutines (which must be exported by \s-1MODULE\s0).  This pragma should be
used with caution, and only when necessary.
.IP "use blib" 4
.IX Item "use blib"
.PD 0
.IP "use blib 'dir'" 4
.IX Item "use blib 'dir'"
.PD
Looks for MakeMaker-like \fI'blib'\fR directory structure starting in
\&\fIdir\fR (or current directory) and working back up to five levels of
parent directories.
.Sp
Intended for use on command line with \fB\-M\fR option as a way of testing
arbitrary scripts against an uninstalled version of a package.
.IP "use constant \s-1NAME\s0 => \s-1VALUE\s0" 4
.IX Item "use constant NAME => VALUE"
Provides a convenient interface for creating compile-time constants,
See \*(L"Constant Functions\*(R" in perlsub.
.IP "use locale" 4
.IX Item "use locale"
Tells the compiler to enable (or disable) the use of \s-1POSIX\s0 locales for
builtin operations.
.Sp
When \f(CW\*(C`use locale\*(C'\fR is in effect, the current \s-1LC_CTYPE\s0 locale is used
for regular expressions and case mapping; \s-1LC_COLLATE\s0 for string
ordering; and \s-1LC_NUMERIC\s0 for numeric formatting in printf and sprintf
(but \fBnot\fR in print).  \s-1LC_NUMERIC\s0 is always used in write, since
lexical scoping of formats is problematic at best.
.Sp
Each \f(CW\*(C`use locale\*(C'\fR or \f(CW\*(C`no locale\*(C'\fR affects statements to the end of
the enclosing \s-1BLOCK\s0 or, if not inside a \s-1BLOCK\s0, to the end of the
current file.  Locales can be switched and queried with
\&\fIPOSIX::setlocale()\fR.
.Sp
See perllocale for more information.
.IP "use ops" 4
.IX Item "use ops"
Disable unsafe opcodes, or any named opcodes, when compiling Perl code.
.IP "use vmsish" 4
.IX Item "use vmsish"
Enable VMS-specific language features.  Currently, there are three
VMS-specific features available: 'status', which makes \f(CW$?\fR and
\&\f(CW\*(C`system\*(C'\fR return genuine \s-1VMS\s0 status values instead of emulating \s-1POSIX\s0;
\&'exit', which makes \f(CW\*(C`exit\*(C'\fR take a genuine \s-1VMS\s0 status value instead of
assuming that \f(CW\*(C`exit 1\*(C'\fR is an error; and 'time', which makes all times
relative to the local time zone, in the \s-1VMS\s0 tradition.
.SH "Modules"
.IX Header "Modules"
.Sh "Required Updates"
.IX Subsection "Required Updates"
Though Perl 5.004 is compatible with almost all modules that work
with Perl 5.003, there are a few exceptions:
.PP
.Vb 5
\&    Module   Required Version for Perl 5.004
\&    ------   -------------------------------
\&    Filter   Filter-1.12
\&    LWP      libwww-perl-5.08
\&    Tk       Tk400.202 (-w makes noise)
.Ve
.PP
Also, the majordomo mailing list program, version 1.94.1, doesn't work
with Perl 5.004 (nor with perl 4), because it executes an invalid
regular expression.  This bug is fixed in majordomo version 1.94.2.
.Sh "Installation directories"
.IX Subsection "Installation directories"
The \fIinstallperl\fR script now places the Perl source files for
extensions in the architecture-specific library directory, which is
where the shared libraries for extensions have always been.  This
change is intended to allow administrators to keep the Perl 5.004
library directory unchanged from a previous version, without running
the risk of binary incompatibility between extensions' Perl source and
shared libraries.
.Sh "Module information summary"
.IX Subsection "Module information summary"
Brand new modules, arranged by topic rather than strictly
alphabetically:
.PP
.Vb 6
\&    CGI.pm               Web server interface ("Common Gateway Interface")
\&    CGI/Apache.pm        Support for Apache's Perl module
\&    CGI/Carp.pm          Log server errors with helpful context
\&    CGI/Fast.pm          Support for FastCGI (persistent server process)
\&    CGI/Push.pm          Support for server push
\&    CGI/Switch.pm        Simple interface for multiple server types
.Ve
.PP
.Vb 3
\&    CPAN                 Interface to Comprehensive Perl Archive Network
\&    CPAN::FirstTime      Utility for creating CPAN configuration file
\&    CPAN::Nox            Runs CPAN while avoiding compiled extensions
.Ve
.PP
.Vb 7
\&    IO.pm                Top-level interface to IO::* classes
\&    IO/File.pm           IO::File extension Perl module
\&    IO/Handle.pm         IO::Handle extension Perl module
\&    IO/Pipe.pm           IO::Pipe extension Perl module
\&    IO/Seekable.pm       IO::Seekable extension Perl module
\&    IO/Select.pm         IO::Select extension Perl module
\&    IO/Socket.pm         IO::Socket extension Perl module
.Ve
.PP
.Vb 1
\&    Opcode.pm            Disable named opcodes when compiling Perl code
.Ve
.PP
.Vb 2
\&    ExtUtils/Embed.pm    Utilities for embedding Perl in C programs
\&    ExtUtils/testlib.pm  Fixes up @INC to use just-built extension
.Ve
.PP
.Vb 1
\&    FindBin.pm           Find path of currently executing program
.Ve
.PP
.Vb 11
\&    Class/Struct.pm      Declare struct-like datatypes as Perl classes
\&    File/stat.pm         By-name interface to Perl's builtin stat
\&    Net/hostent.pm       By-name interface to Perl's builtin gethost*
\&    Net/netent.pm        By-name interface to Perl's builtin getnet*
\&    Net/protoent.pm      By-name interface to Perl's builtin getproto*
\&    Net/servent.pm       By-name interface to Perl's builtin getserv*
\&    Time/gmtime.pm       By-name interface to Perl's builtin gmtime
\&    Time/localtime.pm    By-name interface to Perl's builtin localtime
\&    Time/tm.pm           Internal object for Time::{gm,local}time
\&    User/grent.pm        By-name interface to Perl's builtin getgr*
\&    User/pwent.pm        By-name interface to Perl's builtin getpw*
.Ve
.PP
.Vb 1
\&    Tie/RefHash.pm       Base class for tied hashes with references as keys
.Ve
.PP
.Vb 1
\&    UNIVERSAL.pm         Base class for *ALL* classes
.Ve
.Sh "Fcntl"
.IX Subsection "Fcntl"
New constants in the existing Fcntl modules are now supported,
provided that your operating system happens to support them:
.PP
.Vb 3
\&    F_GETOWN F_SETOWN
\&    O_ASYNC O_DEFER O_DSYNC O_FSYNC O_SYNC
\&    O_EXLOCK O_SHLOCK
.Ve
.PP
These constants are intended for use with the Perl operators \fIsysopen()\fR
and \fIfcntl()\fR and the basic database modules like SDBM_File.  For the
exact meaning of these and other Fcntl constants please refer to your
operating system's documentation for \fIfcntl()\fR and \fIopen()\fR.
.PP
In addition, the Fcntl module now provides these constants for use
with the Perl operator \fIflock()\fR:
.PP
.Vb 1
\&        LOCK_SH LOCK_EX LOCK_NB LOCK_UN
.Ve
.PP
These constants are defined in all environments (because where there is
no \fIflock()\fR system call, Perl emulates it).  However, for historical
reasons, these constants are not exported unless they are explicitly
requested with the \*(L":flock\*(R" tag (e.g. \f(CW\*(C`use Fcntl ':flock'\*(C'\fR).
.Sh "\s-1IO\s0"
.IX Subsection "IO"
The \s-1IO\s0 module provides a simple mechanism to load all the \s-1IO\s0 modules at one
go.  Currently this includes:
.PP
.Vb 5
\&     IO::Handle
\&     IO::Seekable
\&     IO::File
\&     IO::Pipe
\&     IO::Socket
.Ve
.PP
For more information on any of these modules, please see its
respective documentation.
.Sh "Math::Complex"
.IX Subsection "Math::Complex"
The Math::Complex module has been totally rewritten, and now supports
more operations.  These are overloaded:
.PP
.Vb 1
\&     + - * / ** <=> neg ~ abs sqrt exp log sin cos atan2 "" (stringify)
.Ve
.PP
And these functions are now exported:
.PP
.Vb 11
\&    pi i Re Im arg
\&    log10 logn ln cbrt root
\&    tan
\&    csc sec cot
\&    asin acos atan
\&    acsc asec acot
\&    sinh cosh tanh
\&    csch sech coth
\&    asinh acosh atanh
\&    acsch asech acoth
\&    cplx cplxe
.Ve
.Sh "Math::Trig"
.IX Subsection "Math::Trig"
This new module provides a simpler interface to parts of Math::Complex for
those who need trigonometric functions only for real numbers.
.Sh "DB_File"
.IX Subsection "DB_File"
There have been quite a few changes made to DB_File. Here are a few of
the highlights:
.IP "\(bu" 4
Fixed a handful of bugs.
.IP "\(bu" 4
By public demand, added support for the standard hash function \fIexists()\fR.
.IP "\(bu" 4
Made it compatible with Berkeley \s-1DB\s0 1.86.
.IP "\(bu" 4
Made negative subscripts work with \s-1RECNO\s0 interface.
.IP "\(bu" 4
Changed the default flags from O_RDWR to O_CREAT|O_RDWR and the default
mode from 0640 to 0666.
.IP "\(bu" 4
Made DB_File automatically import the \fIopen()\fR constants (O_RDWR,
O_CREAT etc.) from Fcntl, if available.
.IP "\(bu" 4
Updated documentation.
.PP
Refer to the \s-1HISTORY\s0 section in DB_File.pm for a complete list of
changes. Everything after DB_File 1.01 has been added since 5.003.
.Sh "Net::Ping"
.IX Subsection "Net::Ping"
Major rewrite \- support added for both udp echo and real icmp pings.
.Sh "Object-oriented overrides for builtin operators"
.IX Subsection "Object-oriented overrides for builtin operators"
Many of the Perl builtins returning lists now have
object-oriented overrides.  These are:
.PP
.Vb 9
\&    File::stat
\&    Net::hostent
\&    Net::netent
\&    Net::protoent
\&    Net::servent
\&    Time::gmtime
\&    Time::localtime
\&    User::grent
\&    User::pwent
.Ve
.PP
For example, you can now say
.PP
.Vb 3
\&    use File::stat;
\&    use User::pwent;
\&    $his = (stat($filename)->st_uid == pwent($whoever)->pw_uid);
.Ve
.SH "Utility Changes"
.IX Header "Utility Changes"
.Sh "pod2html"
.IX Subsection "pod2html"
.IP "Sends converted \s-1HTML\s0 to standard output" 4
.IX Item "Sends converted HTML to standard output"
The \fIpod2html\fR utility included with Perl 5.004 is entirely new.
By default, it sends the converted \s-1HTML\s0 to its standard output,
instead of writing it to a file like Perl 5.003's \fIpod2html\fR did.
Use the \fB\-\-outfile=FILENAME\fR option to write to a file.
.Sh "xsubpp"
.IX Subsection "xsubpp"
.ie n .IP """void"" XSUBs now default to returning nothing" 4
.el .IP "\f(CWvoid\fR XSUBs now default to returning nothing" 4
.IX Item "void XSUBs now default to returning nothing"
Due to a documentation/implementation bug in previous versions of
Perl, XSUBs with a return type of \f(CW\*(C`void\*(C'\fR have actually been
returning one value.  Usually that value was the \s-1GV\s0 for the \s-1XSUB\s0,
but sometimes it was some already freed or reused value, which would
sometimes lead to program failure.
.Sp
In Perl 5.004, if an \s-1XSUB\s0 is declared as returning \f(CW\*(C`void\*(C'\fR, it
actually returns no value, i.e. an empty list (though there is a
backward-compatibility exception; see below).  If your \s-1XSUB\s0 really
does return an \s-1SV\s0, you should give it a return type of \f(CW\*(C`SV *\*(C'\fR.
.Sp
For backward compatibility, \fIxsubpp\fR tries to guess whether a
\&\f(CW\*(C`void\*(C'\fR \s-1XSUB\s0 is really \f(CW\*(C`void\*(C'\fR or if it wants to return an \f(CW\*(C`SV *\*(C'\fR.
It does so by examining the text of the \s-1XSUB:\s0 if \fIxsubpp\fR finds
what looks like an assignment to \f(CWST(0)\fR, it assumes that the
\&\s-1XSUB\s0's return type is really \f(CW\*(C`SV *\*(C'\fR.
.SH "C Language API Changes"
.IX Header "C Language API Changes"
.ie n .IP """gv_fetchmethod""\fR and \f(CW""perl_call_sv""" 4
.el .IP "\f(CWgv_fetchmethod\fR and \f(CWperl_call_sv\fR" 4
.IX Item "gv_fetchmethod and perl_call_sv"
The \f(CW\*(C`gv_fetchmethod\*(C'\fR function finds a method for an object, just like
in Perl 5.003.  The \s-1GV\s0 it returns may be a method cache entry.
However, in Perl 5.004, method cache entries are not visible to users;
therefore, they can no longer be passed directly to \f(CW\*(C`perl_call_sv\*(C'\fR.
Instead, you should use the \f(CW\*(C`GvCV\*(C'\fR macro on the \s-1GV\s0 to extract its \s-1CV\s0,
and pass the \s-1CV\s0 to \f(CW\*(C`perl_call_sv\*(C'\fR.
.Sp
The most likely symptom of passing the result of \f(CW\*(C`gv_fetchmethod\*(C'\fR to
\&\f(CW\*(C`perl_call_sv\*(C'\fR is Perl's producing an \*(L"Undefined subroutine called\*(R"
error on the \fIsecond\fR call to a given method (since there is no cache
on the first call).
.ie n .IP """perl_eval_pv""" 4
.el .IP "\f(CWperl_eval_pv\fR" 4
.IX Item "perl_eval_pv"
A new function handy for eval'ing strings of Perl code inside C code.
This function returns the value from the eval statement, which can
be used instead of fetching globals from the symbol table.  See
perlguts, perlembed and perlcall for details and examples.
.IP "Extended \s-1API\s0 for manipulating hashes" 4
.IX Item "Extended API for manipulating hashes"
Internal handling of hash keys has changed.  The old hashtable \s-1API\s0 is
still fully supported, and will likely remain so.  The additions to the
\&\s-1API\s0 allow passing keys as \f(CW\*(C`SV*\*(C'\fRs, so that \f(CW\*(C`tied\*(C'\fR hashes can be given
real scalars as keys rather than plain strings (nontied hashes still
can only use strings as keys).  New extensions must use the new hash
access functions and macros if they wish to use \f(CW\*(C`SV*\*(C'\fR keys.  These
additions also make it feasible to manipulate \f(CW\*(C`HE*\*(C'\fRs (hash entries),
which can be more efficient.  See perlguts for details.
.SH "Documentation Changes"
.IX Header "Documentation Changes"
Many of the base and library pods were updated.  These
new pods are included in section 1:
.IP "perldelta" 4
.IX Item "perldelta"
This document.
.IP "perlfaq" 4
.IX Item "perlfaq"
Frequently asked questions.
.IP "perllocale" 4
.IX Item "perllocale"
Locale support (internationalization and localization).
.IP "perltoot" 4
.IX Item "perltoot"
Tutorial on Perl \s-1OO\s0 programming.
.IP "perlapio" 4
.IX Item "perlapio"
Perl internal \s-1IO\s0 abstraction interface.
.IP "perlmodlib" 4
.IX Item "perlmodlib"
Perl module library and recommended practice for module creation.
Extracted from perlmod (which is much smaller as a result).
.IP "perldebug" 4
.IX Item "perldebug"
Although not new, this has been massively updated.
.IP "perlsec" 4
.IX Item "perlsec"
Although not new, this has been massively updated.
.SH "New Diagnostics"
.IX Header "New Diagnostics"
Several new conditions will trigger warnings that were
silent before.  Some only affect certain platforms.
The following new warnings and errors outline these.
These messages are classified as follows (listed in
increasing order of desperation):
.PP
.Vb 7
\&   (W) A warning (optional).
\&   (D) A deprecation (optional).
\&   (S) A severe warning (mandatory).
\&   (F) A fatal error (trappable).
\&   (P) An internal error you should never see (trappable).
\&   (X) A very fatal error (nontrappable).
\&   (A) An alien error message (not generated by Perl).
.Ve
.ie n .IP """my"" variable %s masks earlier declaration in same scope" 4
.el .IP "``my'' variable \f(CW%s\fR masks earlier declaration in same scope" 4
.IX Item "my variable %s masks earlier declaration in same scope"
(W) A lexical variable has been redeclared in the same scope, effectively
eliminating all access to the previous instance.  This is almost always
a typographical error.  Note that the earlier variable will still exist
until the end of the scope or until all closure referents to it are
destroyed.
.IP "%s argument is not a \s-1HASH\s0 element or slice" 4
.IX Item "%s argument is not a HASH element or slice"
(F) The argument to \fIdelete()\fR must be either a hash element, such as
.Sp
.Vb 2
\&    $foo{$bar}
\&    $ref->[12]->{"susie"}
.Ve
.Sp
or a hash slice, such as
.Sp
.Vb 2
\&    @foo{$bar, $baz, $xyzzy}
\&    @{$ref->[12]}{"susie", "queue"}
.Ve
.ie n .IP "Allocation too large: %lx" 4
.el .IP "Allocation too large: \f(CW%lx\fR" 4
.IX Item "Allocation too large: %lx"
(X) You can't allocate more than 64K on an MS-DOS machine.
.IP "Allocation too large" 4
.IX Item "Allocation too large"
(F) You can't allocate more than 2^31+\*(L"small amount\*(R" bytes.
.ie n .IP "Applying %s\fR to \f(CW%s will act on scalar(%s)" 4
.el .IP "Applying \f(CW%s\fR to \f(CW%s\fR will act on scalar(%s)" 4
.IX Item "Applying %s to %s will act on scalar(%s)"
(W) The pattern match (//), substitution (s///), and transliteration (tr///)
operators work on scalar values.  If you apply one of them to an array
or a hash, it will convert the array or hash to a scalar value \*(-- the
length of an array, or the population info of a hash \*(-- and then work on
that scalar value.  This is probably not what you meant to do.  See
\&\*(L"grep\*(R" in perlfunc and \*(L"map\*(R" in perlfunc for alternatives.
.IP "Attempt to free nonexistent shared string" 4
.IX Item "Attempt to free nonexistent shared string"
(P) Perl maintains a reference counted internal table of strings to
optimize the storage and access of hash keys and other strings.  This
indicates someone tried to decrement the reference count of a string
that can no longer be found in the table.
.IP "Attempt to use reference as lvalue in substr" 4
.IX Item "Attempt to use reference as lvalue in substr"
(W) You supplied a reference as the first argument to \fIsubstr()\fR used
as an lvalue, which is pretty strange.  Perhaps you forgot to
dereference it first.  See \*(L"substr\*(R" in perlfunc.
.ie n .IP "Bareword ""%s"" refers to nonexistent package" 4
.el .IP "Bareword ``%s'' refers to nonexistent package" 4
.IX Item "Bareword %s refers to nonexistent package"
(W) You used a qualified bareword of the form \f(CW\*(C`Foo::\*(C'\fR, but
the compiler saw no other uses of that namespace before that point.
Perhaps you need to predeclare a package?
.ie n .IP "Can't redefine active sort subroutine %s" 4
.el .IP "Can't redefine active sort subroutine \f(CW%s\fR" 4
.IX Item "Can't redefine active sort subroutine %s"
(F) Perl optimizes the internal handling of sort subroutines and keeps
pointers into them.  You tried to redefine one such sort subroutine when it
was currently active, which is not allowed.  If you really want to do
this, you should write \f(CW\*(C`sort { &func } @x\*(C'\fR instead of \f(CW\*(C`sort func @x\*(C'\fR.
.ie n .IP "Can't use bareword (""%s"") as %s ref while ""strict refs"" in use" 4
.el .IP "Can't use bareword (``%s'') as \f(CW%s\fR ref while ``strict refs'' in use" 4
.IX Item "Can't use bareword (%s) as %s ref while strict refs in use"
(F) Only hard references are allowed by \*(L"strict refs\*(R".  Symbolic references
are disallowed.  See perlref.
.IP "Cannot resolve method `%s' overloading `%s' in package `%s'" 4
.IX Item "Cannot resolve method `%s' overloading `%s' in package `%s'"
(P) Internal error trying to resolve overloading specified by a method
name (as opposed to a subroutine reference).
.ie n .IP "Constant subroutine %s redefined" 4
.el .IP "Constant subroutine \f(CW%s\fR redefined" 4
.IX Item "Constant subroutine %s redefined"
(S) You redefined a subroutine which had previously been eligible for
inlining.  See \*(L"Constant Functions\*(R" in perlsub for commentary and
workarounds.
.ie n .IP "Constant subroutine %s undefined" 4
.el .IP "Constant subroutine \f(CW%s\fR undefined" 4
.IX Item "Constant subroutine %s undefined"
(S) You undefined a subroutine which had previously been eligible for
inlining.  See \*(L"Constant Functions\*(R" in perlsub for commentary and
workarounds.
.IP "Copy method did not return a reference" 4
.IX Item "Copy method did not return a reference"
(F) The method which overloads \*(L"=\*(R" is buggy. See \*(L"Copy Constructor\*(R" in overload.
.IP "Died" 4
.IX Item "Died"
(F) You passed \fIdie()\fR an empty string (the equivalent of \f(CW\*(C`die ""\*(C'\fR) or
you called it with no args and both \f(CW$@\fR and \f(CW$_\fR were empty.
.ie n .IP "Exiting pseudo-block via %s" 4
.el .IP "Exiting pseudo-block via \f(CW%s\fR" 4
.IX Item "Exiting pseudo-block via %s"
(W) You are exiting a rather special block construct (like a sort block or
subroutine) by unconventional means, such as a goto, or a loop control
statement.  See \*(L"sort\*(R" in perlfunc.
.IP "Identifier too long" 4
.IX Item "Identifier too long"
(F) Perl limits identifiers (names for variables, functions, etc.) to
252 characters for simple names, somewhat more for compound names (like
\&\f(CW$A::B\fR).  You've exceeded Perl's limits.  Future versions of Perl are
likely to eliminate these arbitrary limitations.
.ie n .IP "Illegal character %s (carriage return)" 4
.el .IP "Illegal character \f(CW%s\fR (carriage return)" 4
.IX Item "Illegal character %s (carriage return)"
(F) A carriage return character was found in the input.  This is an
error, and not a warning, because carriage return characters can break
multi-line strings, including here documents (e.g., \f(CW\*(C`print <<EOF;\*(C'\fR).
.ie n .IP "Illegal switch in \s-1PERL5OPT:\s0 %s" 4
.el .IP "Illegal switch in \s-1PERL5OPT:\s0 \f(CW%s\fR" 4
.IX Item "Illegal switch in PERL5OPT: %s"
(X) The \s-1PERL5OPT\s0 environment variable may only be used to set the
following switches: \fB\-[DIMUdmw]\fR.
.IP "Integer overflow in hex number" 4
.IX Item "Integer overflow in hex number"
(S) The literal hex number you have specified is too big for your
architecture. On a 32\-bit architecture the largest hex literal is
0xFFFFFFFF.
.IP "Integer overflow in octal number" 4
.IX Item "Integer overflow in octal number"
(S) The literal octal number you have specified is too big for your
architecture. On a 32\-bit architecture the largest octal literal is
037777777777.
.IP "internal error: glob failed" 4
.IX Item "internal error: glob failed"
(P) Something went wrong with the external program(s) used for \f(CW\*(C`glob\*(C'\fR
and \f(CW\*(C`<*.c>\*(C'\fR.  This may mean that your csh (C shell) is
broken.  If so, you should change all of the csh-related variables in
config.sh:  If you have tcsh, make the variables refer to it as if it
were csh (e.g. \f(CW\*(C`full_csh='/usr/bin/tcsh'\*(C'\fR); otherwise, make them all
empty (except that \f(CW\*(C`d_csh\*(C'\fR should be \f(CW'undef'\fR) so that Perl will
think csh is missing.  In either case, after editing config.sh, run
\&\f(CW\*(C`./Configure \-S\*(C'\fR and rebuild Perl.
.ie n .IP "Invalid conversion in %s: ""%s""" 4
.el .IP "Invalid conversion in \f(CW%s:\fR ``%s''" 4
.IX Item "Invalid conversion in %s: %s"
(W) Perl does not understand the given format conversion.
See \*(L"sprintf\*(R" in perlfunc.
.IP "Invalid type in pack: '%s'" 4
.IX Item "Invalid type in pack: '%s'"
(F) The given character is not a valid pack type.  See \*(L"pack\*(R" in perlfunc.
.IP "Invalid type in unpack: '%s'" 4
.IX Item "Invalid type in unpack: '%s'"
(F) The given character is not a valid unpack type.  See \*(L"unpack\*(R" in perlfunc.
.ie n .IP "Name ""%s::%s"" used only once: possible typo" 4
.el .IP "Name ``%s::%s'' used only once: possible typo" 4
.IX Item "Name %s::%s used only once: possible typo"
(W) Typographical errors often show up as unique variable names.
If you had a good reason for having a unique name, then just mention
it again somehow to suppress the message (the \f(CW\*(C`use vars\*(C'\fR pragma is
provided for just this purpose).
.IP "Null picture in formline" 4
.IX Item "Null picture in formline"
(F) The first argument to formline must be a valid format picture
specification.  It was found to be empty, which probably means you
supplied it an uninitialized value.  See perlform.
.IP "Offset outside string" 4
.IX Item "Offset outside string"
(F) You tried to do a read/write/send/recv operation with an offset
pointing outside the buffer.  This is difficult to imagine.
The sole exception to this is that \f(CW\*(C`sysread()\*(C'\fRing past the buffer
will extend the buffer and zero pad the new area.
.IP "Out of memory!" 4
.IX Item "Out of memory!"
(X|F) The \fImalloc()\fR function returned 0, indicating there was insufficient
remaining memory (or virtual memory) to satisfy the request.
.Sp
The request was judged to be small, so the possibility to trap it
depends on the way Perl was compiled.  By default it is not trappable.
However, if compiled for this, Perl may use the contents of \f(CW$^M\fR as
an emergency pool after \fIdie()\fRing with this message.  In this case the
error is trappable \fIonce\fR.
.ie n .IP "Out of memory during request for %s" 4
.el .IP "Out of memory during request for \f(CW%s\fR" 4
.IX Item "Out of memory during request for %s"
(F) The \fImalloc()\fR function returned 0, indicating there was insufficient
remaining memory (or virtual memory) to satisfy the request. However,
the request was judged large enough (compile\-time default is 64K), so
a possibility to shut down by trapping this error is granted.
.IP "panic: frexp" 4
.IX Item "panic: frexp"
(P) The library function \fIfrexp()\fR failed, making printf(\*(L"%f\*(R") impossible.
.IP "Possible attempt to put comments in \fIqw()\fR list" 4
.IX Item "Possible attempt to put comments in qw() list"
(W) \fIqw()\fR lists contain items separated by whitespace; as with literal
strings, comment characters are not ignored, but are instead treated
as literal data.  (You may have used different delimiters than the
parentheses shown here; braces are also frequently used.)
.Sp
You probably wrote something like this:
.Sp
.Vb 4
\&    @list = qw(
\&        a # a comment
\&        b # another comment
\&    );
.Ve
.Sp
when you should have written this:
.Sp
.Vb 4
\&    @list = qw(
\&        a
\&        b
\&    );
.Ve
.Sp
If you really want comments, build your list the
old-fashioned way, with quotes and commas:
.Sp
.Vb 4
\&    @list = (
\&        'a',    # a comment
\&        'b',    # another comment
\&    );
.Ve
.IP "Possible attempt to separate words with commas" 4
.IX Item "Possible attempt to separate words with commas"
(W) \fIqw()\fR lists contain items separated by whitespace; therefore commas
aren't needed to separate the items. (You may have used different
delimiters than the parentheses shown here; braces are also frequently
used.)
.Sp
You probably wrote something like this:
.Sp
.Vb 1
\&    qw! a, b, c !;
.Ve
.Sp
which puts literal commas into some of the list items.  Write it without
commas if you don't want them to appear in your data:
.Sp
.Vb 1
\&    qw! a b c !;
.Ve
.IP "Scalar value @%s{%s} better written as $%s{%s}" 4
.IX Item "Scalar value @%s{%s} better written as $%s{%s}"
(W) You've used a hash slice (indicated by @) to select a single element of
a hash.  Generally it's better to ask for a scalar value (indicated by $).
The difference is that \f(CW$foo{&bar}\fR always behaves like a scalar, both when
assigning to it and when evaluating its argument, while \f(CW@foo{&bar}\fR behaves
like a list when you assign to it, and provides a list context to its
subscript, which can do weird things if you're expecting only one subscript.
.ie n .IP "Stub found while resolving method `%s' overloading `%s' in %s" 4
.el .IP "Stub found while resolving method `%s' overloading `%s' in \f(CW%s\fR" 4
.IX Item "Stub found while resolving method `%s' overloading `%s' in %s"
(P) Overloading resolution over \f(CW@ISA\fR tree may be broken by importing stubs.
Stubs should never be implicitly created, but explicit calls to \f(CW\*(C`can\*(C'\fR
may break this.
.ie n .IP "Too late for ""\fB\-T\fR"" option" 4
.el .IP "Too late for ``\fB\-T\fR'' option" 4
.IX Item "Too late for ""-T"" option"
(X) The #! line (or local equivalent) in a Perl script contains the
\&\fB\-T\fR option, but Perl was not invoked with \fB\-T\fR in its argument
list.  This is an error because, by the time Perl discovers a \fB\-T\fR in
a script, it's too late to properly taint everything from the
environment.  So Perl gives up.
.ie n .IP "untie attempted while %d inner references still exist" 4
.el .IP "untie attempted while \f(CW%d\fR inner references still exist" 4
.IX Item "untie attempted while %d inner references still exist"
(W) A copy of the object returned from \f(CW\*(C`tie\*(C'\fR (or \f(CW\*(C`tied\*(C'\fR) was still
valid when \f(CW\*(C`untie\*(C'\fR was called.
.ie n .IP "Unrecognized character %s" 4
.el .IP "Unrecognized character \f(CW%s\fR" 4
.IX Item "Unrecognized character %s"
(F) The Perl parser has no idea what to do with the specified character
in your Perl script (or eval).  Perhaps you tried to run a compressed
script, a binary program, or a directory as a Perl program.
.IP "Unsupported function fork" 4
.IX Item "Unsupported function fork"
(F) Your version of executable does not support forking.
.Sp
Note that under some systems, like \s-1OS/2\s0, there may be different flavors of
Perl executables, some of which may support fork, some not. Try changing
the name you call Perl by to \f(CW\*(C`perl_\*(C'\fR, \f(CW\*(C`perl_\|_\*(C'\fR, and so on.
.ie n .IP "Use of ""$$<digit>"" to mean ""${$}<digit>"" is deprecated" 4
.el .IP "Use of ``$$<digit>'' to mean ``${$}<digit>'' is deprecated" 4
.IX Item "Use of $$<digit> to mean ${$}<digit> is deprecated"
(D) Perl versions before 5.004 misinterpreted any type marker followed
by \*(L"$\*(R" and a digit.  For example, \*(L"$$0\*(R" was incorrectly taken to mean
\&\*(L"${$}0\*(R" instead of \*(L"${$0}\*(R".  This bug is (mostly) fixed in Perl 5.004.
.Sp
However, the developers of Perl 5.004 could not fix this bug completely,
because at least two widely-used modules depend on the old meaning of
\&\*(L"$$0\*(R" in a string.  So Perl 5.004 still interprets \*(L"$$<digit>\*(R" in the
old (broken) way inside strings; but it generates this message as a
warning.  And in Perl 5.005, this special treatment will cease.
.ie n .IP "Value of %s\fR can be ""0""; test with \fIdefined()" 4
.el .IP "Value of \f(CW%s\fR can be ``0''; test with \fIdefined()\fR" 4
.IX Item "Value of %s can be 0; test with defined()"
(W) In a conditional expression, you used <\s-1HANDLE\s0>, <*> (glob), \f(CW\*(C`each()\*(C'\fR,
or \f(CW\*(C`readdir()\*(C'\fR as a boolean value.  Each of these constructs can return a
value of \*(L"0\*(R"; that would make the conditional expression false, which is
probably not what you intended.  When using these constructs in conditional
expressions, test their values with the \f(CW\*(C`defined\*(C'\fR operator.
.ie n .IP "Variable ""%s"" may be unavailable" 4
.el .IP "Variable ``%s'' may be unavailable" 4
.IX Item "Variable %s may be unavailable"
(W) An inner (nested) \fIanonymous\fR subroutine is inside a \fInamed\fR
subroutine, and outside that is another subroutine; and the anonymous
(innermost) subroutine is referencing a lexical variable defined in
the outermost subroutine.  For example:
.Sp
.Vb 1
\&   sub outermost { my $a; sub middle { sub { $a } } }
.Ve
.Sp
If the anonymous subroutine is called or referenced (directly or
indirectly) from the outermost subroutine, it will share the variable
as you would expect.  But if the anonymous subroutine is called or
referenced when the outermost subroutine is not active, it will see
the value of the shared variable as it was before and during the
*first* call to the outermost subroutine, which is probably not what
you want.
.Sp
In these circumstances, it is usually best to make the middle
subroutine anonymous, using the \f(CW\*(C`sub {}\*(C'\fR syntax.  Perl has specific
support for shared variables in nested anonymous subroutines; a named
subroutine in between interferes with this feature.
.ie n .IP "Variable ""%s"" will not stay shared" 4
.el .IP "Variable ``%s'' will not stay shared" 4
.IX Item "Variable %s will not stay shared"
(W) An inner (nested) \fInamed\fR subroutine is referencing a lexical
variable defined in an outer subroutine.
.Sp
When the inner subroutine is called, it will probably see the value of
the outer subroutine's variable as it was before and during the
*first* call to the outer subroutine; in this case, after the first
call to the outer subroutine is complete, the inner and outer
subroutines will no longer share a common value for the variable.  In
other words, the variable will no longer be shared.
.Sp
Furthermore, if the outer subroutine is anonymous and references a
lexical variable outside itself, then the outer and inner subroutines
will \fInever\fR share the given variable.
.Sp
This problem can usually be solved by making the inner subroutine
anonymous, using the \f(CW\*(C`sub {}\*(C'\fR syntax.  When inner anonymous subs that
reference variables in outer subroutines are called or referenced,
they are automatically rebound to the current values of such
variables.
.IP "Warning: something's wrong" 4
.IX Item "Warning: something's wrong"
(W) You passed \fIwarn()\fR an empty string (the equivalent of \f(CW\*(C`warn ""\*(C'\fR) or
you called it with no args and \f(CW$_\fR was empty.
.IP "Ill-formed logical name |%s| in prime_env_iter" 4
.IX Item "Ill-formed logical name |%s| in prime_env_iter"
(W) A warning peculiar to \s-1VMS\s0.  A logical name was encountered when preparing
to iterate over \f(CW%ENV\fR which violates the syntactic rules governing logical
names.  Since it cannot be translated normally, it is skipped, and will not
appear in \f(CW%ENV\fR.  This may be a benign occurrence, as some software packages
might directly modify logical name tables and introduce nonstandard names,
or it may indicate that a logical name table has been corrupted.
.IP "Got an error from DosAllocMem" 4
.IX Item "Got an error from DosAllocMem"
(P) An error peculiar to \s-1OS/2\s0.  Most probably you're using an obsolete
version of Perl, and this should not happen anyway.
.IP "Malformed \s-1PERLLIB_PREFIX\s0" 4
.IX Item "Malformed PERLLIB_PREFIX"
(F) An error peculiar to \s-1OS/2\s0.  \s-1PERLLIB_PREFIX\s0 should be of the form
.Sp
.Vb 1
\&    prefix1;prefix2
.Ve
.Sp
or
.Sp
.Vb 1
\&    prefix1 prefix2
.Ve
.Sp
with nonempty prefix1 and prefix2.  If \f(CW\*(C`prefix1\*(C'\fR is indeed a prefix
of a builtin library search path, prefix2 is substituted.  The error
may appear if components are not found, or are too long.  See
\&\*(L"\s-1PERLLIB_PREFIX\s0\*(R" in \fI\s-1README\s0.os2\fR.
.IP "\s-1PERL_SH_DIR\s0 too long" 4
.IX Item "PERL_SH_DIR too long"
(F) An error peculiar to \s-1OS/2\s0. \s-1PERL_SH_DIR\s0 is the directory to find the
\&\f(CW\*(C`sh\*(C'\fR\-shell in.  See \*(L"\s-1PERL_SH_DIR\s0\*(R" in \fI\s-1README\s0.os2\fR.
.IP "Process terminated by SIG%s" 4
.IX Item "Process terminated by SIG%s"
(W) This is a standard message issued by \s-1OS/2\s0 applications, while *nix
applications die in silence.  It is considered a feature of the \s-1OS/2\s0
port.  One can easily disable this by appropriate sighandlers, see
\&\*(L"Signals\*(R" in perlipc.  See also \*(L"Process terminated by \s-1SIGTERM/SIGINT\s0\*(R"
in \fI\s-1README\s0.os2\fR.
.SH "BUGS"
.IX Header "BUGS"
If you find what you think is a bug, you might check the headers of
recently posted articles in the comp.lang.perl.misc newsgroup.
There may also be information at http://www.perl.com/perl/ , the Perl
Home Page.
.PP
If you believe you have an unreported bug, please run the \fBperlbug\fR
program included with your release.  Make sure you trim your bug down
to a tiny but sufficient test case.  Your bug report, along with the
output of \f(CW\*(C`perl \-V\*(C'\fR, will be sent off to <\fIperlbug@perl.com\fR> to be
analysed by the Perl porting team.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
The \fIChanges\fR file for exhaustive details on what changed.
.PP
The \fI\s-1INSTALL\s0\fR file for how to build Perl.  This file has been
significantly updated for 5.004, so even veteran users should
look through it.
.PP
The \fI\s-1README\s0\fR file for general stuff.
.PP
The \fICopying\fR file for copyright information.
.SH "HISTORY"
.IX Header "HISTORY"
Constructed by Tom Christiansen, grabbing material with permission
from innumerable contributors, with kibitzing by more than a few Perl
porters.
.PP
Last update: Wed May 14 11:14:09 \s-1EDT\s0 1997

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.