perldiag.html

来自「perl教程」· HTML 代码 · 共 1,387 行 · 第 1/5 页

HTML
1,387 行
字号
package name.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_localize_pseudo_2dhash_element">Can't localize pseudo-hash element</a></strong>

<dd>
<p>(F) You said something like <code>local $ar-&gt;{'key'}</code>, where $ar is a
reference to a pseudo-hash.  That hasn't been implemented yet, but you
can get a similar effect by localizing the corresponding array element
directly -- <code>local $ar-&gt;[$ar-&gt;[0]{'key'}]</code>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_localize_through_a_reference">Can't localize through a reference</a></strong>

<dd>
<p>(F) You said something like <code>local $$ref</code>, 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 <a href="../../lib/Pod/perlfunc.html#item_local"><code>local()</code></a> is finished, it can't be sure
that $ref will still be a reference.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_locate__25s">Can't locate %s</a></strong>

<dd>
<p>(F) You said to <a href="../../lib/Pod/perlfunc.html#item_do"><code>do</code></a> (or <a href="../../lib/Pod/perlfunc.html#item_require"><code>require</code></a>, or <a href="../../lib/Pod/perlfunc.html#item_use"><code>use</code></a>) a file that couldn't be
found. Perl looks for the file in all the locations mentioned in @INC,
unless the file name included the full path to the file.  Perhaps you
need to set the PERL5LIB or PERL5OPT environment variable to say where
the extra library is, or maybe the script needs to add the library name
to @INC.  Or maybe you just misspelled the name of the file.  See
<a href="../../lib/Pod/perlfunc.html#require">require in the perlfunc manpage</a> and <a href="../../lib/lib.html">the lib manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_locate_auto_2f_25s_2eal_in__40inc">Can't locate auto/%s.al in @INC</a></strong>

<dd>
<p>(F) A function (or method) was called in a package which allows
autoload, but there is no function to autoload.  Most probable causes
are a misprint in a function/method name or a failure to <code>AutoSplit</code>
the file, say, by doing <code>make install</code>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_locate_loadable_object_for_module__25s_in_">Can't locate loadable object for module %s in @INC</a></strong>

<dd>
<p>(F) The module you loaded is trying to load an external library, like
for example, <code>foo.so</code> or <code>bar.dll</code>, but the <a href="../../lib/DynaLoader.html">the DynaLoader manpage</a> module was
unable to locate this library.  See <a href="../../lib/DynaLoader.html">the DynaLoader manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_locate_object_method__22_25s_22_via_packag">Can't locate object method &quot;%s&quot; via package &quot;%s&quot;</a></strong>

<dd>
<p>(F) You called a method correctly, and it correctly indicated a package
functioning as a class, but that package doesn't define that particular
method, nor does any of its base classes.  See <a href="../../lib/Pod/perlobj.html">the perlobj manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_locate_package__25s_for__40_25s_3a_3aisa">Can't locate package %s for @%s::ISA</a></strong>

<dd>
<p>(W syntax) The @ISA array contained the name of another package that
doesn't seem to exist.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_locate_perlio_25s">Can't locate PerlIO%s</a></strong>

<dd>
<p>(F) You tried to use in <a href="#item_open"><code>open()</code></a> a PerlIO layer that does not exist,
e.g. open(FH, &quot;&gt;:nosuchlayer&quot;, &quot;somefile&quot;).</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_make_list_assignment_to__5c_25env_on_this_">Can't make list assignment to \%ENV on this system</a></strong>

<dd>
<p>(F) List assignment to %ENV is not supported on some systems, notably
VMS.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_modify__25s_in__25s">Can't modify %s in %s</a></strong>

<dd>
<p>(F) You aren't allowed to assign to the item indicated, or otherwise try
to change it, such as with an auto-increment.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_modify_nonexistent_substring">Can't modify nonexistent substring</a></strong>

<dd>
<p>(P) The internal routine that does assignment to a <a href="../../lib/Pod/perlvar.html#item_substr"><code>substr()</code></a> was handed
a NULL.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_modify_non_2dlvalue_subroutine_call">Can't modify non-lvalue subroutine call</a></strong>

<dd>
<p>(F) Subroutines meant to be used in lvalue context should be declared as
such, see <a href="../../lib/Pod/perlsub.html#lvalue_subroutines">Lvalue subroutines in the perlsub manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_msgrcv_to_read_2donly_var">Can't msgrcv to read-only var</a></strong>

<dd>
<p>(F) The target of a msgrcv must be modifiable to be used as a receive
buffer.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t__22next_22_outside_a_loop_block">Can't &quot;next&quot; outside a loop block</a></strong>

<dd>
<p>(F) A &quot;next&quot; statement was executed to reiterate the current block, but
there isn't a current block.  Note that an &quot;if&quot; or &quot;else&quot; block doesn't
count as a &quot;loopish&quot; block, as doesn't a block given to sort(), <a href="../../lib/Pod/perlfunc.html#item_map"><code>map()</code></a> or
grep().  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 <a href="../../lib/Pod/perlfunc.html#next">next in the perlfunc manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_open__25s_3a__25s">Can't open %s: %s</a></strong>

<dd>
<p>(S inplace) The implicit opening of a file through use of the <code>&lt;&gt;</code>
filehandle, either implicitly under the <a href="../../lib/Pod/perlrun.html#item__2dn"><code>-n</code></a> or <a href="../../lib/Pod/perlrun.html#item__2dp"><code>-p</code></a> command-line
switches, or explicitly, failed for the indicated reason.  Usually this
is because you don't have read permission for a file which you named on
the command line.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_open_a_reference">Can't open a reference</a></strong>

<dd>
<p>(W io) You tried to open a scalar reference for reading or writing,
using the 3-arg <a href="#item_open"><code>open()</code></a> syntax :</p>
</dd>
<dd>
<pre>
    <span class="keyword">open</span> <span class="variable">FH</span><span class="operator">,</span> <span class="string">'&gt;'</span><span class="operator">,</span> <span class="variable">$ref</span><span class="operator">;</span>
</pre>
</dd>
<dd>
<p>but your version of perl is compiled without perlio, and this form of
open is not supported.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_open_bidirectional_pipe">Can't open bidirectional pipe</a></strong>

<dd>
<p>(W pipe) You tried to say <a href="#item_open"><code>open(CMD, &quot;|cmd|&quot;)</code></a>, which is not supported.
You can try any of several modules in the Perl library to do this, such
as IPC::Open2.  Alternately, direct the pipe's output to a file using
&quot;&gt;&quot;, and then read it in under a different file handle.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_open_error_file__25s_as_stderr">Can't open error file %s as stderr</a></strong>

<dd>
<p>(F) An error peculiar to VMS.  Perl does its own command line
redirection, and couldn't open the file specified after '2&gt;' or '2&gt;&gt;' on
the command line for writing.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_open_input_file__25s_as_stdin">Can't open input file %s as stdin</a></strong>

<dd>
<p>(F) An error peculiar to VMS.  Perl does its own command line
redirection, and couldn't open the file specified after '&lt;' on the
command line for reading.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_open_output_file__25s_as_stdout">Can't open output file %s as stdout</a></strong>

<dd>
<p>(F) An error peculiar to VMS.  Perl does its own command line
redirection, and couldn't open the file specified after '&gt;' or '&gt;&gt;' on
the command line for writing.</p>
</dd>
</li>
<dt><strong><a name="item_pipe">Can't open output pipe (name: %s)</a></strong>

<dd>
<p>(P) An error peculiar to VMS.  Perl does its own command line
redirection, and couldn't open the pipe into which to send data destined
for stdout.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_open_perl_script_25s">Can't open perl script%s</a></strong>

<dd>
<p>(F) The script you specified can't be opened for the indicated reason.</p>
</dd>
<dd>
<p>If you're debugging a script that uses #!, and normally relies on the
shell's $PATH search, the -S option causes perl to do that search, so
you don't have to type the path or <code>`which $scriptname`</code>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_read_crtl_environ">Can't read CRTL environ</a></strong>

<dd>
<p>(S) A warning peculiar to VMS.  Perl tried to read an element of %ENV
from the CRTL's internal environment array and discovered the array was
missing.  You need to figure out where your CRTL misplaced its environ
or define <em>PERL_ENV_TABLES</em> (see <a href="../../lib/Pod/perlvms.html">the perlvms manpage</a>) so that environ is not
searched.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_redefine_active_sort_subroutine__25s">Can't redefine active sort subroutine %s</a></strong>

<dd>
<p>(F) Perl optimizes the internal handling of sort subroutines and keeps
pointers into them.  You tried to redefine one such sort subroutine when
it was currently active, which is not allowed.  If you really want to do
this, you should write <code>sort { &amp;func } @x</code> instead of <code>sort func @x</code>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t__22redo_22_outside_a_loop_block">Can't &quot;redo&quot; outside a loop block</a></strong>

<dd>
<p>(F) A &quot;redo&quot; statement was executed to restart the current block, but
there isn't a current block.  Note that an &quot;if&quot; or &quot;else&quot; block doesn't
count as a &quot;loopish&quot; block, as doesn't a block given to sort(), <a href="../../lib/Pod/perlfunc.html#item_map"><code>map()</code></a>
or grep().  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 <a href="../../lib/Pod/perlfunc.html#redo">redo in the perlfunc manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_remove__25s_3a__25s_2c_skipping_file">Can't remove %s: %s, skipping file</a></strong>

<dd>
<p>(S inplace) You requested an inplace edit without creating a backup
file.  Perl was unable to remove the original file to replace it with
the modified file.  The file was left unmodified.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_rename__25s_to__25s_3a__25s_2c_skipping_fi">Can't rename %s to %s: %s, skipping file</a></strong>

<dd>
<p>(S inplace) The rename done by the <strong>-i</strong> switch failed for some reason,
probably because you don't have write permission to the directory.</p>
</dd>
</li>
<dt><strong>Can't reopen input pipe (name: %s) in binary mode</strong>

<dd>
<p>(P) An error peculiar to VMS.  Perl thought stdin was a pipe, and tried
to reopen it to accept binary data.  Alas, it failed.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_resolve_method__60_25s_27_overloading__60_">Can't resolve method `%s' overloading `%s' in package `%s'</a></strong>

<dd>
<p>(F|P) Error resolving overloading specified by a method name (as opposed
to a subroutine reference): no such method callable via the package. If
method name is <code>???</code>, this is an internal error.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_reswap_uid_and_euid">Can't reswap uid and euid</a></strong>

<dd>
<p>(P) The <code>setreuid()</code> call failed for some reason in the setuid emulator of
suidperl.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_return__25s_from_lvalue_subroutine">Can't return %s from lvalue subroutine</a></strong>

<dd>
<p>(F) Perl detected an attempt to return illegal lvalues (such as
temporary or readonly values) from a subroutine used as an lvalue.  This
is not allowed.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_return_outside_a_subroutine">Can't return outside a subroutine</a></strong>

<dd>
<p>(F) The return statement was ex

⌨️ 快捷键说明

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