perldiag.pod

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

POD
1,753
字号
    $var = 'myvar';
    $sym = "mypack::$var";

=item Bad symbol for array

(P) An internal request asked to add an array entry to something that
wasn't a symbol table entry.

=item Bad symbol for filehandle

(P) An internal request asked to add a filehandle entry to something that
wasn't a symbol table entry.

=item Bad symbol for hash

(P) An internal request asked to add a hash entry to something that
wasn't a symbol table entry.

=item Badly placed ()'s

(A) You've accidentally run your script through B<csh> instead
of Perl.  Check the #! line, or manually feed your script into
Perl yourself.

=item 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 braces or to the left of the "=>" symbol.
Perhaps you need to predeclare a subroutine?

=item Bareword "%s" refers to nonexistent package

(W) You used a qualified bareword of the form C<Foo::>, but
the compiler saw no other uses of that namespace before that point.
Perhaps you need to predeclare a package?

=item BEGIN failed--compilation aborted

(F) An untrapped exception was raised while executing a BEGIN subroutine.
Compilation stops immediately and the interpreter is exited.

=item BEGIN not safe after errors--compilation aborted

(F) Perl found a C<BEGIN {}> subroutine (or a C<use> directive, which
implies a C<BEGIN {}>) after one or more compilation errors had
already occurred.  Since the intended environment for the C<BEGIN {}>
could not be guaranteed (due to the errors), and since subsequent code
likely depends on its correct operation, Perl just gave up.

=item bind() on closed fd

(W) You tried to do a bind on a closed socket.  Did you forget to check
the return value of your socket() call?  See L<perlfunc/bind>.

=item Bizarre copy of %s in %s

(P) Perl detected an attempt to copy an internal value that is not copiable.

=item Callback called exit

(F) A subroutine invoked from an external package via perl_call_sv()
exited by calling exit.

=item Can't "goto" outside a block

(F) A "goto" statement was executed to jump out of what might look
like a block, except that it isn't a proper block.  This usually
occurs if you tried to jump out of a sort() block or subroutine, which
is a no-no.  See L<perlfunc/goto>.

=item Can't "goto" into the middle of a foreach loop

(F) A "goto" statement was executed to jump into the middle of a
foreach loop.  You can't get there from here.  See L<perlfunc/goto>.

=item Can't "last" outside a block

(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, as doesn't a block given to sort().  You can usually double
the curlies to get the same effect though, because the inner curlies
will be considered a block that loops once.  See L<perlfunc/last>.

=item 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, as doesn't a block given to sort().  You can
usually double the curlies to get the same effect though, because the inner
curlies will be considered a block that loops once.  See L<perlfunc/next>.

=item 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, as doesn't a block given to sort().  You can
usually double the curlies to get the same effect though, because the inner
curlies will be considered a block that loops once.  See L<perlfunc/redo>.

=item Can't bless non-reference value

(F) Only hard references may be blessed.  This is how Perl "enforces"
encapsulation of objects.  See L<perlobj>.

=item Can't break at that line

(S) A warning intended to only be printed while running within the debugger, indicating
the line number specified wasn't the location of a statement that could
be stopped at.

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

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

=item 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);

=item 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);

=item Can't chdir to %s

(F) You called C<perl -x/foo/bar>, but C</foo/bar> is not a directory
that you can chdir to, possibly because it doesn't exist.

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

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

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

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

=item Can't create pipe mailbox

(P) An error peculiar to VMS.  The process is suffering from exhausted quotas
or other plumbing problems.

=item Can't declare %s in my

(F) Only scalar, array, and hash variables may be declared as lexical variables.
They must have ordinary identifiers as names.

=item Can't do inplace edit on %s: %s

(S) The creation of the new file failed for the indicated reason.

=item 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 C<-i.bak>, or some
such.

=item Can't do inplace edit: %s E<gt> 14 characters

(S) There isn't enough room in the filename to make a backup name for the file.

=item Can't do inplace edit: %s is not a regular file

(S) You tried to use the B<-i> switch on a special file, such as a file in
/dev, or a FIFO.  The file was ignored.

=item Can't do setegid!

(P) The setegid() call failed for some reason in the setuid emulator
of suidperl.

=item Can't do seteuid!

(P) The setuid emulator of suidperl failed for some reason.

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

=item Can't do waitpid with flags

(F) This machine doesn't have either waitpid() or wait4(), so only waitpid()
without flags is emulated.

=item Can't do {n,m} with n E<gt> m

(F) Minima must be less than or equal to maxima.  If you really want
your regexp to match something 0 times, just put {0}.  See L<perlre>.

=item 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 B<-x> on the #! line.

=item Can't exec "%s": %s

(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 C<$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.)

=item Can't exec %s

(F) Perl was trying to execute the indicated program for you because that's
what the #! line said.  If that's not what you wanted, you may need to
mention "perl" on the #! line somewhere.

=item Can't execute %s

(F) You used the B<-S> switch, but the copies of the script to execute found
in the PATH did not have correct permissions.

=item Can't find %s on PATH, '.' not in PATH

(F) You used the B<-S> switch, but the script to execute could not be found
in the PATH, or at least not with the correct permissions.  The script
exists in the current directory, but PATH prohibits running it.

=item Can't find %s on PATH

(F) You used the B<-S> switch, but the script to execute could not be found
in the PATH.

=item Can't find label %s

(F) You said to goto a label that isn't mentioned anywhere that it's possible
for us to go to.  See L<perlfunc/goto>.

=item Can't find string terminator %s anywhere before EOF

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

    print q(The character '(' starts a side comment.);

If you're getting this error from a here-document, you may have 
included unseen whitespace before or after your closing tag. A good 
programmer's editor will have a way to help you find these characters.

=item Can't fork

(F) A fatal error occurred while trying to fork while opening a pipeline.

=item Can't get filespec - stale stat buffer?

(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, because 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 C<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.)

=item Can't get pipe mailbox device name

(P) An error peculiar to VMS.  After creating a mailbox to act as a pipe, Perl
can't retrieve its name for later use.

=item Can't get SYSGEN parameter value for MAXBUF

(P) An error peculiar to VMS.  Perl asked $GETSYI how big you want your
mailbox buffers to be, and didn't get an answer.

=item Can't goto subroutine outside a subroutine

(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 be calling it out of only an AUTOLOAD routine anyway.  See
L<perlfunc/goto>.

=item Can't goto subroutine from an eval-string

(F) The "goto subroutine" call can't be used to jump out of an eval "string".
(You can use it to jump out of an eval {BLOCK}, but you probably don't want to.)

=item Can't localize through a reference

(F) You said something like C<local $$ref>, which Perl can't currently
handle, because when it goes to restore the old value of whatever $ref
pointed to after the scope of the local() is finished, it can't be
sure that $ref will still be a reference.  

=item Can't localize lexical variable %s

(F) You used local on a variable name that was previously 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.

=item Can't localize pseudo-hash element

(F) You said something like C<local $ar-E<gt>{'key'}>, where $ar is

⌨️ 快捷键说明

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