perldiag.pod

来自「ARM上的如果你对底层感兴趣」· POD 代码 · 共 1,753 行 · 第 1/5 页

POD
1,753
字号
(W) You probably said %hash{$key} when you meant $hash{$key} or @hash{@keys}.
On the other hand, maybe you just meant %hash and got carried away.

=item Died

(F) You passed die() an empty string (the equivalent of C<die "">) or
you called it with no args and both C<$@> and C<$_> were empty.

=item Do you need to predeclare %s?

(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.

=item Don't know how to handle magic of type '%s'

(P) The internal handling of magical variables has been cursed.

=item do_study: out of memory

(P) This should have been caught by safemalloc() instead.

=item Duplicate free() ignored

(S) An internal routine called free() on something that had already
been freed.

=item elseif should be elsif

(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.

=item END failed--cleanup aborted

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

=item Error converting file specification %s

(F) An error peculiar to VMS.  Because 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.

=item %s: Eval-group in insecure regular expression

(F) Perl detected tainted data when trying to compile a regular expression
that contains the C<(?{ ... })> zero-width assertion, which is unsafe.
See L<perlre/(?{ code })>, and L<perlsec>.

=item %s: Eval-group not allowed, use re 'eval'

(F) A regular expression contained the C<(?{ ... })> zero-width assertion,
but that construct is only allowed when the C<use re 'eval'> pragma is
in effect.  See L<perlre/(?{ code })>.

=item %s: Eval-group not allowed at run time

(F) Perl tried to compile a regular expression containing the C<(?{ ... })>
zero-width assertion at run time, as it would when the pattern contains
interpolated values.  Since that is a security risk, it is not allowed.
If you insist, you may still do this by explicitly building the pattern
from an interpolated string at run time and using that in an eval().
See L<perlre/(?{ code })>.

=item Excessively long <> operator

(F) The contents of a <> operator may not exceed the maximum size of a
Perl identifier.  If you're just trying to glob a long list of
filenames, try using the glob() operator, or put the filenames into a
variable and glob that.

=item Execution of %s aborted due to compilation errors

(F) The final summary message when a Perl compilation fails.

=item Exiting eval via %s

(W) You are exiting an eval by unconventional means, such as
a goto, or a loop control statement.

=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<perlfunc/sort>.

=item Exiting subroutine via %s

(W) You are exiting a subroutine by unconventional means, such as
a goto, or a loop control statement.

=item Exiting substitution via %s

(W) You are exiting a substitution by unconventional means, such as
a return, a goto, or a loop control statement.

=item Explicit blessing to '' (assuming package main)

(W) You are blessing a reference to a zero length string.  This has
the effect of blessing the reference into the package main.  This is
usually not what you want.  Consider providing a default target
package, e.g. bless($ref, $p or 'MyPackage');

=item Fatal VMS error at %s, line %d

(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.

=item fcntl is not implemented

(F) Your machine apparently doesn't implement fcntl().  What is this, a
PDP-11 or something?

=item Filehandle %s never opened

(W) An I/O operation was attempted on a filehandle that was never initialized.
You need to do an open() or a socket() call, or call a constructor from
the FileHandle package.

=item Filehandle %s opened for only input

(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
"+E<lt>" or "+E<gt>" or "+E<gt>E<gt>" instead of with "E<lt>" or nothing.  If
you intended only to write the file, use "E<gt>" or "E<gt>E<gt>".  See
L<perlfunc/open>.

=item Filehandle opened for only input

(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
"+E<lt>" or "+E<gt>" or "+E<gt>E<gt>" instead of with "E<lt>" or nothing.  If
you intended only to write the file, use "E<gt>" or "E<gt>E<gt>".  See
L<perlfunc/open>.

=item 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.

=item 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.

=item Format %s redefined

(W) You redefined a format.  To suppress this warning, say

    {
	local $^W = 0;
	eval "format NAME =...";
    }

=item Format not terminated

(F) A format must be terminated by a line with a solitary dot.  Perl got
to the end of your file without finding such a line.

=item Found = in conditional, should be ==

(W) You said

    if ($foo = 123)

when you meant

    if ($foo == 123)

(or something like that).

=item gdbm store returned %d, errno %d, key "%s"

(S) A warning from the GDBM_File extension that a store failed.

=item gethostent not implemented

(F) Your C library apparently doesn't implement gethostent(), probably
because if it did, it'd feel morally obligated to return every hostname
on the Internet.

=item get{sock,peer}name() on closed fd

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

=item getpwnam returned invalid UIC %#o for user "%s"

(S) A warning peculiar to VMS.  The call to C<sys$getuai> underlying the
C<getpwnam> operator returned an invalid UIC.


=item Glob not terminated

(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".

=item Global symbol "%s" requires explicit package name

(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 "::").

=item goto must have label

(F) Unlike with "next" or "last", you're not allowed to goto an
unspecified destination.  See L<perlfunc/goto>.

=item Had to create %s unexpectedly

(S) A routine asked for a symbol from a symbol table that ought to have
existed already, but for some reason it didn't, and had to be created on
an emergency basis to prevent a core dump.

=item Hash %%s missing the % in argument %d of %s()

(D) Really old Perl let you omit the % on hash names in some spots.  This
is now heavily deprecated.

=item Identifier too long

(F) Perl limits identifiers (names for variables, functions, etc.) to
about 250 characters for simple names, and somewhat more for compound
names (like C<$A::B>).  You've exceeded Perl's limits.  Future
versions of Perl are likely to eliminate these arbitrary limitations.

=item Ill-formed logical name |%s| in prime_env_iter

(W) A warning peculiar to VMS.  A logical name was encountered when preparing
to iterate over %ENV which violates the syntactic rules governing logical
names.  Because it cannot be translated normally, it is skipped, and will not
appear in %ENV.  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.

=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., C<print E<lt>E<lt>EOF;>).

Under Unix, this error is usually caused by executing Perl code --
either the main program, a module, or an eval'd string -- that was
transferred over a network connection from a non-Unix system without
properly converting the text file format.

Under systems that use something other than '\n' to delimit lines of
text, this error can also be caused by reading Perl code from a file
handle that is in binary mode (as set by the C<binmode> operator).

In either case, the Perl code in question will probably need to be
converted with something like C<s/\x0D\x0A?/\n/g> before it can be
executed.

=item Illegal division by zero

(F) You tried to divide a number by 0.  Either something was wrong in your
logic, or you need to put a conditional in to guard against meaningless input.

=item Illegal modulus zero

(F) You tried to divide a number by 0 to get the remainder.  Most numbers
don't take to this kindly.

=item Illegal octal digit

(F) You used an 8 or 9 in a octal number.

=item Illegal octal digit ignored

(W) You may have tried to use an 8 or 9 in a octal number.  Interpretation
of the octal number stopped before the 8 or 9.

=item Illegal hex digit ignored

(W) You may have tried to use a character other than 0 - 9 or A - F in a
hexadecimal number.  Interpretation of the hexadecimal number stopped
before the illegal character.

=item Illegal switch in PERL5OPT: %s

(X) The PERL5OPT environment variable may only be used to set the
following switches: B<-[DIMUdmw]>.

=item In string, @%s now must be written as \@%s

(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 prepending 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.)

=item Insecure dependency in %s

(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 B<-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 L<perlsec>
for more information.

=item Insecure directory in %s

(F) You can't use system(), exec(), or a piped open in a setuid or setgid
script if C<$ENV{PATH}> contains a directory that is writable by the world.
See L<perlsec>.

=item Insecure $ENV{%s} while running %s

(F) You can't use system(), exec(), or a piped open in a setuid or
setgid script if any of C<$ENV{PATH}>, C<$ENV{IFS}>, C<$ENV{CDPATH}>,
C<$ENV{ENV}> or C<$ENV{BASH_ENV}> are derived from data supplied (or
potentially supplied) by the user.  The script must set the path to a
known value, using trustworthy data.  See L<perlsec>.

=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.

=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.

=item Internal inconsistency in tracking vforks

(S) A warning peculiar to VMS.  Perl keeps track of the number

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?