perldiag.html
来自「perl教程」· HTML 代码 · 共 1,387 行 · 第 1/5 页
HTML
1,387 行
<p>The <code>strict</code> pragma is useful in avoiding such errors.</p>
</dd>
</li>
<dt><strong><a name="item_bareword__22_25s_22_not_allowed_while__22strict_su">Bareword "%s" not allowed while "strict subs" in use</a></strong>
<dd>
<p>(F) With "strict subs" in use, a bareword is only allowed as a
subroutine identifier, in curly brackets or to the left of the "=>"
symbol. Perhaps you need to predeclare a subroutine?</p>
</dd>
</li>
<dt><strong><a name="item_bareword__22_25s_22_refers_to_nonexistent_package">Bareword "%s" refers to nonexistent package</a></strong>
<dd>
<p>(W bareword) You used a qualified bareword of the form <code>Foo::</code>, but the
compiler saw no other uses of that namespace before that point. Perhaps
you need to predeclare a package?</p>
</dd>
</li>
<dt><strong><a name="item_begin_failed_2d_2dcompilation_aborted">BEGIN failed--compilation aborted</a></strong>
<dd>
<p>(F) An untrapped exception was raised while executing a BEGIN
subroutine. Compilation stops immediately and the interpreter is
exited.</p>
</dd>
</li>
<dt><strong><a name="item_begin_not_safe_after_errors_2d_2dcompilation_abort">BEGIN not safe after errors--compilation aborted</a></strong>
<dd>
<p>(F) Perl found a <code>BEGIN {}</code> subroutine (or a <a href="../../lib/Pod/perlfunc.html#item_use"><code>use</code></a> directive, which
implies a <code>BEGIN {}</code>) after one or more compilation errors had already
occurred. Since the intended environment for the <code>BEGIN {}</code> could not
be guaranteed (due to the errors), and since subsequent code likely
depends on its correct operation, Perl just gave up.</p>
</dd>
</li>
<dt><strong><a name="item__5c1_better_written_as__241">\1 better written as $1</a></strong>
<dd>
<p>(W syntax) Outside of patterns, backreferences live on as variables.
The use of backslashes is grandfathered on the right-hand side of a
substitution, but stylistically it's better to use the variable form
because other Perl programmers will expect it, and it works better if
there are more than 9 backreferences.</p>
</dd>
</li>
<dt><strong><a name="item_binary_number__3e_0b111111111111111111111111111111">Binary number > 0b11111111111111111111111111111111 non-portable</a></strong>
<dd>
<p>(W portable) The binary number you specified is larger than 2**32-1
(4294967295) and therefore non-portable between systems. See
<a href="../../lib/Pod/perlport.html">the perlport manpage</a> for more on portability concerns.</p>
</dd>
</li>
<dt><strong><a name="item_bind"><code>bind()</code> on closed socket %s</a></strong>
<dd>
<p>(W closed) You tried to do a bind on a closed socket. Did you forget to
check the return value of your <a href="../../lib/Pod/perlfunc.html#item_socket"><code>socket()</code></a> call? See <a href="../../lib/Pod/perlfunc.html#bind">bind in the perlfunc manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_binmode"><code>binmode()</code> on closed filehandle %s</a></strong>
<dd>
<p>(W unopened) You tried <a href="#item_binmode"><code>binmode()</code></a> on a filehandle that was never opened.
Check you control flow and number of arguments.</p>
</dd>
</li>
<dt><strong><a name="item_bit_vector_size__3e_32_non_2dportable">Bit vector size > 32 non-portable</a></strong>
<dd>
<p>(W portable) Using bit vector sizes larger than 32 is non-portable.</p>
</dd>
</li>
<dt><strong><a name="item_bizarre_copy_of__25s_in__25s">Bizarre copy of %s in %s</a></strong>
<dd>
<p>(P) Perl detected an attempt to copy an internal value that is not
copyable.</p>
</dd>
</li>
<dt><strong><a name="item_buffer_overflow_in_prime_env_iter_3a__25s">Buffer overflow in prime_env_iter: %s</a></strong>
<dd>
<p>(W internal) A warning peculiar to VMS. While Perl was preparing to
iterate over %ENV, it encountered a logical name or symbol definition
which was too long, so it was truncated to the string shown.</p>
</dd>
</li>
<dt><strong><a name="item_callback_called_exit">Callback called exit</a></strong>
<dd>
<p>(F) A subroutine invoked from an external package via <code>call_sv()</code>
exited by calling exit.</p>
</dd>
</li>
<dt><strong>%s() called too early to check prototype</strong>
<dd>
<p>(W prototype) You've called a function that has a prototype before the
parser saw a definition or declaration for it, and Perl could not check
that the call conforms to the prototype. You need to either add an
early prototype declaration for the subroutine in question, or move the
subroutine definition ahead of the call to get proper prototype
checking. Alternatively, if you are certain that you're calling the
function correctly, you may put an ampersand before the name to avoid
the warning. See <a href="../../lib/Pod/perlsub.html">the perlsub manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_cannot_compress_integer_in_pack">Cannot compress integer in pack</a></strong>
<dd>
<p>(F) An argument to <a href="../../lib/Pod/perlfunc.html#item_pack"><code>pack("w",...)</code></a> was too large to compress. The BER
compressed integer format can only be used with positive integers, and you
attempted to compress Infinity or a very large number (> 1e308).
See <a href="../../lib/Pod/perlfunc.html#pack">pack in the perlfunc manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_cannot_compress_negative_numbers_in_pack">Cannot compress negative numbers in pack</a></strong>
<dd>
<p>(F) An argument to <a href="../../lib/Pod/perlfunc.html#item_pack"><code>pack("w",...)</code></a> was negative. The BER compressed integer
format can only be used with positive integers. See <a href="../../lib/Pod/perlfunc.html#pack">pack in the perlfunc manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_only_compress_unsigned_integers_in_pack">Can only compress unsigned integers in pack</a></strong>
<dd>
<p>(F) An argument to <a href="../../lib/Pod/perlfunc.html#item_pack"><code>pack("w",...)</code></a> was not an integer. The BER compressed
integer format can only be used with positive integers, and you attempted
to compress something else. See <a href="../../lib/Pod/perlfunc.html#pack">pack in the perlfunc manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_bless_non_2dreference_value">Can't bless non-reference value</a></strong>
<dd>
<p>(F) Only hard references may be blessed. This is how Perl "enforces"
encapsulation of objects. See <a href="../../lib/Pod/perlobj.html">the perlobj manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_call_method__22_25s_22_in_empty_package__2">Can't call method "%s" in empty package "%s"</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 have ANYTHING defined
in it, let alone methods. See <a href="../../lib/Pod/perlobj.html">the perlobj manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_call_method__22_25s_22_on_an_undefined_val">Can't call method "%s" on an undefined value</a></strong>
<dd>
<p>(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:</p>
</dd>
<dd>
<pre>
<span class="variable">$BADREF</span> <span class="operator">=</span> <span class="keyword">undef</span><span class="operator">;</span>
<span class="variable">process</span> <span class="variable">$BADREF</span> <span class="number">1</span><span class="operator">,</span><span class="number">2</span><span class="operator">,</span><span class="number">3</span><span class="operator">;</span>
<span class="variable">$BADREF</span><span class="operator">-></span><span class="variable">process</span><span class="operator">(</span><span class="number">1</span><span class="operator">,</span><span class="number">2</span><span class="operator">,</span><span class="number">3</span><span class="operator">);</span>
</pre>
</dd>
</li>
<dt><strong><a name="item_can_27t_call_method__22_25s_22_on_unblessed_refere">Can't call method "%s" on unblessed reference</a></strong>
<dd>
<p>(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 <a href="../../lib/Pod/perlobj.html">the perlobj manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_call_method__22_25s_22_without_a_package_o">Can't call method "%s" without a package or object reference</a></strong>
<dd>
<p>(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:</p>
</dd>
<dd>
<pre>
<span class="variable">$BADREF</span> <span class="operator">=</span> <span class="number">42</span><span class="operator">;</span>
<span class="variable">process</span> <span class="variable">$BADREF</span> <span class="number">1</span><span class="operator">,</span><span class="number">2</span><span class="operator">,</span><span class="number">3</span><span class="operator">;</span>
<span class="variable">$BADREF</span><span class="operator">-></span><span class="variable">process</span><span class="operator">(</span><span class="number">1</span><span class="operator">,</span><span class="number">2</span><span class="operator">,</span><span class="number">3</span><span class="operator">);</span>
</pre>
</dd>
</li>
<dt><strong><a name="item_can_27t_chdir_to__25s">Can't chdir to %s</a></strong>
<dd>
<p>(F) You called <code>perl -x/foo/bar</code>, but <code>/foo/bar</code> is not a directory
that you can chdir to, possibly because it doesn't exist.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_check_filesystem_of_script__22_25s_22_for_">Can't check filesystem of script "%s" for nosuid</a></strong>
<dd>
<p>(P) For some reason you can't check the filesystem of the script for
nosuid.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_coerce_array_into_hash">Can't coerce array into hash</a></strong>
<dd>
<p>(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.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_coerce__25s_to_integer_in__25s">Can't coerce %s to integer in %s</a></strong>
<dd>
<p>(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:</p>
</dd>
<dd>
<pre>
<span class="variable">*foo</span> <span class="operator">+=</span> <span class="number">1</span><span class="operator">;</span>
</pre>
</dd>
<dd>
<p>You CAN say</p>
</dd>
<dd>
<pre>
<span class="variable">$foo</span> <span class="operator">=</span> <span class="variable">*foo</span><span class="operator">;</span>
<span class="variable">$foo</span> <span class="operator">+=</span> <span class="number">1</span><span class="operator">;</span>
</pre>
</dd>
<dd>
<p>but then $foo no longer contains a glob.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_coerce__25s_to_number_in__25s">Can't coerce %s to number in %s</a></strong>
<dd>
<p>(F) Certain types of SVs, in particular real symbol table entries
(typeglobs), can't be forced to stop being what they are.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_coerce__25s_to_string_in__25s">Can't coerce %s to string in %s</a></strong>
<dd>
<p>(F) Certain types of SVs, in particular real symbol table entries
(typeglobs), can't be forced to stop being what they are.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_create_pipe_mailbox">Can't create pipe mailbox</a></strong>
<dd>
<p>(P) An error peculiar to VMS. The process is suffering from exhausted
quotas or other plumbing problems.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_declare_class_for_non_2dscalar__25s_in__22">Can't declare class for non-scalar %s in "%s"</a></strong>
<dd>
<p>(F) Currently, only scalar variables can be declared with a specific
class qualifier in a "my" or "our" declaration. The semantics may be
extended for other types of variables in future.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_declare__25s_in__22_25s_22">Can't declare %s in "%s"</a></strong>
<dd>
<p>(F) Only scalar, array, and hash variables may be declared as "my" or
"our" variables. They must have ordinary identifiers as names.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_do_inplace_edit_3a__25s_is_not_a_regular_f">Can't do inplace edit: %s is not a regular file</a></strong>
<dd>
<p>(S inplace) You tried to use the <strong>-i</strong> switch on a special file, such as
a file in /dev, or a FIFO. The file was ignored.</p>
</dd>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?