perl581delta.html

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

HTML
1,197 行
字号
<dt><strong><a name="item_text_3a_3abalanced">Text::Balanced</a></strong>

<dt><strong><a name="item_time_3a_3ahires">Time::HiRes</a></strong>

<dd>
<p>Use of nanosleep(), if available, allows mixing subsecond sleeps with
alarms.</p>
</dd>
</li>
<dt><strong><a name="item_threads">threads</a></strong>

<dd>
<p>Several fixes, for example for <a href="../../lib/Pod/perlfunc.html#item_join"><code>join()</code></a> problems and memory
leaks.  In some platforms (like Linux) that use glibc the minimum memory
footprint of one ithread has been reduced by several hundred kilobytes.</p>
</dd>
</li>
<dt><strong><a name="item_threads_3a_3ashared">threads::shared</a></strong>

<dd>
<p>Many memory leaks have been fixed.</p>
</dd>
</li>
<dt><strong><a name="item_unicode_3a_3acollate">Unicode::Collate</a></strong>

<dt><strong><a name="item_unicode_3a_3anormalize">Unicode::Normalize</a></strong>

<dt><strong><a name="item_win32_3a_3agetfolderpath">Win32::GetFolderPath</a></strong>

<dt><strong><a name="item_win32_3a_3agetosversion">Win32::GetOSVersion</a></strong>

<dd>
<p>Now returns extra information.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="utility_changes">Utility Changes</a></h1>
<p>The <code>h2xs</code> utility now produces a more modern layout:
<em>Foo-Bar/lib/Foo/Bar.pm</em> instead of <em>Foo/Bar/Bar.pm</em>.
Also, the boilerplate test is now called <em>t/Foo-Bar.t</em>
instead of <em>t/1.t</em>.</p>
<p>The Perl debugger (<em>lib/perl5db.pl</em>) has now been extensively
documented and bugs found while documenting have been fixed.</p>
<p><code>perldoc</code> has been rewritten from scratch to be more robust and
featureful.</p>
<p><code>perlcc -B</code> works now at least somewhat better, while <code>perlcc -c</code>
is rather more broken.  (The Perl compiler suite as a whole continues
to be experimental.)</p>
<p>
</p>
<hr />
<h1><a name="new_documentation">New Documentation</a></h1>
<p>perl573delta has been added to list the differences between the
(now quite obsolete) development releases 5.7.2 and 5.7.3.</p>
<p>perl58delta has been added: it is the perldelta of 5.8.0, detailing
the differences between 5.6.0 and 5.8.0.</p>
<p>perlartistic has been added: it is the Artistic License in pod format,
making it easier for modules to refer to it.</p>
<p>perlcheat has been added: it is a Perl cheat sheet.</p>
<p>perlgpl has been added: it is the GNU General Public License in pod
format, making it easier for modules to refer to it.</p>
<p>perlmacosx has been added to tell about the installation and use
of Perl in Mac OS X.</p>
<p>perlos400 has been added to tell about the installation and use
of Perl in OS/400 PASE.</p>
<p>perlreref has been added: it is a regular expressions quick reference.</p>
<p>
</p>
<hr />
<h1><a name="installation_and_configuration_improvements">Installation and Configuration Improvements</a></h1>
<p>The UNIX standard Perl location, <em>/usr/bin/perl</em>, is no longer
overwritten by default if it exists.  This change was very prudent
because so many UNIX vendors already provide a <em>/usr/bin/perl</em>,
but simultaneously many system utilities may depend on that
exact version of Perl, so better not to overwrite it.</p>
<p>One can now specify installation directories for site and vendor man
and HTML pages, and site and vendor scripts.  See <em>INSTALL</em>.</p>
<p>One can now specify a destination directory for Perl installation
by specifying the DESTDIR variable for <code>make install</code>.  (This feature
is slightly different from the previous <code>Configure -Dinstallprefix=...</code>.)
See <em>INSTALL</em>.</p>
<p>gcc versions 3.x introduced a new warning that caused a lot of noise
during Perl compilation: <code>gcc -Ialreadyknowndirectory (warning:
changing search order)</code>.  This warning has now been avoided by
Configure weeding out such directories before the compilation.</p>
<p>One can now build subsets of Perl core modules by using the
Configure flags <code>-Dnoextensions=...</code> and <code>-Donlyextensions=...</code>,
see <em>INSTALL</em>.</p>
<p>
</p>
<h2><a name="platformspecific_enhancements">Platform-specific enhancements</a></h2>
<p>In Cygwin Perl can now be built with threads (<code>Configure -Duseithreads</code>).
This works with both Cygwin 1.3.22 and Cygwin 1.5.3.</p>
<p>In newer FreeBSD releases Perl 5.8.0 compilation failed because of
trying to use <em>malloc.h</em>, which in FreeBSD is just a dummy file, and
a fatal error to even try to use.  Now <em>malloc.h</em> is not used.</p>
<p>Perl is now known to build also in Hitachi HI-UXMPP.</p>
<p>Perl is now known to build again in LynxOS.</p>
<p>Mac OS X now installs with Perl version number embedded in
installation directory names for easier upgrading of user-compiled
Perl, and the installation directories in general are more standard.
In other words, the default installation no longer breaks the
Apple-provided Perl.  On the other hand, with <code>Configure -Dprefix=/usr</code>
you can now really replace the Apple-supplied Perl (<strong>please be careful</strong>).</p>
<p>Mac OS X now builds Perl statically by default.  This change was done
mainly for faster startup times.  The Apple-provided Perl is still
dynamically linked and shared, and you can enable the sharedness for
your own Perl builds by <code>Configure -Duseshrplib</code>.</p>
<p>Perl has been ported to IBM's OS/400 PASE environment.  The best way
to build a Perl for PASE is to use an AIX host as a cross-compilation
environment.  See README.os400.</p>
<p>Yet another cross-compilation option has been added: now Perl builds
on OpenZaurus, an Linux distribution based on Mandrake + Embedix for
the Sharp Zaurus PDA.  See the Cross/README file.</p>
<p>Tru64 when using gcc 3 drops the optimisation for <em>toke.c</em> to <code>-O2</code>
because of gigantic memory use with the default <code>-O3</code>.</p>
<p>Tru64 can now build Perl with the newer Berkeley DBs.</p>
<p>Building Perl on WinCE has been much enhanced, see <em>README.ce</em>
and <em>README.perlce</em>.</p>
<p>
</p>
<hr />
<h1><a name="selected_bug_fixes">Selected Bug Fixes</a></h1>
<p>
</p>
<h2><a name="closures__eval_and_lexicals">Closures, eval and lexicals</a></h2>
<p>There have been many fixes in the area of anonymous subs, lexicals and
closures.  Although this means that Perl is now more &quot;correct&quot;, it is
possible that some existing code will break that happens to rely on
the faulty behaviour.  In practice this is unlikely unless your code
contains a very complex nesting of anonymous subs, evals and lexicals.</p>
<p>
</p>
<h2><a name="generic_fixes">Generic fixes</a></h2>
<p>If an input filehandle is marked <a href="../../lib/Pod/perlrun.html#item__3autf8"><code>:utf8</code></a> and Perl sees illegal UTF-8
coming in when doing <code>&lt;FH&gt;</code>, if warnings are enabled a warning is
immediately given - instead of being silent about it and Perl being
unhappy about the broken data later.  (The <code>:encoding(utf8)</code> layer
also works the same way.)</p>
<p>binmode(SOCKET, &quot;:utf8&quot;) only worked on the input side, not on the
output side of the socket.  Now it works both ways.</p>
<p>For threaded Perls certain system database functions like <a href="../../lib/Pod/perlfunc.html#item_getpwent"><code>getpwent()</code></a>
and <a href="../../lib/Pod/perlfunc.html#item_getgrent"><code>getgrent()</code></a> now grow their result buffer dynamically, instead of
failing.  This means that at sites with lots of users and groups the
functions no longer fail by returning only partial results.</p>
<p>Perl 5.8.0 had accidentally broken the capability for users
to define their own uppercase&lt;-&gt;lowercase Unicode mappings
(as advertised by the Camel).  This feature has been fixed and
is also documented better.</p>
<p>In 5.8.0 this</p>
<pre>
        <span class="variable">$some_unicode</span> <span class="operator">.=</span> <span class="operator">&lt;</span><span class="variable">FH</span><span class="operator">&gt;;</span>
</pre>
<p>didn't work correctly but instead corrupted the data.  This has now
been fixed.</p>
<p>Tied methods like FETCH etc. may now safely access tied values, i.e.
resulting in a recursive call to FETCH etc.  Remember to break the
recursion, though.</p>
<p>At startup Perl blocks the SIGFPE signal away since there isn't much
Perl can do about it.  Previously this blocking was in effect also for
programs executed from within Perl.  Now Perl restores the original
SIGFPE handling routine, whatever it was, before running external
programs.</p>
<p>Linenumbers in Perl scripts may now be greater than 65536, or 2**16.
(Perl scripts have always been able to be larger than that, it's just
that the linenumber for reported errors and warnings have &quot;wrapped
around&quot;.)  While scripts that large usually indicate a need to rethink
your code a bit, such Perl scripts do exist, for example as results
from generated code.  Now linenumbers can go all the way to
4294967296, or 2**32.</p>
<p>
</p>
<h2><a name="platformspecific_fixes">Platform-specific fixes</a></h2>
<p>Linux</p>
<ul>
<li>
<p>Setting $0 works again (with certain limitations that
Perl cannot do much about: see <a href="../../lib/Pod/perlvar.html#_0">$0 in the perlvar manpage</a>)</p>
</li>
</ul>
<p>HP-UX</p>
<ul>
<li>
<p>Setting $0 now works.</p>
</li>
</ul>
<p>VMS</p>
<ul>
<li>
<p>Configuration now tests for the presence of <code>poll()</code>, and IO::Poll
now uses the vendor-supplied function if detected.</p>
</li>
<li>
<p>A rare access violation at Perl start-up could occur if the Perl image was
installed with privileges or if there was an identifier with the
subsystem attribute set in the process's rightslist.  Either of these
circumstances triggered tainting code that contained a pointer bug. 
The faulty pointer arithmetic has been fixed.</p>
</li>
<li>
<p>The length limit on values (not keys) in the %ENV hash has been raised
from 255 bytes to 32640 bytes (except when the PERL_ENV_TABLES setting
overrides the default use of logical names for %ENV).  If it is
necessary to access these long values from outside Perl, be aware that
they are implemented using search list logical names that store the
value in pieces, each 255-byte piece (up to 128 of them) being an
element in the search list. When doing a lookup in %ENV from within
Perl, the elements are combined into a single value.  The existing
VMS-specific ability to access individual elements of a search list
logical name via the $ENV{'foo;N'} syntax (where N is the search list
index) is unimpaired.</p>
</li>
<li>
<p>The piping implementation now uses local rather than global DCL
symbols for inter-process communication.</p>
</li>
<li>
<p>File::Find could become confused when navigating to a relative
directory whose name collided with a logical name.  This problem has
been corrected by adding directory syntax to relative path names, thus
preventing logical name translation.</p>
</li>
</ul>
<p>Win32</p>
<ul>
<li>
<p>A memory leak in the <a href="../../lib/Pod/perlfunc.html#item_fork"><code>fork()</code></a> emulation has been fixed.</p>
</li>
<li>
<p>The return value of the <a href="../../lib/Pod/perlfunc.html#item_ioctl"><code>ioctl()</code></a> built-in function was accidentally
broken in 5.8.0.  This has been corrected.</p>
</li>
<li>
<p>The internal message loop executed by perl during blocking operations
sometimes interfered with messages that were external to Perl.
This often resulted in blocking operations terminating prematurely or
returning incorrect results, when Perl was executing under environments
that could generate Windows messages.  This has been corrected.</p>
</li>
<li>
<p>Pipes and sockets are now automatically in binary mode.</p>
</li>
<li>
<p>The four-argument form of <a href="../../lib/Pod/perlfunc.html#item_select"><code>select()</code></a> did not preserve $! (errno) properly
when there were errors in the underlying call.  This is now fixed.</p>
</li>
<li>
<p>The &quot;CR CR LF&quot; problem of has been fixed, binmode(FH, &quot;:crlf&quot;)
is now effectively a no-op.</p>
</li>
</ul>
<p>
</p>
<hr />
<h1><a name="new_or_changed_diagnostics">New or Changed Diagnostics</a></h1>
<p>All the warnings related to <a href="../../lib/Pod/perlfunc.html#item_pack"><code>pack()</code></a> and <a href="../../lib/Pod/perlfunc.html#item_unpack"><code>unpack()</code></a> were made more
informative and consistent.</p>
<p>
</p>
<h2><a name="changed_a_thread_exited_while__d_threads_were_running">Changed &quot;A thread exited while %d threads were running&quot;</a></h2>
<p>The old version</p>
<pre>
    A thread exited while %d other threads were still running</pre>
<p>was misleading because the &quot;other&quot; included also the thread giving
the warning.</p>
<p>
</p>
<h2><a name="removed_attempt_to_clear_a_restricted_hash">Removed &quot;Attempt to clear a restricted hash&quot;</a></h2>
<p>It is not illegal to clear a restricted hash, so the warning
was removed.</p>
<p>
</p>
<h2><a name="new_illegal_declaration_of_anonymous_subroutine">New &quot;Illegal declaration of anonymous subroutine&quot;</a></h2>
<p>You must specify the block of code for <a href="../../lib/Pod/perlfunc.html#item_sub"><code>sub</code></a>.</p>
<p>
</p>
<h2><a name="changed_invalid_range__s_in_transliteration_operator">Changed &quot;Invalid range &quot;%s&quot; in transliteration operator&quot;</a></h2>
<p>The old version</p>
<pre>
    Invalid [] range &quot;%s&quot; in transliteration operator</pre>
<p>was simply wrong because there are no &quot;[] ranges&quot; in tr///.</p>
<p>
</p>
<h2><a name="new_missing_control_char_name_in__c">New &quot;Missing control char name in \c&quot;</a></h2>
<p>Self-explanatory.</p>
<p>
</p>
<h2><a name="new_newline_in_leftjustified_string_for__s">New &quot;Newline in left-justified string for %s&quot;</a></h2>
<p>The padding spaces would appear after the newline, which is
probably not what you had in mind.</p>
<p>
</p>
<h2><a name="new_possible_precedence_problem_on_bitwise__c_operator">New &quot;Possible precedence problem on bitwise %c operator&quot;</a></h2>
<p>If you think this</p>
<pre>
    $x &amp; $y == 0</pre>
<p>tests whether the bitwise AND of $x and $y is zero,

⌨️ 快捷键说明

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