perl5005delta.html
来自「perl教程」· HTML 代码 · 共 1,169 行 · 第 1/5 页
HTML
1,169 行
</dd>
</li>
<dt><strong><a name="item_thread">Thread</a></strong>
<dd>
<p>Perl thread creation, manipulation, and support.</p>
</dd>
</li>
<dt><strong><a name="item_attrs">attrs</a></strong>
<dd>
<p>Set subroutine attributes.</p>
</dd>
</li>
<dt><strong><a name="item_fields">fields</a></strong>
<dd>
<p>Compile-time class fields.</p>
</dd>
</li>
<dt><strong><a name="item_re">re</a></strong>
<dd>
<p>Various pragmata to control behavior of regular expressions.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="changes_in_existing_modules">Changes in existing modules</a></h2>
<dl>
<dt><strong><a name="item_benchmark">Benchmark</a></strong>
<dd>
<p>You can now run tests for <em>x</em> seconds instead of guessing the right
number of tests to run.</p>
</dd>
<dd>
<p>Keeps better time.</p>
</dd>
</li>
<dt><strong><a name="item_carp">Carp</a></strong>
<dd>
<p>Carp has a new function cluck(). <code>cluck()</code> warns, like carp(), but also adds
a stack backtrace to the error message, like confess().</p>
</dd>
</li>
<dt><strong><a name="item_cgi">CGI</a></strong>
<dd>
<p>CGI has been updated to version 2.42.</p>
</dd>
</li>
<dt><strong><a name="item_fcntl">Fcntl</a></strong>
<dd>
<p>More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for
large (more than 4G) file access (the 64-bit support is not yet
working, though, so no need to get overly excited), Free/Net/OpenBSD
locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and
O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR.</p>
</dd>
</li>
<dt><strong><a name="item_math_3a_3acomplex">Math::Complex</a></strong>
<dd>
<p>The accessors methods Re, Im, arg, abs, rho, theta, methods can
($z-><code>Re())</code> now also act as mutators ($z->Re(3)).</p>
</dd>
</li>
<dt><strong><a name="item_math_3a_3atrig">Math::Trig</a></strong>
<dd>
<p>A little bit of radial trigonometry (cylindrical and spherical) added,
for example the great circle distance.</p>
</dd>
</li>
<dt><strong><a name="item_posix">POSIX</a></strong>
<dd>
<p>POSIX now has its own platform-specific hints files.</p>
</dd>
</li>
<dt><strong><a name="item_db_file">DB_File</a></strong>
<dd>
<p>DB_File supports version 2.x of Berkeley DB. See <code>ext/DB_File/Changes</code>.</p>
</dd>
</li>
<dt><strong><a name="item_makemaker">MakeMaker</a></strong>
<dd>
<p>MakeMaker now supports writing empty makefiles, provides a way to
specify that site <a href="../../lib/Pod/perlfunc.html#item_umask"><code>umask()</code></a> policy should be honored. There is also
better support for manipulation of .packlist files, and getting
information about installed modules.</p>
</dd>
<dd>
<p>Extensions that have both architecture-dependent and
architecture-independent files are now always installed completely in
the architecture-dependent locations. Previously, the shareable parts
were shared both across architectures and across perl versions and were
therefore liable to be overwritten with newer versions that might have
subtle incompatibilities.</p>
</dd>
</li>
<dt><strong><a name="item_cpan">CPAN</a></strong>
<dd>
<p>See <a href="../../lib/Pod/perlmodinstall.html">the perlmodinstall manpage</a> and <a href="../../lib/CPAN.html">the CPAN manpage</a>.</p>
</dd>
</li>
<dt><strong><a name="item_cwd">Cwd</a></strong>
<dd>
<p>Cwd::cwd is faster on most platforms.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="utility_changes">Utility Changes</a></h1>
<p><code>h2ph</code> and related utilities have been vastly overhauled.</p>
<p><code>perlcc</code>, a new experimental front end for the compiler is available.</p>
<p>The crude GNU <code>configure</code> emulator is now called <code>configure.gnu</code> to
avoid trampling on <code>Configure</code> under case-insensitive filesystems.</p>
<p><code>perldoc</code> used to be rather slow. The slower features are now optional.
In particular, case-insensitive searches need the <code>-i</code> switch, and
recursive searches need <code>-r</code>. You can set these switches in the
<code>PERLDOC</code> environment variable to get the old behavior.</p>
<p>
</p>
<hr />
<h1><a name="documentation_changes">Documentation Changes</a></h1>
<p>Config.pm now has a glossary of variables.</p>
<p><em>Porting/patching.pod</em> has detailed instructions on how to create and
submit patches for perl.</p>
<p><a href="../../lib/Pod/perlport.html">the perlport manpage</a> specifies guidelines on how to write portably.</p>
<p><a href="../../lib/Pod/perlmodinstall.html">the perlmodinstall manpage</a> describes how to fetch and install modules from <a href="#item_cpan"><code>CPAN</code></a>
sites.</p>
<p>Some more Perl traps are documented now. See <a href="../../lib/Pod/perltrap.html">the perltrap manpage</a>.</p>
<p><a href="../../lib/Pod/perlopentut.html">the perlopentut manpage</a> gives a tutorial on using open().</p>
<p><a href="../../lib/Pod/perlreftut.html">the perlreftut manpage</a> gives a tutorial on references.</p>
<p><a href="../../lib/Pod/perlthrtut.html">the perlthrtut manpage</a> gives a tutorial on threads.</p>
<p>
</p>
<hr />
<h1><a name="new_diagnostics">New Diagnostics</a></h1>
<dl>
<dt><strong><a name="item_s">Ambiguous call resolved as CORE::%s(), qualify as such or use &</a></strong>
<dd>
<p>(W) A subroutine you have declared has the same name as a Perl keyword,
and you have used the name without qualification for calling one or the
other. Perl decided to call the builtin because the subroutine is
not imported.</p>
</dd>
<dd>
<p>To force interpretation as a subroutine call, either put an ampersand
before the subroutine name, or qualify the name with its package.
Alternatively, you can import the subroutine (or pretend that it's
imported with the <code>use subs</code> pragma).</p>
</dd>
<dd>
<p>To silently interpret it as the Perl operator, use the <code>CORE::</code> prefix
on the operator (e.g. <a href="../../lib/Pod/perlfunc.html#item_log"><code>CORE::log($x)</code></a>) or by declaring the subroutine
to be an object method (see <a href="../../lib/attrs.html">the attrs manpage</a>).</p>
</dd>
</li>
<dt><strong><a name="item_bad_index_while_coercing_array_into_hash">Bad index while coercing array into hash</a></strong>
<dd>
<p>(F) The index looked up in the hash found as the 0'th element of a
pseudo-hash is not legal. Index values must be at 1 or greater.
See <a href="../../lib/Pod/perlref.html">the perlref manpage</a>.</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) 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_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="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_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_goto_subroutine_from_an_eval_2dstring">Can't goto subroutine from an eval-string</a></strong>
<dd>
<p>(F) The "goto subroutine" call can't be used to jump out of an eval "string".
(You can use it to jump out of an eval {BLOCK}, but you probably don't want to.)</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->{'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->[$ar->[0]{'key'}]</code>.</p>
</dd>
</li>
<dt><strong><a name="item_can_27t_use__25_25_21_because_errno_2epm_is_not_av">Can't use %%! because Errno.pm is not available</a></strong>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?