perl5005delta.html

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

HTML
1,169 行
字号
<dd>
<p>(F) The first time the %! hash is used, perl automatically loads the
Errno.pm module. The Errno module is expected to tie the %! hash to
provide symbolic names for <a href="../../lib/Pod/perlvar.html#item___"><code>$!</code></a> errno values.</p>
</dd>
</li>
<dt><strong><a name="item_cannot_find_an_opnumber_for__22_25s_22">Cannot find an opnumber for &quot;%s&quot;</a></strong>

<dd>
<p>(F) A string of a form <code>CORE::word</code> was given to prototype(), but
there is no builtin with the name <code>word</code>.</p>
</dd>
</li>
<dt><strong><a name="item_character_class_syntax__5b_2e__2e_5d_is_reserved_f">Character class syntax [. .] is reserved for future extensions</a></strong>

<dd>
<p>(W) Within regular expression character classes ([]) the syntax beginning
with &quot;[.&quot; and ending with &quot;.]&quot; is reserved for future extensions.
If you need to represent those character sequences inside a regular
expression character class, just quote the square brackets with the
backslash: &quot;\[.&quot; and &quot;.\]&quot;.</p>
</dd>
</li>
<dt><strong><a name="item_character_class_syntax__5b_3a__3a_5d_is_reserved_f">Character class syntax [: :] is reserved for future extensions</a></strong>

<dd>
<p>(W) Within regular expression character classes ([]) the syntax beginning
with &quot;[:&quot; and ending with &quot;:]&quot; is reserved for future extensions.
If you need to represent those character sequences inside a regular
expression character class, just quote the square brackets with the
backslash: &quot;\[:&quot; and &quot;:\]&quot;.</p>
</dd>
</li>
<dt><strong><a name="item_character_class_syntax__5b_3d__3d_5d_is_reserved_f">Character class syntax [= =] is reserved for future extensions</a></strong>

<dd>
<p>(W) Within regular expression character classes ([]) the syntax
beginning with &quot;[=&quot; and ending with &quot;=]&quot; is reserved for future extensions.
If you need to represent those character sequences inside a regular
expression character class, just quote the square brackets with the
backslash: &quot;\[=&quot; and &quot;=\]&quot;.</p>
</dd>
</li>
<dt><strong><a name="item__s_">%s: Eval-group in insecure regular expression</a></strong>

<dd>
<p>(F) Perl detected tainted data when trying to compile a regular expression
that contains the <code>(?{ ... })</code> zero-width assertion, which is unsafe.
See <a href="../../lib/Pod/perlre.html#___code___">(?{ code }) in the perlre manpage</a>, and <a href="../../lib/Pod/perlsec.html">the perlsec manpage</a>.</p>
</dd>
</li>
<dt><strong>%s: Eval-group not allowed, use re 'eval'</strong>

<dd>
<p>(F) A regular expression contained the <code>(?{ ... })</code> zero-width assertion,
but that construct is only allowed when the <code>use re 'eval'</code> pragma is
in effect.  See <a href="../../lib/Pod/perlre.html#___code___">(?{ code }) in the perlre manpage</a>.</p>
</dd>
</li>
<dt><strong>%s: Eval-group not allowed at run time</strong>

<dd>
<p>(F) Perl tried to compile a regular expression containing the <code>(?{ ... })</code>
zero-width assertion at run time, as it would when the pattern contains
interpolated values.  Since that is a security risk, it is not allowed.
If you insist, you may still do this by explicitly building the pattern
from an interpolated string at run time and using that in an eval().
See <a href="../../lib/Pod/perlre.html#___code___">(?{ code }) in the perlre manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_explicit_blessing_to__27_27__28assuming_package_ma">Explicit blessing to '' (assuming package main)</a></strong>

<dd>
<p>(W) You are blessing a reference to a zero length string.  This has
the effect of blessing the reference into the package main.  This is
usually not what you want.  Consider providing a default target
package, e.g. bless($ref, $p || 'MyPackage');</p>
</dd>
</li>
<dt><strong><a name="item_illegal_hex_digit_ignored">Illegal hex digit ignored</a></strong>

<dd>
<p>(W) You may have tried to use a character other than 0 - 9 or A - F in a
hexadecimal number.  Interpretation of the hexadecimal number stopped
before the illegal character.</p>
</dd>
</li>
<dt><strong><a name="item_no_such_array_field">No such array field</a></strong>

<dd>
<p>(F) You tried to access an array as a hash, but the field name used is
not defined.  The hash at index 0 should map all valid field names to
array indices for that to work.</p>
</dd>
</li>
<dt><strong><a name="item_no_such_field__22_25s_22_in_variable__25s_of_type_">No such field &quot;%s&quot; in variable %s of type %s</a></strong>

<dd>
<p>(F) You tried to access a field of a typed variable where the type
does not know about the field name.  The field names are looked up in
the %FIELDS hash in the type package at compile time.  The %FIELDS hash
is usually set up with the 'fields' pragma.</p>
</dd>
</li>
<dt><strong><a name="item_out_of_memory_during_ridiculously_large_request">Out of memory during ridiculously large request</a></strong>

<dd>
<p>(F) You can't allocate more than 2^31+&quot;small amount&quot; bytes.  This error
is most likely to be caused by a typo in the Perl program. e.g., <code>$arr[time]</code>
instead of <code>$arr[$time]</code>.</p>
</dd>
</li>
<dt><strong><a name="item_range_iterator_outside_integer_range">Range iterator outside integer range</a></strong>

<dd>
<p>(F) One (or both) of the numeric arguments to the range operator &quot;..&quot;
are outside the range which can be represented by integers internally.
One possible workaround is to force Perl to use magical string
increment by prepending &quot;0&quot; to your numbers.</p>
</dd>
</li>
<dt><strong><a name="item_recursive_inheritance_detected_while_looking_for_m">Recursive inheritance detected while looking for method '%s' %s</a></strong>

<dd>
<p>(F) More than 100 levels of inheritance were encountered while invoking a
method.  Probably indicates an unintended loop in your inheritance hierarchy.</p>
</dd>
</li>
<dt><strong><a name="item_reference_found_where_even_2dsized_list_expected">Reference found where even-sized list expected</a></strong>

<dd>
<p>(W) You gave a single reference where Perl was expecting a list with
an even number of elements (for assignment to a hash). This
usually means that you used the anon hash constructor when you meant 
to use parens. In any case, a hash requires key/value <strong>pairs</strong>.</p>
</dd>
<dd>
<pre>
    <span class="variable">%hash</span> <span class="operator">=</span> <span class="operator">{</span> <span class="string">one</span> <span class="operator">=&gt;</span> <span class="number">1</span><span class="operator">,</span> <span class="string">two</span> <span class="operator">=&gt;</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">}</span><span class="operator">;</span>   <span class="comment"># WRONG</span>
    <span class="variable">%hash</span> <span class="operator">=</span> <span class="operator">[</span> <span class="string">qw/ an anon array /</span> <span class="operator">]</span><span class="operator">;</span>   <span class="comment"># WRONG</span>
    <span class="variable">%hash</span> <span class="operator">=</span> <span class="operator">(</span> <span class="string">one</span> <span class="operator">=&gt;</span> <span class="number">1</span><span class="operator">,</span> <span class="string">two</span> <span class="operator">=&gt;</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">);</span>   <span class="comment"># right</span>
    <span class="variable">%hash</span> <span class="operator">=</span> <span class="string">qw( one 1 two 2 )</span><span class="operator">;</span>                 <span class="comment"># also fine</span>
</pre>
</dd>
</li>
<dt><strong><a name="item_undefined_value_assigned_to_typeglob">Undefined value assigned to typeglob</a></strong>

<dd>
<p>(W) An undefined value was assigned to a typeglob, a la <code>*foo = undef</code>.
This does nothing.  It's possible that you really mean <code>undef *foo</code>.</p>
</dd>
</li>
<dt><strong><a name="item_use_of_reserved_word__22_25s_22_is_deprecated">Use of reserved word &quot;%s&quot; is deprecated</a></strong>

<dd>
<p>(D) The indicated bareword is a reserved word.  Future versions of perl
may use it as a keyword, so you're better off either explicitly quoting
the word in a manner appropriate for its context of use, or using a
different name altogether.  The warning can be suppressed for subroutine
names by either adding a <code>&amp;</code> prefix, or using a package qualifier,
e.g. <a href="../../lib/Pod/perlfunc.html#item_our"><code>&amp;our()</code></a>, or <a href="../../lib/Pod/perlfunc.html#item_our"><code>Foo::our()</code></a>.</p>
</dd>
</li>
<dt><strong><a name="item_perl_3a_warning_3a_setting_locale_failed_2e">perl: warning: Setting locale failed.</a></strong>

<dd>
<p>(S) The whole warning message will look something like:</p>
</dd>
<dd>
<pre>
       perl: warning: Setting locale failed.
       perl: warning: Please check that your locale settings:
               LC_ALL = &quot;En_US&quot;,
               LANG = (unset)
           are supported and installed on your system.
       perl: warning: Falling back to the standard locale (&quot;C&quot;).</pre>
</dd>
<dd>
<p>Exactly what were the failed locale settings varies.  In the above the
settings were that the LC_ALL was &quot;En_US&quot; and the LANG had no value.
This error means that Perl detected that you and/or your system
administrator have set up the so-called variable system but Perl could
not use those settings.  This was not dead serious, fortunately: there
is a &quot;default locale&quot; called &quot;C&quot; that Perl can and will use, the
script will be run.  Before you really fix the problem, however, you
will get the same error message each time you run Perl.  How to really
fix the problem can be found in <a href="../../lib/Pod/perllocale.html#locale_problems">LOCALE PROBLEMS in the perllocale manpage</a>.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="obsolete_diagnostics">Obsolete Diagnostics</a></h1>
<dl>
<dt><strong><a name="item_mktemp">Can't <code>mktemp()</code></a></strong>

<dd>
<p>(F) The <a href="#item_mktemp"><code>mktemp()</code></a> routine failed for some reason while trying to process
a <strong>-e</strong> switch.  Maybe your /tmp partition is full, or clobbered.</p>
</dd>
<dd>
<p>Removed because <strong>-e</strong> doesn't use temporary files any more.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_write_to_temp_file_for__2de_3a__25s">Can't write to temp file for <strong>-e</strong>: %s</a></strong>

<dd>
<p>(F) The write routine failed for some reason while trying to process
a <strong>-e</strong> switch.  Maybe your /tmp partition is full, or clobbered.</p>
</dd>
<dd>
<p>Removed because <strong>-e</strong> doesn't use temporary files any more.</p>
</dd>
</li>
<dt><strong><a name="item_cannot_open_temporary_file">Cannot open temporary file</a></strong>

<dd>
<p>(F) The create routine failed for some reason while trying to process
a <strong>-e</strong> switch.  Maybe your /tmp partition is full, or clobbered.</p>
</dd>
<dd>
<p>Removed because <strong>-e</strong> doesn't use temporary files any more.</p>
</dd>
</li>
<dt><strong><a name="item_regexp_too_big">regexp too big</a></strong>

<dd>
<p>(F) The current implementation of regular expressions uses shorts as
address offsets within a string.  Unfortunately this means that if
the regular expression compiles to longer than 32767, it'll blow up.
Usually when you want a regular expression this big, there is a better
way to do it with multiple statements.  See <a href="../../lib/Pod/

⌨️ 快捷键说明

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