These messages are classified as follows (listed in increasing order of
desperation):

(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 (non-trappable).
(A) An alien error message (not generated by Perl).

Optional warnings are enabled by using the
-w
switch. Warnings may
be captured by setting $^
Q to a reference to a routine that will be
called on each warning instead of printing it. See
the perlvar manpage
.
Trappable errors may be trapped using the eval operator. See
eval
.

Some of these messages are generic. Spots that vary are denoted with a
%s
,
just as in a printf format. Note that some message start with a
%s
!
The symbols "%-?@ sort before the letters, while [ and \ sort after.

(W) You've run afoul of the rule that says that any list operator followed
by parentheses turns into a function, with all the list operators arguments
found inside the parens. See
Terms and List Operators (Leftward)
.

(F) A required (or used) file must return a true value to indicate that
it compiled correctly and ran its initialization code correctly. It's
traditional to end such a file with a ``1;'', though any true value would
do. See
require
.

(S) The Perl lexer knows whether to expect a term or an operator. If it
sees what it knows to be a term when it was expecting to see an operator,
it gives you this warning. Usually it indicates that an operator or
delimiter was omitted, such as a semicolon.

(W) Mortalized values are supposed to be freed by the free_tmps()
routine. This indicates that something else is freeing the SV before
the free_tmps() routine gets a chance, which means that the free_tmps()
routine will be freeing an unreferenced scalar when it does try to free
it.

(W) Perl went to decrement the reference count of a scalar to see if it
would go to 0, and discovered that it had already gone to 0 earlier,
and should have been freed, and in fact, probably was freed. This
could indicate that SvREFCNT_dec() was called too many times, or that
SvREFCNT_inc() was called too few times, or that the SV was mortalized
when it shouldn't have been, or that memory has been corrupted.

(F) A ``last'' statement was executed to break out of the current block,
except that there's this itty bitty problem called there isn't a
current block. Note that an ``if'' or ``else'' block doesn't count as a
``loopish'' block. You can usually double the curlies to get the same
effect though, since the inner curlies will be considered a block
that loops once. See
last
.

Can't ``next'' outside a block

(F) A ``next'' statement was executed to reiterate the current block, but
there isn't a current block. Note that an ``if'' or ``else'' block doesn't
count as a ``loopish'' block. You can usually double the curlies to get
the same effect though, since the inner curlies will be considered a block
that loops once. See
last
.

Can't ``redo'' outside a block

(F) A ``redo'' statement was executed to restart the current block, but
there isn't a current block. Note that an ``if'' or ``else'' block doesn't
count as a ``loopish'' block. You can usually double the curlies to get
the same effect though, since the inner curlies will be considered a block
that loops once. See
last
.

Can't bless non-reference value

(F) Only hard references may be blessed. This is how Perl ``enforces''
encapsulation of objects. See
the perlobj manpage
.

(F) A method call must know what package it's supposed to run in. It
ordinarily finds this out from the object reference you supply, but
you didn't supply an object reference in this case. A reference isn't
an object reference until it has been blessed. See
the perlobj manpage
.

(F) You used the syntax of a method call, but the slot filled by the
object reference or package name contains an expression that returns
neither an object reference nor a package name. (Perhaps it's null?)
Something like this will reproduce the error:

(F) This typically means that ordinary perl tried to exec suidperl to
do setuid emulation, but couldn't exec it. It looks for a name of the
form sperl5.000 in the same directory that the perl executable resides
under the name perl5.000, typically /usr/local/bin on Unix machines.
If the file is there, check the execute permissions. If it isn't, ask
your sysadmin why he and/or she removed it.

(W) An
system()
,
exec()
or piped open call could not execute the named
program for the indicated reason. Typical reasons include: the permissions
were wrong on the file, the file wasn't found in $ENV{PATH}, the
executable in question was compiled for another architecture, or the
#! line in a script points to an interpreter that can't be run for
similar reasons. (Or maybe your system doesn't support #! at all.)

(F) Perl strings can stretch over multiple lines. This message means that
the closing delimiter was omitted. Since bracketed quotes count nesting
levels, the following is missing its final parenthesis:

(S) A warning peculiar to VMS. This arises because of the difference between
access checks under VMS and under the Unix model Perl assumes. Under VMS,
access checks are done by filename, rather than by bits in the stat buffer, so
that ACLs and other protections can be taken into account. Unfortunately, Perl
assumes that the stat buffer contains all the necessary information, and passes
it, instead of the filespec, to the access checking routine. It will try to
retrieve the filespec using the device name and FID present in the stat buffer,
but this works only if you haven't made a subsequent call to the CRTL
stat()
routine, since the device name is overwritten with each call. If this warning
appears, the name lookup failed, and the access checking routine gave up and
returned FALSE, just to be conservative. (Note: The access checking routine
knows about the Perl
stat
operator and file tests, so you shouldn't ever
see this warning in response to a Perl command; it arises only if some internal
code takes stat buffers lightly.)

(F) The deeply magical ``goto subroutine'' call can only replace one subroutine
call for another. It can't manufacture one out of whole cloth. In general
you should only be calling it out of an AUTOLOAD routine anyway. See
goto
.

(F) You said something like
local
$$
ref
, which is not allowed because
the compiler can't determine whether $ref will end up pointing to anything
with a symbol table entry, and a symbol table entry is necessary to
do a local.

(F) You used local on a variable name that was previous declared as a
lexical variable using ``my''. This is not allowed. If you want to
localize a package variable of the same name, qualify it with the
package name.

(F) You said to do (or require, or use) a file that couldn't be found
in any of the libraries mentioned in
@INC
. Perhaps you need to set
the PERL5LIB environment variable to say where the extra library is,
or maybe the script needs to add the library name to
@INC
. Or maybe
you just misspelled the name of the file. See
require
.

(F) You called a method correctly, and it correctly indicated a package
functioning as a class, but that package doesn't define that particular
method, nor does any of it's base classes. See
the perlobj manpage
.

(W) You tried to say
open(CMD, ``|cmd|'')
, which is not supported. You can
try any of several modules in the Perl library to do this, such as
``open2.pl''. Alternately, direct the pipe's output to a file using ``>'',
and then read it in under a different file handle.

(F) You can't undefine a routine that's currently running. You can,
however, redefine it while it's running, and you can even undef the
redefined subroutine while the old routine is running. Go figure.

(P) The internal sv_upgrade routine adds ``members'' to an SV, making
it into a more specialized kind of SV. The top several SV types are
so specialized, however, that they cannot be interconverted. This
message indicates that such a conversion was attempted.

(F) You've mixed up your reference types. You have to dereference a
reference of the type needed. You can use the
ref()
function to
test the type of the reference, if need be.

Can't use \1 to mean $1 in expression

(W) In an ordinary expression, backslash is a unary operator that creates
a reference to its argument. The use of backslash to indicate a backreference
to a matched substring is only valid as part of a regular expression pattern.
Trying to do this in ordinary Perl code produces a value that prints
out looking like SCALAR(0xdecaf). Use the $1 form instead.

(F) You tried to declare a magical variable as a lexical variable. This is
not allowed, because the magic can only be tied to one location (namely
the global variable) and it would be incredibly confusing to have
variables in your program that looked like magical variables but
weren't.

(F) You tried to repeat a constant value (often the undefined value) with
an assignment operator, which implies modifying the value itself.
Perhaps you need to copy the value to a temporary, and repeat that.

(W) This subroutine has called itself (directly or indirectly) 100
times than it has returned. This probably indicates an infinite
recursion, unless you're writing strange benchmark programs, in which
case it indicates something else.

(S) This is an educated guess made in conjunction with the message "
%s
found where operator expected". It often means a subroutine or module
name is being referenced that hasn't been declared yet. This may be
because of ordering problems in your file, or because of a missing
``sub'', ``package'', ``require'', or ``use'' statement. If you're
referencing something that isn't defined yet, you don't actually have
to define the subroutine or package before the current location. You
can use an empty ``sub foo;'' or ``package FOO;'' to enter a ``forward''
declaration.

(S) There is no keyword ``elseif'' in Perl because Larry thinks it's
ugly. Your code will be interpreted as an attempt to call a method
named ``elseif'' for the class returned by the following block. This is
unlikely to be what you want.

END failed--cleanup aborted

(F) An untrapped exception was raised while executing an END subroutine.
The interpreter is immediately exited.

(F) An error peculiar to VMS. Since Perl may have to deal with file
specifications in either VMS or Unix syntax, it converts them to a
single form when it must operate on them directly. Either you've
passed an invalid file specification to Perl, or you've found a
case the conversion routines don't handle. Drat.

(P) An error peculiar to VMS. Something untoward happened in a VMS system
service or RTL routine; Perl's exit status should provide more details. The
filename in ``at
%s
'' and the line number in ``line %d'' tell you which section of
the Perl source code is distressed.

(W) You tried to write on a read-only filehandle. If you
intended it to be a read-write filehandle, you needed to open it with
``+<'' or ``+>'' or ``+>>'' instead of with ``<'' or nothing. If you only
intended to write the file, use ``>'' or ``>>''. See
open
.

(W) You tried to write on a read-only filehandle. If you
intended it to be a read-write filehandle, you needed to open it with
``+<'' or ``+>'' or ``+>>'' instead of with ``<'' or nothing. If you only
intended to write the file, use ``>'' or ``>>''. See
open
.

Final $ should be \$ or $name

(F) You must now decide whether the final $ in a string was meant to be
a literal dollar sign, or was meant to introduce a variable name
that happens to be missing. So you have to put either the backslash or
the name.

Final @ should be \@ or @name

(F) You must now decide whether the final @ in a string was meant to be
a literal ``at'' sign, or was meant to introduce a variable name
that happens to be missing. So you have to put either the backslash or
the name.

(F) The lexer saw a left angle bracket in a place where it was expecting
a term, so it's looking for the corresponding right angle bracket, and not
finding it. Chances are you left some needed parentheses out earlier in
the line, and you really meant a ``less than''.

(F) You've said ``use strict vars'', which indicates that all variables must
either be lexically scoped (using ``my''), or explicitly qualified to
say which package the global variable is in (using ``::'').

(F) You tried to do something that the tainting mechanism didn't like.
The tainting mechanism is turned on when you're running setuid or setgid,
or when you specify
-T
to turn it on explicitly. The tainting mechanism
labels all data that's derived directly or indirectly from the user,
who is considered to be unworthy of your trust. If any such data is
used in a ``dangerous'' operation, you get this error. See
the perlsec manpage
for more information.

(F) You can't use
system()
,
exec()
, or a piped open in a setuid or
setgid script if $ENV{PATH} is derived from data supplied (or
potentially supplied) by the user. The script must set the path to a
known value, using trustworthy data. See
the perlsec manpage
.

(S) A warning peculiar to VMS. Perl keeps track of the number
of times you've called
fork
and
exec
, in order to determine
whether the current call to
exec
should be affect the current
script or a subprocess (see
exec
). Somehow, this count
has become scrambled, so Perl is making a guess and treating
this
exec
as a request to terminate the Perl script
and execute the specified command.

(W) You tried to do a listen on a closed socket. Did you forget to check
the return value of your
socket()
call? See
listen
.

Literal @%s now requires backslash

(F) It used to be that Perl would try to guess whether you wanted an
array interpolated or a literal @. It did this when the string was
first used at runtime. Now strings are parsed at compile time, and
ambiguous instances of @ must be disambiguated, either by putting a
backslash to indicate a literal, or by declaring (or using) the array
within the program before the string (lexically). (Someday it will simply
assume that an unbackslashed @ interpolates an array.)

(F) Certain operations are deemed to be too insecure for a setuid or setgid
script to even be allowed to attempt. Generally speaking there will be
another way to do what you want that is, if not secure, at least securable.
See
the perlsec manpage
.

(F) The currently executing code was compiled with the
-d
switch,
but for some reason the perl5db.pl file (or some facsimile thereof)
didn't define a routine to be called at the beginning of each
statement. Which is odd, because the file should have been required
automatically, and should have blown up the require if it didn't parse
right.

(F) The currently executing code was compiled with the
-d
switch,
but for some reason the perl5db.pl file (or some facsimile thereof)
didn't define a DB::sub routine to be called at the beginning of each
ordinary subroutine call.

(F) An error peculiar to VMS. Perl handles its own command line redirection,
and found a '2>' or a '2>>' on the command line, but can't find the name of the
file to which to write data destined for stderr.

No input file after < on command line

(F) An error peculiar to VMS. Perl handles its own command line redirection,
and found a '<' on the command line, but can't find the name of the file from
which to read data for stdin.

(F) An error peculiar to VMS. Perl handles its own command line redirection,
and found a '>' or a '>>' on the command line, but can't find the name of the
file to which to write data destined for stdout.

(F) Perl was trying to evaluate a reference to a code value (that is, a
subroutine), but found a reference to something else instead. You can
use the
ref()
function to find out what kind of ref it really was.
See also
the perlref manpage
.

(F) Perl was trying to evaluate a reference to a ``type glob'' (that is,
a symbol table entry that looks like *foo), but found a reference to
something else instead. You can use the
ref()
function to find out
what kind of ref it really was. See
the perlref manpage
.

(F) Perl was trying to evaluate a reference to a hash value, but
found a reference to something else instead. You can use the
ref()
function to find out what kind of ref it really was. See
the perlref manpage
.

(F) Perl was trying to evaluate a reference to a scalar value, but
found a reference to something else instead. You can use the
ref()
function to find out what kind of ref it really was. See
the perlref manpage
.

(F) Perl was trying to evaluate a reference to a code value (that is, a
subroutine), but found a reference to something else instead. You can
use the
ref()
function to find out what kind of ref it really was.
See also
the perlref manpage
.

Not a subroutine reference in %OVERLOAD

(F) An attempt was made to specify an entry in an overloading table that
doesn't somehow point to a valid subroutine. See
the perlovl manpage
.

(F) Perl was trying to evaluate a reference to an array value, but
found a reference to something else instead. You can use the
ref()
function to find out what kind of ref it really was. See
the perlref manpage
.

(S) You used a variable or subroutine call where the parser was
expecting an operator. The parser has assumed you really meant
to use an operator, but this is highly likely to be incorrect.
For example, if you say ``*foo *foo'' it will be interpreted as
if you said ``*foo * 'foo'''.

(F) An
ioctl()
or
fcntl()
returned more than Perl was bargaining for.
Perl guesses a reasonable buffer size, but puts a sentinel byte at the
end of the buffer just in case. This sentinel byte got clobbered, and
Perl assumes that memory is now corrupted. See
ioctl
.

because of the strict regularization of Perl 5's grammar into unary and
list operators. (The old open was a little of both.) You must put
parens around the filehandle, or use the new ``or'' operator instead of ``||''.

(F) The current implementation of regular expression uses shorts as
address offsets within a string. Unfortunately this means that if
the regular expression compiles to longer than 32767, it'll blow up.
Usually when you want a regular expression this big, there is a better
way to do it with multiple statements. See
the perlre manpage
.

(F) Your format contained the ~~ repeat-until-blank sequence, but it
produced 200 lines at once, and the 200th line looked exactly like the
199th line. Apparently you didn't arrange for the arguments to exhaust
themselves, either by using ^ instead of @ (for scalar variables), or by
shifting or popping (for array variables). See
the perlform manpage
.

(W) You've used an array slice (indicated by @) to select a single value of
an array. Generally it's better to ask for a scalar value (indicated by $).
The difference is that $foo[&bar] always behaves like a scalar, both when
assigning to it and when evaluating its argument, while @foo[&bar] 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 only expecting one subscript.

On the other hand, if you were actually hoping to treat the array
element as a list, you need to look into how references work, since
Perl will not magically convert between scalars and lists for you. See
the perlref manpage
.

(W) You did an
exec()
with some statement after it other than a
die()
.
This is almost always an error, because
exec()
never returns unless
there was a failure. You probably wanted to use
system()
instead,
which does return. To suppress this warning, put the
exec()
in a block
by itself.

(P) The substitution was looping infinitely. (Obviously, a
substitution shouldn't iterate more times than there are characters of
input, which is what happened.) See the discussion of substitution in
``Quote and Quotelike Operators''.

A keyword is misspelled.
A semicolon is missing.
A comma is missing.
An opening or closing parenthesis is missing.
An opening or closing brace is missing.
A closing quote is missing.

Often there will be another error message associated with the syntax
error giving more information. (Sometimes it helps to turn on
-w
.)
The error message itself often tells you where it was in the line when
it decided to give up. Sometimes the actual error is several tokens
before this, since Perl is good at understanding random input.
Occasionally the line number may be misleading, and once in a blue moon
the only way to figure out what's triggering the error is to call
perl -c repeatedly, chopping away half the program each time to see
if the error went away. Sort of the cybernetic version of 20 questions.

(F) Configure couldn't find the
crypt()
function on your machine,
probably because your vendor didn't supply it, probably because they
think the U.S. Govermnment thinks it's a secret, or at least that they
will continue to pretend that it is. And if you quote me on that, I
will deny it.

(F) It makes no sense to test the current stat buffer for symbolic linkhood
if the last stat that wrote to the stat buffer already went past
the symlink to get to the real file. Use an actual filename instead.

(F) This function requires the argument in that position to be of a
certain type. Arrays must be @NAME or @{EXPR}. Hashes must be
%NAME or %{EXPR}. No implicit dereferencing is allowed--use the
{EXPR} forms as an explicit dereference. See
the perlref manpage
.

(F) The lexer counted more closing curly brackets (braces) than opening
ones, so you're probably missing an opening bracket. As a general
rule, you'll find the missing one (so to speak) near the place you were
last editing.

(W) You used a bare word that might someday be claimed as a reserved word.
It's best to put such a word in quotes, or capitalize it somehow, or insert
an underbar into it. You might also declare it as a subroutine.

Unrecognized character \%03o ignored

(S) A garbage character was found in the input, and ignored, in case it's
a weird control character on an EBCDIC machine, or some such.

(F) Your machine doesn't support the Berkeley socket mechanism, or at
least that's what Configure thought.

Unterminated <> operator

(F) The lexer saw a left angle bracket in a place where it was expecting
a term, so it's looking for the corresponding right angle bracket, and not
finding it. Chances are you left some needed parentheses out earlier in
the line, and you really meant a ``less than''.

(D) This variable magically turned on multiline pattern matching, both for
you and for any luckless subroutine that you happen to call. You should
use the new //m and //s modifiers now to do that without the dangerous
action-at-a-distance effects of
$*
.

(W) You did something without a side effect in a context that does nothing
with the return value, such as a statement that doesn't return a value
from a block, or the left side of a scalar comma operator. Very often
this points not to stupidity on your part, but a failure of Perl to parse
your program the way you thought it would. For example, you'd get this
if you mixed up your C precedence with Python precedence and said

$one, $two = 1, 2;

when you meant to say

($one, $two) = (1, 2);

Another common error is to use ordinary parentheses to construct a list
reference when you should be using square or curly brackets, for
example, if you say

$array = (1,2);

when you should have said

$array = [1,2];

The square brackets explicitly turn a list value into a scalar value,
while parentheses do not. So when a parenthesized list is evaluated in
a scalar context, the comma is treated like C's comma operator, which
throws away the left argument, which is not what you want. See
the perlref manpage
for more on this.

(F) While ``use strict'' in effect, you referred to a global variable
that you apparently thought was imported from another module, because
something else of the same name (usually a subroutine) is exported
by that module. It usually means you put the wrong funny character
on the front of your variable.

(S) You wrote a unary operator followed by something that looks like a
binary operator that could also have been interpreted as a term or
unary operator. For instance, if you know that the rand function
has a default argument of 1.0, and you write

(F) A filehandle represents an opened file, and when you opened the file it
already went past any symlink you are presumably trying to look for.
Use a filename instead.

YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!

(F) And you probably never will, since you probably don't have the
sources to your kernel, and your vendor probably doesn't give a rip
about what you want. Your best bet is to use the wrapsuid script in
the eg directory to put a setuid C wrapper around your script.

(W) You assigned a bareword as a signal handler name. Unfortunately, you
already have a subroutine of that name declared, which means that Perl 5
will try to call the subroutine when the assignment is executed, which is
probably not what you want. (If it IS what you want, put an & in front.)

[gs]etsockopt() on closed fd

(W) You tried to get or set a socket option on a closed socket.
Did you forget to check the return value of your
socket()
call?
See
getsockopt
.

\1 better written as $1

(W) Outside of patterns, backreferences live on as variables. The use
of backslashes is grandfathered on the righthand side of a
substitution, but stylistically it's better to use the variable form
because other Perl programmers will expect it, and it works better
if there are more than 9 backreferences.

'|' and '<' may not both be specified on command line

(F) An error peculiar to VMS. Perl does its own command line redirection, and
found that STDIN was a pipe, and that you also tried to redirect STDIN using
'<'. Only one STDIN stream to a customer, please.

(F) An error peculiar to VMS. Perl does its own command line redirection, and
thinks you tried to redirect stdout both to a file and into a pipe to another
command. You need to choose one or the other, though nothing's stopping you
from piping into a program or Perl script which 'splits' output into two
streams, such as