📄 ch33_01.htm
字号:
<dt><b><tt class="literal">Can't call method "</tt><em class="replaceable">%s</em><tt class="literal">" in empty package "</tt><em class="replaceable">%s</em><tt class="literal">"</tt></b></dt><dd><p>(F) You called a method correctly, and it correctly indicated a packagefunctioning as a class, but that package doesn't have <em class="emphasis">anything</em> definedin it, let alone methods.</p></dd><dt><b><tt class="literal">Can't call method "</tt><em class="replaceable">%s</em><tt class="literal">" on unblessed reference</tt></b></dt><dd><p>(F) A method call must know in what package it's supposed to run. Itordinarily finds this out from the object reference you supply, butyou didn't supply an object reference in this case. A reference isn'tan object reference until it has been blessed.</p></dd><dt><b><tt class="literal">Can't call method "</tt><em class="replaceable">%s</em><tt class="literal">" without a package or object reference</tt></b></dt><dd><p>(F) You used the syntax of a method call, but the slot filled by theobject reference or package name contains an expression that returns adefined value that is neither an object reference nor a package name. Something like this will reproduce the error:<blockquote><pre class="programlisting">$BADREF = 42;process $BADREF 1,2,3;$BADREF->process(1,2,3);</pre></blockquote></p></dd><dt><b><tt class="literal">Can't call method "</tt><em class="replaceable">%s</em><tt class="literal">" on an undefined value</tt></b></dt><dd><p>(F) You used the syntax of a method call, but the slot filled by theobject reference or package name contains an undefined value.Something like this will reproduce the error:<blockquote><pre class="programlisting">$BADREF = undef;process $BADREF 1,2,3;$BADREF->process(1,2,3);</pre></blockquote></p></dd><dt><b><tt class="literal">Can't chdir to</tt> <em class="replaceable">%s</em></b></dt><dd><p>(F) You called <tt class="command">perl -x/foo/bar</tt>, but <em class="emphasis">/foo/bar</em> is not a directorythat you can <tt class="literal">chdir</tt> to, possibly because it doesn't exist.</p></dd><dt><b><tt class="literal">Can't check filesystem of script "</tt><em class="replaceable">%s</em><tt class="literal">" for nosuid</tt></b></dt><dd><p>(P) For some reason you can't check the filesystem of the script for<tt class="literal">nosuid</tt>.</p></dd><dt><b><tt class="literal">Can't coerce</tt> <em class="replaceable">%s</em> <tt class="literal">to integer in</tt> <em class="replaceable">%s</em></b></dt><dd><p>(F) Certain types of SVs, in particular symbol table entries(typeglobs), can't be forced to stop being what they are. So youcan't say things like:<blockquote><pre class="programlisting">*foo += 1;</pre></blockquote>You <em class="emphasis">can</em> say:<blockquote><pre class="programlisting">$foo = *foo;$foo += 1;</pre></blockquote>but then <tt class="literal">$foo</tt> no longer contains a glob.</p></dd><dt><b><tt class="literal">Can't coerce</tt> <em class="replaceable">%s</em> <tt class="literal">to number in</tt> <em class="replaceable">%s</em></b></dt><dd><p>(F) Certain types of SVs, in particular symbol table entries(typeglobs), can't be forced to stop being what they are.</p></dd><dt><b><tt class="literal">Can't coerce</tt> <em class="replaceable">%s</em> <tt class="literal">to string in</tt> <em class="replaceable">%s</em></b></dt><dd><p>(F) Certain types of SVs, in particular symbol table entries(typeglobs), can't be forced to stop being what they are.</p></dd><dt><b><tt class="literal">Can't coerce array into hash</tt></b></dt><dd><p>(F) You used an array where a hash was expected, but the array has noinformation on how to map from keys to array indices. You can do thatonly with arrays that have a hash reference at index 0.</p></dd><dt><b><tt class="literal">Can't create pipe mailbox</tt></b></dt><dd><p>(P) This is an error peculiar to VMS. The process is suffering from exhaustedquotas or other plumbing problems.</p></dd><dt><b><tt class="literal">Can't declare class for non-scalar</tt> <em class="replaceable">%s</em> <tt class="literal">in "</tt><em class="replaceable">%s</em><tt class="literal">"</tt></b></dt><dd><p>(S) Currently, only scalar variables can declared with a specificclass qualifier in a <tt class="literal">my</tt> or <tt class="literal">our</tt> declaration. The semantics maybe extended for other types of variables in future.</p></dd><dt><b><tt class="literal">Can't declare</tt> <em class="replaceable">%s</em> <tt class="literal">in "</tt><em class="replaceable">%s</em><tt class="literal">"</tt></b></dt><dd><p>(F) Only scalar, array, and hash variables may be declared as <tt class="literal">my</tt> or<tt class="literal">our</tt> variables. They must have ordinary identifiers as names.</p></dd><dt><b><tt class="literal">Can't do inplace edit on</tt> <em class="replaceable">%s</em><tt class="literal">:</tt> <em class="replaceable">%s</em></b></dt><dd><p>(S inplace) The creation of the new file failed for the indicatedreason.</p></dd><dt><b><tt class="literal">Can't do inplace edit without backup</tt></b></dt><dd><p>(F) You're on a system such as MS-DOS that gets confused if you try readingfrom a deleted (but still opened) file. You have to say <tt class="command">-i.bak</tt>, or somesuch.</p></dd><dt><b><tt class="literal">Can't do inplace edit:</tt> <em class="replaceable">%s</em> <tt class="literal">would not be unique</tt></b></dt><dd><p>(S inplace) Your filesystem does not support filenames longer than 14characters and Perl was unable to create a unique filename duringinplace editing with the <span class="option">-i</span> switch. The file was ignored.</p></dd><dt><b><tt class="literal">Can't do inplace edit:</tt> <em class="replaceable">%s</em> <tt class="literal">is not a regular file</tt></b></dt><dd><p>(S inplace) You tried to use the <span class="option">-i</span> switch on a special file, suchas a file in <em class="emphasis">/dev</em>, or a FIFO. The file was ignored.</p></dd><dt><b><tt class="literal">Can't do setegid!</tt></b></dt><dd><p>(P) The <tt class="literal">setegid</tt> call failed for some reason in the setuid emulatorof <em class="emphasis">suidperl</em>.</p></dd><dt><b><tt class="literal">Can't do seteuid!</tt></b></dt><dd><p>(P) The setuid emulator of <em class="emphasis">suidperl</em> failed for some reason.</p></dd><dt><b><tt class="literal">Can't do setuid</tt></b></dt><dd><p>(F) This typically means that ordinary <em class="emphasis">perl</em> tried to <tt class="literal">exec</tt><em class="emphasis">suidperl</em> to do setuid emulation, but couldn't <tt class="literal">exec</tt> it. It looksfor a name of the form <em class="emphasis">sperl5.000</em> in the same directory that theperl executable resides under the name <em class="emphasis">perl5.000</em>, typically<em class="emphasis">/usr/local/bin</em> on Unix machines. If the file is there, check theexecute permissions. If it isn't, ask your sysadmin why not.</p></dd><dt><b><tt class="literal">Can't do waitpid with flags</tt></b></dt><dd><p>(F) This machine doesn't have either <tt class="literal">waitpid</tt> or <tt class="literal">wait4</tt>, so only<tt class="literal">waitpid</tt> without flags is emulated.</p></dd><dt><b><tt class="literal">Can't do {n,m} with n > m</tt></b></dt><dd><p>(F) Minima must be less than or equal to maxima. If you really wantyour regexp to match something 0 times, just use <tt class="literal">{0}</tt>.</p></dd><dt><b><tt class="literal">Can't emulate -</tt><em class="replaceable">%s</em> <tt class="literal">on #! line</tt></b></dt><dd><p>(F) The <tt class="literal">#!</tt> line specifies a switch that doesn't make sense at this point.For example, it would be kind of silly to put a <span class="option">-x</span> on the <tt class="literal">#!</tt> line.</p></dd><dt><b><tt class="literal">Can't exec "</tt><em class="replaceable">%s</em><tt class="literal">":</tt> <em class="replaceable">%s</em></b></dt><dd><p>(W exec) A <tt class="literal">system</tt>, <tt class="literal">exec</tt>, or piped <tt class="literal">open</tt> call could not executethe named program for the indicated reason. Typical reasons includethe permissions were wrong on the file, the file wasn't found in<tt class="literal">$ENV{PATH}</tt>, the executable in question was compiled for anotherarchitecture, or the <tt class="literal">#!</tt> line in a script points to an interpreter thatcan't be run for similar reasons. (Or maybe your system doesn'tsupport <tt class="literal">#!</tt> at all.)</p></dd><dt><b><tt class="literal">Can't exec</tt> <em class="replaceable">%s</em></b></dt><dd><p>(F) Perl was trying to execute the indicated program for you because that'swhat the <tt class="literal">#!</tt> line said to do. If that's not what you wanted, you may need tomention <tt class="literal">perl</tt> on the <tt class="literal">#!</tt> line somewhere.</p></dd><dt><b><tt class="literal">Can't execute</tt> <em class="replaceable">%s</em></b></dt><dd><p>(F) You used the <span class="option">-S</span> switch, but the copies of the script to execute foundin the <tt class="literal">PATH</tt> did not have correct permissions.</p></dd><dt><b><tt class="literal">Can't find</tt> <em class="replaceable">%s</em> <tt class="literal">on PATH, '.' not in PATH</tt></b></dt><dd><p>(F) You used the <span class="option">-S</span> switch, but the script to execute could not be foundin the <tt class="literal">PATH</tt>, or at least not with the correct permissions. The scriptexists in the current directory, but <tt class="literal">PATH</tt> prohibits running it.</p></dd><dt><b><tt class="literal">Can't find</tt> <em class="replaceable">%s</em> <tt class="literal">on PATH</tt></b></dt><dd><p>(F) You used the <span class="option">-S</span> switch, but the script to execute could not be foundin the <tt class="literal">PATH</tt>.</p></dd><dt><b><tt class="literal">Can't find label</tt> <em class="replaceable">%s</em></b></dt><dd><p>(F) You said to <tt class="literal">goto</tt> a label that isn't mentioned anywhere thatit's possible for us to go to.</p></dd><dt><b><tt class="literal">Can't find string terminator</tt> <em class="replaceable">%s</em> <tt class="literal">anywhere before EOF</tt></b></dt><dd><p>(F) Perl strings can stretch over multiple lines. This message means thatthe closing delimiter was omitted. Because bracketed quotes count nestinglevels, the following is missing its final parenthesis:<blockquote><pre class="programlisting">print q(The character '(' starts a side comment.);</pre></blockquote>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.</p></dd><dt><b><tt class="literal">Can't fork</tt></b></dt><dd><p>(F) A fatal error occurred trying to <tt class="literal">fork</tt>.</p></dd><dt><b><tt class="literal">Can't get filespec - stale stat buffer?</tt></b></dt><dd><p>(S) This warning is peculiar to VMS. This arises because of the differencebetween access checks under VMS and under the Unix model Perl assumes. Under VMS, access checks are done by filename, rather than by bits inthe <tt class="literal">stat</tt> buffer, so that ACLs and other protections can be taken intoaccount. Unfortunately, Perl assumes that the <tt class="literal">stat</tt> buffer containsall the necessary information and passes it, instead of the filespec,to the access-checking routine. It will try to retrieve the filespecusing the device name and FID present in the stat buffer, but if you have made a subsequent call to the CRTL <tt class="literal">stat</tt>routine, this won't work because the device name is overwritten with each call. Ifthis warning appears, the name lookup failed and the access-checkingroutine gave up and returned false, just to be conservative. (Note:the access-checking routine knows about the Perl <tt class="literal">stat</tt> operator andfile tests, so you shouldn't ever see this warning in response to aPerl command; it arises only if some internal code takes stat bufferslightly.)</p></dd><dt><b><tt class="literal">Can't get pipe mailbox device name</tt></b></dt><dd><p>(P) This error is peculiar to VMS. After creating a mailbox to act as apipe, Perl can't retrieve its name for later use.</p></dd><dt><b><tt class="literal">Can't get SYSGEN parameter value for MAXBUF</tt></b></dt><dd><p>(P) This error is peculiar to VMS. Perl asked <tt class="literal">$GETSYI</tt> how big you wantyour mailbox buffers to be, and it didn't get an answer.</p></dd><dt><b><tt class="literal">Can't goto subroutine outside a subroutine</tt></b></dt><dd><p>(F) The deeply magical <tt class="literal">goto</tt><em class="replaceable">SUBROUTINE</em> call can only replace onesubroutine call for another. It can't manufacture one out of wholecloth. In general, you should be calling it out of only an <tt class="literal">AUTOLOAD</tt>routine anyway.</p></dd><dt><b><tt class="literal">Can't goto subroutine from an eval-string</tt></b></dt><dd><p>(F) The <tt class="literal">goto</tt><em class="replaceable">SUBROUTINE</em> call can't be used to jump out of an<tt class="literal">eval</tt> string. (You can use it to jump out of an <tt class="literal">eval</tt><em class="replaceable">BLOCK</em>,but you probably don't want to.)</p></dd>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -