These messages are classified as follows (listed in increasing order of
desperation):
The majority of messages from the first three classifications above
(W, D & S) can be controlled using the warnings pragma.
Default warnings are always enabled unless they are explicitly disabled
with the warnings pragma or the -X switch.
The messages are in alphabetical order, without regard to upper or
lower-case. Some of these messages are generic. Spots that vary are
denoted with a %s or other printf-style escape. These escapes are
ignored by the alphabetical order, as are all characters other than
letters. To look up your message, just ignore anything that is not a
letter.
accept() on closed socket %s
-
(W closed) You tried to do an accept on a closed socket. Did you forget
to check the return value of your socket() call? See
accept in the perlfunc manpage.
- Allocation too large: %lx
-
(X) You can't allocate more than 64K on an MS-DOS machine.
- '!' allowed only after types %s
-
(F) The '!' is allowed in pack() or unpack() only after certain types.
See pack in the perlfunc manpage.
- Ambiguous call resolved as CORE::%s(), qualify as such or use &
-
(W ambiguous) A subroutine you have declared has the same name as a Perl
keyword, and you have used the name without qualification for calling
one or the other. Perl decided to call the builtin because the
subroutine is not imported.
-
To force interpretation as a subroutine call, either put an ampersand
before the subroutine name, or qualify the name with its package.
Alternatively, you can import the subroutine (or pretend that it's
imported with the use subs pragma).
-
To silently interpret it as the Perl operator, use the CORE:: prefix
on the operator (e.g. CORE::log($x)) or declare the subroutine
to be an object method (see Subroutine Attributes in the perlsub manpage or
the attributes manpage).
- Ambiguous range in transliteration operator
-
(F) You wrote something like tr/a-z-0// which doesn't mean anything at
all. To include a - character in a transliteration, put it either
first or last. (In the past, tr/a-z-0// was synonymous with
tr/a-y//, which was probably not what you would have expected.)
- Ambiguous use of %s resolved as %s
-
(W ambiguous)(S) You said something that may not be interpreted the way
you thought. Normally it's pretty easy to disambiguate it by supplying
a missing quote, operator, parenthesis pair or declaration.
- '|' 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.
- '|' and '>' may not both be specified on command line
-
(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
-
open(OUT,">$ARGV[0]") or die "Can't write to $ARGV[0]: $!";
while (<STDIN>) {
print;
print OUT;
}
close OUT;
- Applying %s to %s will act on
scalar(%s)
-
(W misc) 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 grep in the perlfunc manpage and map in the perlfunc manpage for
alternatives.
- Args must match #! line
-
(F) The setuid emulator requires that the arguments Perl was invoked
with match the arguments specified on the #! line. Since some systems
impose a one-argument limit on the #! line, try combining switches;
for example, turn -w -U into -wU.
- Arg too short for msgsnd
-
(F) msgsnd() requires a string at least as long as sizeof(long).
- %s argument is not a HASH or ARRAY element
-
(F) The argument to exists() must be a hash or array element, such as:
-
$foo{$bar}
$ref->{"susie"}[12]
- %s argument is not a HASH or ARRAY element or slice
-
(F) The argument to delete() must be either a hash or array element,
such as:
-
$foo{$bar}
$ref->{"susie"}[12]
-
or a hash or array slice, such as:
-
@foo[$bar, $baz, $xyzzy]
@{$ref->[12]}{"susie", "queue"}
- %s argument is not a subroutine name
-
(F) The argument to exists() for exists &sub must be a subroutine
name, and not a subroutine call. exists &sub() will generate this
error.
- Argument "%s" isn't numeric%s
-
(W numeric) The indicated string was fed as an argument to an operator
that expected a numeric value instead. If you're fortunate the message
will identify which operator was so unfortunate.
- Argument list not closed for PerlIO layer "%s"
-
(W layer) When pushing a layer with arguments onto the Perl I/O system you
forgot the ) that closes the argument list. (Layers take care of transforming
data between external and internal representations.) Perl stopped parsing
the layer list at this point and did not attempt to push this layer.
If your program didn't explicitly request the failing operation, it may be
the result of the value of the environment variable PERLIO.
- Array @%s missing the @ in argument %d of %s()
-
(D deprecated) Really old Perl let you omit the @ on array names in some
spots. This is now heavily deprecated.
- assertion botched: %s
-
(P) The malloc package that comes with Perl had an internal failure.
- Assertion failed: file "%s"
-
(P) A general assertion failed. The file in question must be examined.
- Assignment to both a list and a scalar
-
(F) If you assign to a conditional operator, the 2nd and 3rd arguments
must either both be scalars or both be lists. Otherwise Perl won't
know which context to supply to the right side.
- A thread exited while %d threads were running
-
(W threads)(S) When using threaded Perl, a thread (not necessarily the main
thread) exited while there were still other threads running.
Usually it's a good idea to first collect the return values of the
created threads by joining them, and only then exit from the main
thread. See the threads manpage.
- Attempt to access disallowed key '%s' in a restricted hash
-
(F) The failing code has attempted to get or set a key which is not in
the current set of allowed keys of a restricted hash.
- Attempt to bless into a reference
-
(F) The CLASSNAME argument to the bless() operator is expected to be
the name of the package to bless the resulting object into. You've
supplied instead a reference to something: perhaps you wrote
-
bless $self, $proto;
-
when you intended
-
bless $self, ref($proto) || $proto;
-
If you actually want to bless into the stringified version
of the reference supplied, you need to stringify it yourself, for
example by:
-
bless $self, "$proto";
- Attempt to delete disallowed key '%s' from a restricted hash
-
(F) The failing code attempted to delete from a restricted hash a key
which is not in its key set.
- Attempt to delete readonly key '%s' from a restricted hash
-
(F) The failing code attempted to delete a key whose value has been
declared readonly from a restricted hash.
- Attempt to free non-arena SV: 0x%lx
-
(P internal) All SV objects are supposed to be allocated from arenas
that will be garbage collected on exit. An SV was discovered to be
outside any of those arenas.
- Attempt to free nonexistent shared string
-
(P internal) 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.
- Attempt to free temp prematurely
-
(W debugging) 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.
- Attempt to free unreferenced glob pointers
-
(P internal) The reference counts got screwed up on symbol aliases.
- Attempt to free unreferenced scalar
-
(W internal) 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.
- Attempt to join self
-
(F) You tried to join a thread from within itself, which is an
impossible task. You may be joining the wrong thread, or you may need
to move the join() to some other thread.
- Attempt to pack pointer to temporary value
-
(W pack) You tried to pass a temporary value (like the result of a
function, or a computed expression) to the "p" pack() template. This
means the result contains a pointer to a location that could become
invalid anytime, even before the end of the current statement. Use
literals or global values as arguments to the "p" pack() template to
avoid this warning.
- Attempt to set length of freed array
-
(W) You tried to set the length of an array which has been freed. You
can do this by storing a reference to the scalar representing the last index
of an array and later assigning through that reference. For example
-
$r = do {my @a; \$#a};
$$r = 503
- Attempt to use reference as lvalue in substr
-
(W substr) You supplied a reference as the first argument to substr()
used as an lvalue, which is pretty strange. Perhaps you forgot to
dereference it first. See substr in the perlfunc manpage.
- Bad arg length for %s, is %d, should be %s
-
(F) You passed a buffer of the wrong size to one of msgctl(), semctl()
or shmctl(). In C parlance, the correct sizes are, respectively,
sizeof(struct msqid_ds *), sizeof(struct semid_ds *), and
sizeof(struct shmid_ds *).
- Bad evalled substitution pattern
-
(F) You've used the /e switch to evaluate the replacement for a
substitution, but perl found a syntax error in the code to evaluate,
most likely an unexpected right brace '}'.
- Bad filehandle: %s
-
(F) A symbol was passed to something wanting a filehandle, but the
symbol has no filehandle associated with it. Perhaps you didn't do an
open(), or did it in another package.
- Bad
free() ignored
-
(S malloc) An internal routine called free() on something that had never
been malloc()ed in the first place. Mandatory, but can be disabled by
setting environment variable PERL_BADFREE to 0.
-
This message can be seen quite often with DB_File on systems with "hard"
dynamic linking, like AIX and OS/2. It is a bug of Berkeley DB
which is left unnoticed if DB uses forgiving system malloc().
- Bad hash
-
(P) One of the internal hash routines was passed a null HV pointer.
- Bad index while coercing array into hash
-
(F) The index looked up in the hash found as the 0'th element of a
pseudo-hash is not legal. Index values must be at 1 or greater.
See the perlref manpage.
- Badly placed ()'s
-
(A) You've accidentally run your script through csh instead
of Perl. Check the #! line, or manually feed your script into
Perl yourself.
- Bad name after %s::
-
(F) You started to name a symbol by using a package prefix, and then
didn't finish the symbol. In particular, you can't interpolate outside
of quotes, so
-
$var = 'myvar';
$sym = mypack::$var;
-
is not the same as
-
$var = 'myvar';
$sym = "mypack::$var";
- Bad
realloc() ignored
-
(S malloc) An internal routine called realloc() on something that had
never been malloc()ed in the first place. Mandatory, but can be disabled
by setting environment variable PERL_BADFREE to 1.
- Bad symbol for array
-
(P) An internal request asked to add an array entry to something that
wasn't a symbol table entry.
- Bad symbol for dirhandle
-
(P) An internal request asked to add a dirhandle entry to something
that wasn't a symbol table entry.
- Bad symbol for filehandle
-
(P) An internal request asked to add a filehandle entry to something
that wasn't a symbol table entry.
- Bad symbol for hash
-
(P) An internal request asked to add a hash entry to something that
wasn't a symbol table entry.
- Bareword found in conditional
-
(W bareword) The compiler found a bareword where it expected a
conditional, which often indicates that an || or && was parsed as part
of the last argument of the previous construct, for example:
-
open FOO || die;
-
It may also indicate a misspelled constant that has been interpreted as
a bareword:
-
use constant TYPO => 1;
if (TYOP) { print "foo" }
-
The strict pragma is useful in avoiding such errors.
- Bareword "%s" not allowed while "strict subs" in use
-
(F) With "strict subs" in use, a bareword is only allowed as a
subroutine identifier, in curly brackets or to the left of the "=>"
symbol. Perhaps you need to predeclare a subroutine?
- Bareword "%s" refers to nonexistent package
-
(W bareword) You used a qualified bareword of the form Foo::, but the
compiler saw no other uses of that namespace before that point. Perhaps
you need to predeclare a package?
- BEGIN failed--compilation aborted
-
(F) An untrapped exception was raised while executing a BEGIN
subroutine. Compilation stops immediately and the interpreter is
exited.
- BEGIN not safe after errors--compilation aborted
-
(F) Perl found a BEGIN {} subroutine (or a use directive, which
implies a BEGIN {}) after one or more compilation errors had already
occurred. Since the intended environment for the BEGIN {} could not
be guaranteed (due to the errors), and since subsequent code likely
depends on its correct operation, Perl just gave up.
- \1 better written as $1
-
(W syntax) Outside of patterns, backreferences live on as variables.
The use of backslashes is grandfathered on the right-hand 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.
- Binary number > 0b11111111111111111111111111111111 non-portable
-
(W portable) The binary number you specified is larger than 2**32-1
(4294967295) and therefore non-portable between systems. See
the perlport manpage for more on portability concerns.
bind() on closed socket %s
-
(W closed) You tried to do a bind on a closed socket. Did you forget to
check the return value of your socket() call? See bind in the perlfunc manpage.
binmode() on closed filehandle %s
-
(W unopened) You tried binmode() on a filehandle that was never opened.
Check you control flow and number of arguments.
- Bit vector size > 32 non-portable
-
(W portable) Using bit vector sizes larger than 32 is non-portable.
- Bizarre copy of %s in %s
-
(P) Perl detected an attempt to copy an internal value that is not
copyable.
- Buffer overflow in prime_env_iter: %s
-
(W internal) A warning peculiar to VMS. While Perl was preparing to
iterate over %ENV, it encountered a logical name or symbol definition
which was too long, so it was truncated to the string shown.
- Callback called exit
-
(F) A subroutine invoked from an external package via call_sv()
exited by calling exit.
- %s() called too early to check prototype
-
(W prototype) You've called a function that has a prototype before the
parser saw a definition or declaration for it, and Perl could not check
that the call conforms to the prototype. You need to either add an
early prototype declaration for the subroutine in question, or move the
subroutine definition ahead of the call to get proper prototype
checking. Alternatively, if you are certain that you're calling the
function correctly, you may put an ampersand before the name to avoid
the warning. See the perlsub manpage.
- Cannot compress integer in pack
-
(F) An argument to pack("w",...) was too large to compress. The BER
compressed integer format can only be used with positive integers, and you
attempted to compress Infinity or a very large number (> 1e308).
See pack in the perlfunc manpage.
- Cannot compress negative numbers in pack
-
(F) An argument to pack("w",...) was negative. The BER compressed integer
format can only be used with positive integers. See pack in the perlfunc manpage.
- Cannot convert a reference to %s to typeglob
-
(F) You manipulated Perl's symbol table directly, stored a reference in it,
then tried to access that symbol via conventional Perl syntax. The access
triggers Perl to autovivify that typeglob, but it there is no legal conversion
from that type of reference to a typeglob.
- Can only compress unsigned integers in pack
-
(F) An argument to pack("w",...) was not an integer. The BER compressed
integer format can only be used with positive integers, and you attempted
to compress something else. See pack in the perlfunc manpage.
- 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.
- Can't call method "%s" in empty package "%s"
-
(F) You called a method correctly, and it correctly indicated a package
functioning as a class, but that package doesn't have ANYTHING defined
in it, let alone methods. See the perlobj manpage.
- Can't call method "%s" on an undefined value
-
(F) You used the syntax of a method call, but the slot filled by the
object reference or package name contains an undefined value. Something
like this will reproduce the error:
-
$BADREF = undef;
process $BADREF 1,2,3;
$BADREF->process(1,2,3);
- Can't call method "%s" on unblessed reference
-
(F) A method call must know in what package it's supposed to run. 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.
- Can't call method "%s" without a package or object reference
-
(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 a
defined value which is neither an object reference nor a package name.
Something like this will reproduce the error:
-
$BADREF = 42;
process $BADREF 1,2,3;
$BADREF->process(1,2,3);
- Can't chdir to %s
-
(F) You called perl -x/foo/bar, but /foo/bar is not a directory
that you can chdir to, possibly because it doesn't exist.
- Can't check filesystem of script "%s" for nosuid
-
(P) For some reason you can't check the filesystem of the script for
nosuid.
- Can't coerce array into hash
-
(F) You used an array where a hash was expected, but the array has no
information on how to map from keys to array indices. You can do that
only with arrays that have a hash reference at index 0.
- Can't coerce %s to integer in %s
-
(F) Certain types of SVs, in particular real symbol table entries
(typeglobs), can't be forced to stop being what they are. So you can't
say things like:
-
*foo += 1;
-
You CAN say
-
$foo = *foo;
$foo += 1;
-
but then $foo no longer contains a glob.
- Can't coerce %s to number in %s
-
(F) Certain types of SVs, in particular real symbol table entries
(typeglobs), can't be forced to stop being what they are.
- Can't coerce %s to string in %s
-
(F) Certain types of SVs, in particular real symbol table entries
(typeglobs), can't be forced to stop being what they are.
- Can't create pipe mailbox
-
(P) An error peculiar to VMS. The process is suffering from exhausted
quotas or other plumbing problems.
- Can't declare class for non-scalar %s in "%s"
-
(F) Currently, only scalar variables can be declared with a specific
class qualifier in a "my" or "our" declaration. The semantics may be
extended for other types of variables in future.
- Can't declare %s in "%s"
-
(F) Only scalar, array, and hash variables may be declared as "my" or
"our" variables. They must have ordinary identifiers as names.
- Can't do inplace edit: %s is not a regular file
-
(S inplace) You tried to use the -i switch on a special file, such as
a file in /dev, or a FIFO. The file was ignored.
- Can't do inplace edit on %s: %s
-
(S inplace) The creation of the new file failed for the indicated
reason.
- Can't do inplace edit without backup
-
(F) You're on a system such as MS-DOS that gets confused if you try
reading from a deleted (but still opened) file. You have to say
-i.bak, or some such.
- Can't do inplace edit: %s would not be unique
-
(S inplace) Your filesystem does not support filenames longer than 14
characters and Perl was unable to create a unique filename during
inplace editing with the -i switch. The file was ignored.
- Can't do {n,m} with n > m in regex; marked by <-- HERE in m/%s/
-
(F) Minima must be less than or equal to maxima. If you really want your
regexp to match something 0 times, just put {0}. The <-- HERE shows in the
regular expression about where the problem was discovered. See the perlre manpage.
- Can't do setegid!
-
(P) The setegid() call failed for some reason in the setuid emulator of
suidperl.
- Can't do seteuid!
-
(P) The setuid emulator of suidperl failed for some reason.
- Can't do setuid
-
(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.
- Can't do waitpid with flags
-
(F) This machine doesn't have either waitpid() or wait4(), so only
waitpid() without flags is emulated.
- Can't emulate -%s on #! line
-
(F) The #! line specifies a switch that doesn't make sense at this
point. For example, it'd be kind of silly to put a -x on the #!
line.
- Can't exec "%s": %s