📄 perldiag.pod
字号:
(F) You said something like C<local $$ref>, which Perl can't currentlyhandle, because when it goes to restore the old value of whatever $refpointed to after the scope of the local() is finished, it can't be surethat $ref will still be a reference. =item Can't locate %s(F) You said to C<do> (or C<require>, or C<use>) a file that couldn't befound. Perl looks for the file in all the locations mentioned in @INC,unless the file name included the full path to the file. Perhaps youneed to set the PERL5LIB or PERL5OPT environment variable to say wherethe extra library is, or maybe the script needs to add the library nameto @INC. Or maybe you just misspelled the name of the file. SeeL<perlfunc/require> and L<lib>.=item Can't locate auto/%s.al in @INC(F) A function (or method) was called in a package which allowsautoload, but there is no function to autoload. Most probable causesare a misprint in a function/method name or a failure to C<AutoSplit>the file, say, by doing C<make install>.=item Can't locate object method "%s" via package "%s"(F) You called a method correctly, and it correctly indicated a packagefunctioning as a class, but that package doesn't define that particularmethod, nor does any of its base classes. See L<perlobj>.=item (perhaps you forgot to load "%s"?)(F) This is an educated guess made in conjunction with the message"Can't locate object method \"%s\" via package \"%s\"". It often meansthat a method requires a package that has not been loaded.=item Can't locate package %s for @%s::ISA(W syntax) The @ISA array contained the name of another package thatdoesn't seem to exist.=item Can't make list assignment to \%ENV on this system(F) List assignment to %ENV is not supported on some systems, notablyVMS.=item Can't modify %s in %s(F) You aren't allowed to assign to the item indicated, or otherwise tryto change it, such as with an auto-increment.=item Can't modify nonexistent substring(P) The internal routine that does assignment to a substr() was handeda NULL.=item Can't modify non-lvalue subroutine call(F) Subroutines meant to be used in lvalue context should be declared assuch, see L<perlsub/"Lvalue subroutines">.=item Can't msgrcv to read-only var(F) The target of a msgrcv must be modifiable to be used as a receivebuffer.=item Can't "next" outside a loop block(F) A "next" statement was executed to reiterate the current block, butthere isn't a current block. Note that an "if" or "else" block doesn'tcount as a "loopish" block, as doesn't a block given to sort(), map() orgrep(). You can usually double the curlies to get the same effectthough, because the inner curlies will be considered a block that loopsonce. See L<perlfunc/next>.=item Can't open %s: %s(S inplace) The implicit opening of a file through use of the C<< <> >>filehandle, either implicitly under the C<-n> or C<-p> command-lineswitches, or explicitly, failed for the indicated reason. Usually thisis because you don't have read permission for a file which you named onthe command line.=item Can't open bidirectional pipe(W pipe) You tried to say C<open(CMD, "|cmd|")>, which is not supported.You can try any of several modules in the Perl library to do this, suchas IPC::Open2. Alternately, direct the pipe's output to a file using">", and then read it in under a different file handle.=item Can't open error file %s as stderr(F) An error peculiar to VMS. Perl does its own command lineredirection, and couldn't open the file specified after '2>' or '2>>' onthe command line for writing.=item Can't open input file %s as stdin(F) An error peculiar to VMS. Perl does its own command lineredirection, and couldn't open the file specified after '<' on thecommand line for reading.=item Can't open output file %s as stdout(F) An error peculiar to VMS. Perl does its own command lineredirection, and couldn't open the file specified after '>' or '>>' onthe command line for writing.=item Can't open output pipe (name: %s)(P) An error peculiar to VMS. Perl does its own command lineredirection, and couldn't open the pipe into which to send data destinedfor stdout.=item Can't open perl script "%s": %s(F) The script you specified can't be opened for the indicated reason.=item Can't read CRTL environ(S) A warning peculiar to VMS. Perl tried to read an element of %ENVfrom the CRTL's internal environment array and discovered the array wasmissing. You need to figure out where your CRTL misplaced its environor define F<PERL_ENV_TABLES> (see L<perlvms>) so that environ is notsearched.=item Can't redefine active sort subroutine %s(F) Perl optimizes the internal handling of sort subroutines and keepspointers into them. You tried to redefine one such sort subroutine whenit was currently active, which is not allowed. If you really want to dothis, you should write C<sort { &func } @x> instead of C<sort func @x>.=item Can't "redo" outside a loop block(F) A "redo" statement was executed to restart the current block, butthere isn't a current block. Note that an "if" or "else" block doesn'tcount as a "loopish" block, as doesn't a block given to sort(), map()or grep(). You can usually double the curlies to get the same effectthough, because the inner curlies will be considered a block thatloops once. See L<perlfunc/redo>.=item Can't remove %s: %s, skipping file (S inplace) You requested an inplace edit without creating a backupfile. Perl was unable to remove the original file to replace it withthe modified file. The file was left unmodified.=item Can't rename %s to %s: %s, skipping file(S inplace) The rename done by the B<-i> switch failed for some reason,probably because you don't have write permission to the directory.=item Can't reopen input pipe (name: %s) in binary mode(P) An error peculiar to VMS. Perl thought stdin was a pipe, and triedto reopen it to accept binary data. Alas, it failed.=item Can't resolve method `%s' overloading `%s' in package `%s'(F|P) Error resolving overloading specified by a method name (as opposedto a subroutine reference): no such method callable via the package. Ifmethod name is C<???>, this is an internal error.=item Can't reswap uid and euid(P) The setreuid() call failed for some reason in the setuid emulator ofsuidperl.=item Can't return %s from lvalue subroutine(F) Perl detected an attempt to return illegal lvalues (such astemporary or readonly values) from a subroutine used as an lvalue. Thisis not allowed.=item Can't return %s to lvalue scalar context(F) You tried to return a complete array or hash from an lvalue subroutine,but you called the subroutine in a way that made Perl think you meantto return only one value. You probably meant to write parentheses aroundthe call to the subroutine, which tell Perl that the call should be inlist context.=item Can't return outside a subroutine(F) The return statement was executed in mainline code, that is, wherethere was no subroutine call to return out of. See L<perlsub>.=item Can't stat script "%s"(P) For some reason you can't fstat() the script even though you have itopen already. Bizarre.=item Can't swap uid and euid(P) The setreuid() call failed for some reason in the setuid emulator ofsuidperl.=item Can't take log of %g(F) For ordinary real numbers, you can't take the logarithm of anegative number or zero. There's a Math::Complex package that comesstandard with Perl, though, if you really want to do that for thenegative numbers.=item Can't take sqrt of %g(F) For ordinary real numbers, you can't take the square root of anegative number. There's a Math::Complex package that comes standardwith Perl, though, if you really want to do that.=item Can't undef active subroutine(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 theredefined subroutine while the old routine is running. Go figure.=item Can't unshift(F) You tried to unshift an "unreal" array that can't be unshifted, suchas the main Perl stack.=item Can't upgrade that kind of scalar(P) The internal sv_upgrade routine adds "members" to an SV, making itinto a more specialized kind of SV. The top several SV types are sospecialized, however, that they cannot be interconverted. This messageindicates that such a conversion was attempted.=item Can't upgrade to undef(P) The undefined SV is the bottom of the totem pole, in the scheme ofupgradability. Upgrading to undef indicates an error in the codecalling sv_upgrade.=item Can't use an undefined value as %s reference(F) A value used as either a hard reference or a symbolic reference mustbe a defined value. This helps to delurk some insidious errors.=item Can't use bareword ("%s") as %s ref while "strict refs" in use(F) Only hard references are allowed by "strict refs". Symbolicreferences are disallowed. See L<perlref>.=item Can't use %! because Errno.pm is not available(F) The first time the %! hash is used, perl automatically loads theErrno.pm module. The Errno module is expected to tie the %! hash toprovide symbolic names for C<$!> errno values.=item Can't use %s for loop variable(F) Only a simple scalar variable may be used as a loop variable on aforeach.=item Can't use global %s in "my"(F) You tried to declare a magical variable as a lexical variable. Thisis not allowed, because the magic can be tied to only one location(namely the global variable) and it would be incredibly confusing tohave variables in your program that looked like magical variables butweren't.=item Can't use "my %s" in sort comparison(F) The global variables $a and $b are reserved for sort comparisons.You mentioned $a or $b in the same line as the <=> or cmp operator,and the variable had earlier been declared as a lexical variable.Either qualify the sort variable with the package name, or rename thelexical variable.=item Can't use %s ref as %s ref(F) You've mixed up your reference types. You have to dereference areference of the type needed. You can use the ref() function totest the type of the reference, if need be.=item Can't use string ("%s") as %s ref while "strict refs" in use(F) Only hard references are allowed by "strict refs". Symbolicreferences are disallowed. See L<perlref>.=item Can't use subscript on %s(F) The compiler tried to interpret a bracketed expression as asubscript. But to the left of the brackets was an expression thatdidn't look like an array reference, or anything else subscriptable.=item Can't use \%c to mean $%c in expression(W syntax) In an ordinary expression, backslash is a unary operator thatcreates a reference to its argument. The use of backslash to indicate abackreference to a matched substring is valid only as part of a regularexpression pattern. Trying to do this in ordinary Perl code produces avalue that prints out looking like SCALAR(0xdecaf). Use the $1 forminstead.=item Can't weaken a nonreference(F) You attempted to weaken something that was not a reference. Onlyreferences can be weakened.=item Can't x= to read-only value(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.=item chmod() mode argument is missing initial 0(W chmod) A novice will sometimes say chmod 777, $filenamenot realizing that 777 will be interpreted as a decimal number,equivalent to 01411. Octal constants are introduced with a leading 0 inPerl, as in C.=item close() on unopened filehandle %s(W unopened) You tried to close a filehandle that was never opened.=item %s: Command not found(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 Compilation failed in require(F) Perl could not compile a file specified in a C<require> statement.Perl uses this generic message when none of the errors that itencountered were severe enough to halt compilation immediately.=item Complex regular subexpression recursion limit (%d) exceeded(W regexp) The regular expression engine uses recursion in complexsituations where back-tracking is required. Recursion depth is limitedto 32766, or perhaps less in architectures where the stack cannot growarbitrarily. ("Simple" and "medium" situations are handled withoutrecursion and are not subject to a limit.) Try shortening the stringunder examination; looping in Perl code (e.g. with C<while>) rather thanin the regular expression engine; or rewriting the regular expression sothat it is simpler or backtracks less. (See L<perlfaq2> for informationon I<Mastering Regular Expressions>.)=item connect() on closed socket %s(W closed) You tried to do a connect on a closed socket. Did you forgetto check the return value of your socket() call? SeeL<perlfunc/connect>.=item Constant(%s)%s: %s(F) The parser found inconsistencies either while attempting to definean overloaded constant, or when trying to find the character namespecified in the C<\N{...}> escape. Perhaps you forgot to load thecorresponding C<overload> or C<charnames> pragma? See L<charnames> andL<overload>.=item Constant is not %s reference(F) A constant value (perhaps declared using the C<use constant> pragma)is being dereferenced, but it amounts to the wrong type of reference.The message indicates the type of reference that was expected. Thisusually indicates a syntax error in dereferencing the constant value.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -