perl561delta.html

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

HTML
1,261 行
字号
</dd>
</li>
<dt><strong><a name="item_pod_3a_3atext">Pod::Text</a></strong>

<dd>
<p>Pod::Text and related modules have been upgraded to the versions
in podlators suite v2.08.</p>
</dd>
</li>
<dt><strong><a name="item_sdbm_file">SDBM_File</a></strong>

<dd>
<p>On dosish platforms, some keys went missing because of lack of support for
files with &quot;holes&quot;.  A workaround for the problem has been added.</p>
</dd>
</li>
<dt><strong><a name="item_sys_3a_3asyslog">Sys::Syslog</a></strong>

<dd>
<p>Various bug fixes have been included.</p>
</dd>
</li>
<dt><strong><a name="item_tie_3a_3arefhash">Tie::RefHash</a></strong>

<dd>
<p>Now supports Tie::RefHash::Nestable to automagically tie hashref values.</p>
</dd>
</li>
<dt><strong><a name="item_tie_3a_3asubstrhash">Tie::SubstrHash</a></strong>

<dd>
<p>Various bug fixes have been included.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="platformspecific_improvements">Platform-specific improvements</a></h2>
<p>The following new ports are now available.</p>
<dl>
<dt><strong><a name="item_ncr_mp_2dras">NCR MP-RAS</a></strong>

<dt><strong><a name="item_nonstop_2dux">NonStop-UX</a></strong>

</dl>
<p>Perl now builds under Amdahl UTS.</p>
<p>Perl has also been verified to build under Amiga OS.</p>
<p>Support for EPOC has been much improved.  See README.epoc.</p>
<p>Building perl with -Duseithreads or -Duse5005threads now works
under HP-UX 10.20 (previously it only worked under 10.30 or later).
You will need a thread library package installed.  See README.hpux.</p>
<p>Long doubles should now work under Linux.</p>
<p>Mac OS Classic is now supported in the mainstream source package.
See README.macos.</p>
<p>Support for MPE/iX has been updated.  See README.mpeix.</p>
<p>Support for OS/2 has been improved.  See <code>os2/Changes</code> and README.os2.</p>
<p>Dynamic loading on z/OS (formerly OS/390) has been improved.  See
README.os390.</p>
<p>Support for VMS has seen many incremental improvements, including
better support for operators like backticks and system(), and better
%ENV handling.  See <code>README.vms</code> and <a href="../../lib/Pod/perlvms.html">the perlvms manpage</a>.</p>
<p>Support for Stratus VOS has been improved.  See <code>vos/Changes</code> and README.vos.</p>
<p>Support for Windows has been improved.</p>
<ul>
<li>
<p><a href="../../lib/Pod/perlfunc.html#item_fork"><code>fork()</code></a> emulation has been improved in various ways, but still continues
to be experimental.  See <a href="../../lib/Pod/perlfork.html">the perlfork manpage</a> for known bugs and caveats.</p>
</li>
<li>
<p>%SIG has been enabled under USE_ITHREADS, but its use is completely
unsupported under all configurations.</p>
</li>
<li>
<p>Borland C++ v5.5 is now a supported compiler that can build Perl.
However, the generated binaries continue to be incompatible with those
generated by the other supported compilers (GCC and Visual C++).</p>
</li>
<li>
<p>Non-blocking waits for child processes (or pseudo-processes) are
supported via <a href="../../lib/Pod/perlfunc.html#item_waitpid"><code>waitpid($pid, &amp;POSIX::WNOHANG)</code></a>.</p>
</li>
<li>
<p>A memory leak in <a href="../../lib/Pod/perlfunc.html#item_accept"><code>accept()</code></a> has been fixed.</p>
</li>
<li>
<p>wait(), <a href="../../lib/Pod/perlfunc.html#item_waitpid"><code>waitpid()</code></a> and backticks now return the correct exit status under
Windows 9x.</p>
</li>
<li>
<p>Trailing new %ENV entries weren't propagated to child processes.  This
is now fixed.</p>
</li>
<li>
<p>Current directory entries in %ENV are now correctly propagated to child
processes.</p>
</li>
<li>
<p>Duping socket handles with open(F, &quot;&gt;&amp;MYSOCK&quot;) now works under Windows 9x.</p>
</li>
<li>
<p>The makefiles now provide a single switch to bulk-enable all the features
enabled in ActiveState ActivePerl (a popular binary distribution).</p>
</li>
<li>
<p>Win32::GetCwd() correctly returns C:\ instead of C: when at the drive root.
Other bugs in <a href="../../lib/Pod/perlfunc.html#item_chdir"><code>chdir()</code></a> and Cwd::cwd() have also been fixed.</p>
</li>
<li>
<p><a href="../../lib/Pod/perlfunc.html#item_fork"><code>fork()</code></a> correctly returns undef and sets EAGAIN when it runs out of
pseudo-process handles.</p>
</li>
<li>
<p>ExtUtils::MakeMaker now uses $ENV{LIB} to search for libraries.</p>
</li>
<li>
<p>UNC path handling is better when perl is built to support fork().</p>
</li>
<li>
<p>A handle leak in socket handling has been fixed.</p>
</li>
<li>
<p><a href="../../lib/Pod/perlfunc.html#item_send"><code>send()</code></a> works from within a pseudo-process.</p>
</li>
</ul>
<p>Unless specifically qualified otherwise, the remainder of this document
covers changes between the 5.005 and 5.6.0 releases.</p>
<p>
</p>
<hr />
<h1><a name="core_enhancements">Core Enhancements</a></h1>
<p>
</p>
<h2><a name="interpreter_cloning__threads__and_concurrency">Interpreter cloning, threads, and concurrency</a></h2>
<p>Perl 5.6.0 introduces the beginnings of support for running multiple
interpreters concurrently in different threads.  In conjunction with
the <code>perl_clone()</code> API call, which can be used to selectively duplicate
the state of any given interpreter, it is possible to compile a
piece of code once in an interpreter, clone that interpreter
one or more times, and run all the resulting interpreters in distinct
threads.</p>
<p>On the Windows platform, this feature is used to emulate <a href="../../lib/Pod/perlfunc.html#item_fork"><code>fork()</code></a> at the
interpreter level.  See <a href="../../lib/Pod/perlfork.html">the perlfork manpage</a> for details about that.</p>
<p>This feature is still in evolution.  It is eventually meant to be used
to selectively clone a subroutine and data reachable from that
subroutine in a separate interpreter and run the cloned subroutine
in a separate thread.  Since there is no shared data between the
interpreters, little or no locking will be needed (unless parts of
the symbol table are explicitly shared).  This is obviously intended
to be an easy-to-use replacement for the existing threads support.</p>
<p>Support for cloning interpreters and interpreter concurrency can be
enabled using the -Dusethreads Configure option (see win32/Makefile for
how to enable it on Windows.)  The resulting perl executable will be
functionally identical to one that was built with -Dmultiplicity, but
the <code>perl_clone()</code> API call will only be available in the former.</p>
<p>-Dusethreads enables the cpp macro USE_ITHREADS by default, which in turn
enables Perl source code changes that provide a clear separation between
the op tree and the data it operates with.  The former is immutable, and
can therefore be shared between an interpreter and all of its clones,
while the latter is considered local to each interpreter, and is therefore
copied for each clone.</p>
<p>Note that building Perl with the -Dusemultiplicity Configure option
is adequate if you wish to run multiple <strong>independent</strong> interpreters
concurrently in different threads.  -Dusethreads only provides the
additional functionality of the <code>perl_clone()</code> API call and other
support for running <strong>cloned</strong> interpreters concurrently.</p>
<pre>
    NOTE: This is an experimental feature.  Implementation details are
    subject to change.</pre>
<p>
</p>
<h2><a name="lexically_scoped_warning_categories">Lexically scoped warning categories</a></h2>
<p>You can now control the granularity of warnings emitted by perl at a finer
level using the <code>use warnings</code> pragma.  <a href="../../lib/warnings.html">the warnings manpage</a> and <a href="../../lib/Pod/perllexwarn.html">the perllexwarn manpage</a>
have copious documentation on this feature.</p>
<p>
</p>
<h2><a name="unicode_and_utf8_support">Unicode and UTF-8 support</a></h2>
<p>Perl now uses UTF-8 as its internal representation for character
strings.  The <code>utf8</code> and <code>bytes</code> pragmas are used to control this support
in the current lexical scope.  See <a href="../../lib/Pod/perlunicode.html">the perlunicode manpage</a>, <a href="../../lib/utf8.html">the utf8 manpage</a> and <a href="../../lib/bytes.html">the bytes manpage</a> for
more information.</p>
<p>This feature is expected to evolve quickly to support some form of I/O
disciplines that can be used to specify the kind of input and output data
(bytes or characters).  Until that happens, additional modules from CPAN
will be needed to complete the toolkit for dealing with Unicode.</p>
<pre>
    NOTE: This should be considered an experimental feature.  Implementation
    details are subject to change.</pre>
<p>
</p>
<h2><a name="support_for_interpolating_named_characters">Support for interpolating named characters</a></h2>
<p>The new <code>\N</code> escape interpolates named characters within strings.
For example, <code>&quot;Hi! \N{WHITE SMILING FACE}&quot;</code> evaluates to a string
with a Unicode smiley face at the end.</p>
<p>
</p>
<h2><a name="our_declarations">&quot;our&quot; declarations</a></h2>
<p>An &quot;our&quot; declaration introduces a value that can be best understood
as a lexically scoped symbolic alias to a global variable in the
package that was current where the variable was declared.  This is
mostly useful as an alternative to the <code>vars</code> pragma, but also provides
the opportunity to introduce typing and other attributes for such
variables.  See <a href="../../lib/Pod/perlfunc.html#our">our in the perlfunc manpage</a>.</p>
<p>
</p>
<h2><a name="support_for_strings_represented_as_a_vector_of_ordinals">Support for strings represented as a vector of ordinals</a></h2>
<p>Literals of the form <code>v1.2.3.4</code> are now parsed as a string composed
of characters with the specified ordinals.  This is an alternative, more
readable way to construct (possibly Unicode) strings instead of
interpolating characters, as in <code>&quot;\x{1}\x{2}\x{3}\x{4}&quot;</code>.  The leading
<code>v</code> may be omitted if there are more than two ordinals, so <code>1.2.3</code> is
parsed the same as <code>v1.2.3</code>.</p>
<p>Strings written in this form are also useful to represent version &quot;numbers&quot;.
It is easy to compare such version &quot;numbers&quot; (which are really just plain
strings) using any of the usual string comparison operators <code>eq</code>, <code>ne</code>,
<code>lt</code>, <code>gt</code>, etc., or perform bitwise string operations on them using <code>|</code>,
<code>&amp;</code>, etc.</p>
<p>In conjunction with the new <a href="../../lib/Pod/perlvar.html#item___v"><code>$^V</code></a> magic variable (which contains
the perl version as a string), such literals can be used as a readable way
to check if you're running a particular version of Perl:</p>
<pre>
    <span class="comment"># this will parse in older versions of Perl also</span>
    <span class="keyword">if</span> <span class="operator">(</span><span class="variable">$^V</span> <span class="keyword">and</span> <span class="variable">$^V</span> <span class="keyword">gt</span> <span class="variable">v5</span><span class="number">.6</span><span class="operator">.</span><span class="number">0</span><span class="operator">)</span> <span class="operator">{</span>
        <span class="comment"># new features supported</span>
    <span class="operator">}</span>
</pre>
<p><a href="../../lib/Pod/perlfunc.html#item_require"><code>require</code></a> and <a href="../../lib/Pod/perlfunc.html#item_use"><code>use</code></a> also have some special magic to support such literals.
They will be interpreted as a version rather than as a module name:</p>
<pre>
    <span class="keyword">require</span> <span class="variable">v5</span><span class="number">.6</span><span class="operator">.</span><span class="number">0</span><span class="operator">;</span>             <span class="comment"># croak if $^V lt v5.6.0</span>
    <span class="keyword">use</span> <span class="variable">v5</span><span class="number">.6</span><span class="operator">.</span><span class="number">0</span><span class="operator">;</span>                 <span class="comment"># same, but croaks at compile-time</span>
</pre>
<p>Alternatively, the <code>v</code> may be omitted if there is more than one dot:</p>
<pre>
    <span class="keyword">require</span> <span class="number">5.6</span><span class="operator">.</span><span class="number">0</span><span class="operator">;</span>
    <span class="keyword">use</span> <span class="number">5.6</span><span class="operator">.</span><span class="number">0</span><span class="operator">;</span>
</pre>
<p>Also, <a href="../../lib/Pod/perlfunc.html#item_sprintf"><code>sprintf</code></a> and <a href="../../lib/Pod/perlfunc.html#item_printf"><code>printf</code></a> support the Perl-specific format flag <code>%v</code>
to print ordinals of characters in arbitrary strings:</p>
<pre>
    <span class="keyword">printf</span> <span class="string">"v%vd"</span><span class="operator">,</span> <span class="variable">$^V</span><span class="operator">;</span>         <span class="comment"># prints current version, such as "v5.5.650"</span>
    <span class="keyword">printf</span> <span class="string">"%*vX"</span><span class="operator">,</span> <span class="string">":"</span><span class="operator">,</span> <span class="variable">$addr</span><span class="operator">;</span>  <span class="comment"># formats IPv6 address</span>
    <span class="keyword">printf</span> <span class="string">"%*vb"</span><span class="operator">,</span> <span class="string">" "</span><span class="operator">,</span> <span class="variable">$bits</span><span class="operator">;</span>  <span class="comment"># displays bitstring</span>
</pre>
<p>See <a href="../../lib/Pod/perldata.html#scalar_value_constructors">Scalar value constructors in the perldata manpage</a> for additional information.</p>
<p>
</p>
<h2><a name="improved_perl_version_numbering_system">Improved Perl version numbering system</a></h2>
<p>Beginning with Perl version 5.6.0, the version number convention has been
changed to a &quot;dotted integer&quot; scheme that is more commonly found in open
source projects.</p>
<p>Maintenance versions of v5.6.0 will be released as v5.6.1, v5.6.2 etc.
The next development series following v5.6.0 will be numbered v5.7.x,

⌨️ 快捷键说明

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