perl58delta.html
来自「perl教程」· HTML 代码 · 共 1,127 行 · 第 1/5 页
HTML
1,127 行
</p>
<h2><a name="aix_dynaloading">AIX Dynaloading</a></h2>
<p>The AIX dynaloading now uses in AIX releases 4.3 and newer the native
dlopen interface of AIX instead of the old emulated interface. This
change will probably break backward compatibility with compiled
modules. The change was made to make Perl more compliant with other
applications like mod_perl which are using the AIX native interface.</p>
<p>
</p>
<h2><a name="attributes_for_my_variables_now_handled_at_runtime">Attributes for <a href="../../lib/Pod/perlfunc.html#item_my"><code>my</code></a> variables now handled at run-time</a></h2>
<p>The <a href="../../lib/Pod/perlfunc.html#item_my_expr__3a_attrs"><code>my EXPR : ATTRS</code></a> syntax now applies variable attributes at
run-time. (Subroutine and <a href="../../lib/Pod/perlfunc.html#item_our"><code>our</code></a> variables still get attributes applied
at compile-time.) See <a href="../../lib/attributes.html">the attributes manpage</a> for additional details. In particular,
however, this allows variable attributes to be useful for <a href="../../lib/Pod/perlfunc.html#item_tie"><code>tie</code></a> interfaces,
which was a deficiency of earlier releases. Note that the new semantics
doesn't work with the Attribute::Handlers module (as of version 0.76).</p>
<p>
</p>
<h2><a name="socket_extension_dynamic_in_vms">Socket Extension Dynamic in VMS</a></h2>
<p>The Socket extension is now dynamically loaded instead of being
statically built in. This may or may not be a problem with ancient
TCP/IP stacks of VMS: we do not know since we weren't able to test
Perl in such configurations.</p>
<p>
</p>
<h2><a name="ieeeformat_floating_point_default_on_openvms_alpha">IEEE-format Floating Point Default on OpenVMS Alpha</a></h2>
<p>Perl now uses IEEE format (T_FLOAT) as the default internal floating
point format on OpenVMS Alpha, potentially breaking binary compatibility
with external libraries or existing data. G_FLOAT is still available as
a configuration option. The default on VAX (D_FLOAT) has not changed.</p>
<p>
</p>
<h2><a name="new_unicode_semantics__no_more_use_utf8__almost_">New Unicode Semantics (no more <code>use utf8</code>, almost)</a></h2>
<p>Previously in Perl 5.6 to use Unicode one would say "use utf8" and
then the operations (like string concatenation) were Unicode-aware
in that lexical scope.</p>
<p>This was found to be an inconvenient interface, and in Perl 5.8 the
Unicode model has completely changed: now the "Unicodeness" is bound
to the data itself, and for most of the time "use utf8" is not needed
at all. The only remaining use of "use utf8" is when the Perl script
itself has been written in the UTF-8 encoding of Unicode. (UTF-8 has
not been made the default since there are many Perl scripts out there
that are using various national eight-bit character sets, which would
be illegal in UTF-8.)</p>
<p>See <a href="../../lib/Pod/perluniintro.html">the perluniintro manpage</a> for the explanation of the current model,
and <a href="../../lib/utf8.html">the utf8 manpage</a> for the current use of the utf8 pragma.</p>
<p>
</p>
<h2><a name="new_unicode_properties">New Unicode Properties</a></h2>
<p>Unicode <em>scripts</em> are now supported. Scripts are similar to (and superior
to) Unicode <em>blocks</em>. The difference between scripts and blocks is that
scripts are the glyphs used by a language or a group of languages, while
the blocks are more artificial groupings of (mostly) 256 characters based
on the Unicode numbering.</p>
<p>In general, scripts are more inclusive, but not universally so. For
example, while the script <code>Latin</code> includes all the Latin characters and
their various diacritic-adorned versions, it does not include the various
punctuation or digits (since they are not solely <code>Latin</code>).</p>
<p>A number of other properties are now supported, including <code>\p{L&}</code>,
<code>\p{Any}</code> <code>\p{Assigned}</code>, <code>\p{Unassigned}</code>, <code>\p{Blank}</code> [561] and
<code>\p{SpacePerl}</code> [561] (along with their <code>\P{...}</code> versions, of course).
See <a href="../../lib/Pod/perlunicode.html">the perlunicode manpage</a> for details, and more additions.</p>
<p>The <code>In</code> or <code>Is</code> prefix to names used with the <code>\p{...}</code> and <code>\P{...}</code>
are now almost always optional. The only exception is that a <code>In</code> prefix
is required to signify a Unicode block when a block name conflicts with a
script name. For example, <code>\p{Tibetan}</code> refers to the script, while
<code>\p{InTibetan}</code> refers to the block. When there is no name conflict, you
can omit the <code>In</code> from the block name (e.g. <code>\p{BraillePatterns}</code>), but
to be safe, it's probably best to always use the <code>In</code>).</p>
<p>
</p>
<h2><a name="ref______instead_of_scalar_____"><code>REF(...)</code> Instead Of <code>SCALAR(...)</code></a></h2>
<p>A reference to a reference now stringifies as "REF(0x81485ec)" instead
of "SCALAR(0x81485ec)" in order to be more consistent with the return
value of ref().</p>
<p>
</p>
<h2><a name="pack_unpack_d_f_recycled">pack/unpack D/F recycled</a></h2>
<p>The undocumented pack/unpack template letters D/F have been recycled
for better use: now they stand for long double (if supported by the
platform) and NV (Perl internal floating point type). (They used
to be aliases for d/f, but you never knew that.)</p>
<p>
</p>
<h2><a name="glob___now_returns_filenames_in_alphabetical_order"><a href="../../lib/Pod/perlfunc.html#item_glob"><code>glob()</code></a> now returns filenames in alphabetical order</a></h2>
<p>The list of filenames from <a href="../../lib/Pod/perlfunc.html#item_glob"><code>glob()</code></a> (or <...>) is now by default sorted
alphabetically to be csh-compliant (which is what happened before
in most UNIX platforms). (bsd_glob() does still sort platform
natively, ASCII or EBCDIC, unless GLOB_ALPHASORT is specified.) [561]</p>
<p>
</p>
<h2><a name="deprecations">Deprecations</a></h2>
<ul>
<li>
<p>The semantics of bless(REF, REF) were unclear and until someone proves
it to make some sense, it is forbidden.</p>
</li>
<li>
<p>The obsolete chat2 library that should never have been allowed
to escape the laboratory has been decommissioned.</p>
</li>
<li>
<p>Using <a href="../../lib/Pod/perlfunc.html#item_chdir"><code>chdir("")</code></a> or <a href="../../lib/Pod/perlfunc.html#item_chdir"><code>chdir(undef)</code></a> instead of explicit <a href="../../lib/Pod/perlfunc.html#item_chdir"><code>chdir()</code></a> is
doubtful. A failure (think <a href="../../lib/Pod/perlfunc.html#item_chdir"><code>chdir(some_function())</code></a> can lead into
unintended <a href="../../lib/Pod/perlfunc.html#item_chdir"><code>chdir()</code></a> to the home directory, therefore this behaviour
is deprecated.</p>
</li>
<li>
<p>The builtin <a href="../../lib/Pod/perlfunc.html#item_dump"><code>dump()</code></a> function has probably outlived most of its
usefulness. The core-dumping functionality will remain in future
available as an explicit call to <a href="../../lib/Pod/perlfunc.html#item_dump"><code>CORE::dump()</code></a>, but in future
releases the behaviour of an unqualified <a href="../../lib/Pod/perlfunc.html#item_dump"><code>dump()</code></a> call may change.</p>
</li>
<li>
<p>The very dusty examples in the eg/ directory have been removed.
Suggestions for new shiny examples welcome but the main issue is that
the examples need to be documented, tested and (most importantly)
maintained.</p>
</li>
<li>
<p>The (bogus) escape sequences \8 and \9 now give an optional warning
("Unrecognized escape passed through"). There is no need to \-escape
any <code>\w</code> character.</p>
</li>
<li>
<p>The *glob{FILEHANDLE} is deprecated, use *glob{IO} instead.</p>
</li>
<li>
<p>The <code>package;</code> syntax (<a href="../../lib/Pod/perlfunc.html#item_package"><code>package</code></a> without an argument) has been
deprecated. Its semantics were never that clear and its
implementation even less so. If you have used that feature to
disallow all but fully qualified variables, <code>use strict;</code> instead.</p>
</li>
<li>
<p>The unimplemented POSIX regex features [[.cc.]] and [[=c=]] are still
recognised but now cause fatal errors. The previous behaviour of
ignoring them by default and warning if requested was unacceptable
since it, in a way, falsely promised that the features could be used.</p>
</li>
<li>
<p>In future releases, non-PerlIO aware XS modules may become completely
unsupported. Since PerlIO is a drop-in replacement for stdio at the
source code level, this shouldn't be that drastic a change.</p>
</li>
<li>
<p>Previous versions of perl and some readings of some sections of Camel
III implied that the <a href="../../lib/Pod/perlrun.html#item__3araw"><code>:raw</code></a> "discipline" was the inverse of <a href="../../lib/Pod/perlrun.html#item__3acrlf"><code>:crlf</code></a>.
Turning off "clrfness" is no longer enough to make a stream truly
binary. So the PerlIO <a href="../../lib/Pod/perlrun.html#item__3araw"><code>:raw</code></a> layer (or "discipline", to use the Camel
book's older terminology) is now formally defined as being equivalent
to <a href="../../lib/Pod/perlfunc.html#item_binmode"><code>binmode(FH)</code></a> - which is in turn defined as doing whatever is
necessary to pass each byte as-is without any translation. In
particular <a href="../../lib/Pod/perlfunc.html#item_binmode"><code>binmode(FH)</code></a> - and hence <a href="../../lib/Pod/perlrun.html#item__3araw"><code>:raw</code></a> - will now turn off both
CRLF and UTF-8 translation and remove other layers (e.g. :encoding())
which would modify byte stream.</p>
</li>
<li>
<p>The current user-visible implementation of pseudo-hashes (the weird
use of the first array element) is deprecated starting from Perl 5.8.0
and will be removed in Perl 5.10.0, and the feature will be
implemented differently. Not only is the current interface rather
ugly, but the current implementation slows down normal array and hash
use quite noticeably. The <code>fields</code> pragma interface will remain
available. The <em>restricted hashes</em> interface is expected to
be the replacement interface (see <a href="../../lib/Hash/Util.html">the Hash::Util manpage</a>). If your existing
programs depends on the underlying implementation, consider using
<a href="../../Class/PseudoHash.html">the Class::PseudoHash manpage</a> from CPAN.</p>
</li>
<li>
<p>The syntaxes <code>@a->[...]</code> and <code>%h->{...}</code> have now been deprecated.</p>
</li>
<li>
<p>After years of trying, suidperl is considered to be too complex to
ever be considered truly secure. The suidperl functionality is likely
to be removed in a future release.</p>
</li>
<li>
<p>The 5.005 threads model (module <code>Thread</code>) is deprecated and expected
to be removed in Perl 5.10. Multithreaded code should be migrated to
the new ithreads model (see <a href="../../lib/threads.html">the threads manpage</a>, <a href="../../lib/threads/shared.html">the threads::shared manpage</a> and
<a href="../../lib/Pod/perlthrtut.html">the perlthrtut manpage</a>).</p>
</li>
<li>
<p>The long deprecated uppercase aliases for the string comparison
operators (EQ, NE, LT, LE, GE, GT) have now been removed.</p>
</li>
<li>
<p>The tr///C and tr///U features have been removed and will not return;
the interface was a mistake. Sorry about that. For similar
functionality, see pack('U0', ...) and pack('C0', ...). [561]</p>
</li>
<li>
<p>Earlier Perls treated "sub foo (@bar)" as equivalent to "sub foo (@)".
The prototypes are now checked better at compile-time for invalid
syntax. An optional warning is generated ("Illegal character in
prototype...") but this may be upgraded to a fatal error in a future
release.</p>
</li>
<li>
<p>The <a href="../../lib/Pod/perlfunc.html#item_exec"><code>exec LIST</code></a> and <a href="../../lib/Pod/perlfunc.html#item_system"><code>system LIST</code></a> operations now produce warnings on
tainted data and in some future release they will produce fatal errors.</p>
</li>
<li>
<p>The existing behaviour when localising tied arrays and hashes is wrong,
and will be changed in a future release, so do not rely on the existing
behaviour. See <a href="#localising_tied_arrays_and_hashes_is_broken">Localising Tied Arrays and Hashes Is Broken</a>.</p>
</li>
</ul>
<p>
</p>
<hr />
<h1><a name="core_enhancements">Core Enhancements</a></h1>
<p>
</p>
<h2><a name="unicode_overhaul">Unicode Overhaul</a></h2>
<p>Unicode in general should be now much more usable than in Perl 5.6.0
(or even in 5.6.1). Unicode can be used in hash keys, Unicode in
regular expressions should work now, Unicode in tr/// should work now,
Unicode in I/O should work now. See <a href="../../lib/Pod/perluniintro.html">the perluniintro manpage</a> for introduction
and <a href="../../lib/Pod/perlunicode.html">the perlunicode manpage</a> for details.</p>
<ul>
<li>
<p>The Unicode Character Database coming with Perl has been upgraded
to Unicode 3.2.0. For more information, see <a href="http://www.unicode.org/">http://www.unicode.org/</a> .
[561+] (5.6.1 has UCD 3.0.1.)</p>
</li>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?