perl58delta.pod

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· POD 代码 · 共 2,134 行 · 第 1/5 页

POD
2,134
字号
=head1 NAMEperl58delta - what is new for perl v5.8.0=head1 DESCRIPTIONThis document describes differences between the 5.6.0 release andthe 5.8.0 release.Many of the bug fixes in 5.8.0 were already seen in the 5.6.1maintenance release since the two releases were kept closelycoordinated (while 5.8.0 was still called 5.7.something).Changes that were integrated into the 5.6.1 release are marked C<[561]>.Many of these changes have been further developed since 5.6.1 was released,those are marked C<[561+]>.You can see the list of changes in the 5.6.1 release (both from the5.005_03 release and the 5.6.0 release) by reading L<perl561delta>.=head1 Highlights In 5.8.0=over 4=item *Better Unicode support=item *New IO Implementation=item *New Thread Implementation=item *Better Numeric Accuracy=item *Safe Signals=item *Many New Modules=item *More Extensive Regression Testing=back=head1 Incompatible Changes=head2 Binary IncompatibilityB<Perl 5.8 is not binary compatible with earlier releases of Perl.>B<You have to recompile your XS modules.>(Pure Perl modules should continue to work.)The major reason for the discontinuity is the new IO architecturecalled PerlIO.  PerlIO is the default configuration because withoutit many new features of Perl 5.8 cannot be used.  In other words:you just have to recompile your modules containing XS code, sorryabout that.In future releases of Perl, non-PerlIO aware XS modules may becomecompletely unsupported.  This shouldn't be too difficult for moduleauthors, however: PerlIO has been designed as a drop-in replacement(at the source code level) for the stdio interface.Depending on your platform, there are also other reasons whywe decided to break binary compatibility, please read on.=head2 64-bit platforms and mallocIf your pointers are 64 bits wide, the Perl malloc is no longer beingused because it does not work well with 8-byte pointers.  Also,usually the system mallocs on such platforms are much better optimizedfor such large memory models than the Perl malloc.  Some memory-hungryPerl applications like the PDL don't work well with Perl's malloc.Finally, other applications than Perl (such as mod_perl) tend to preferthe system malloc.  Such platforms include Alpha and 64-bit HPPA,MIPS, PPC, and Sparc.=head2 AIX DynaloadingThe AIX dynaloading now uses in AIX releases 4.3 and newer the nativedlopen interface of AIX instead of the old emulated interface.  Thischange will probably break backward compatibility with compiledmodules.  The change was made to make Perl more compliant with otherapplications like mod_perl which are using the AIX native interface.=head2 Attributes for C<my> variables now handled at run-timeThe C<my EXPR : ATTRS> syntax now applies variable attributes atrun-time.  (Subroutine and C<our> variables still get attributes appliedat compile-time.)  See L<attributes> for additional details.  In particular,however, this allows variable attributes to be useful for C<tie> interfaces,which was a deficiency of earlier releases.  Note that the new semanticsdoesn't work with the Attribute::Handlers module (as of version 0.76).=head2 Socket Extension Dynamic in VMSThe Socket extension is now dynamically loaded instead of beingstatically built in.  This may or may not be a problem with ancientTCP/IP stacks of VMS: we do not know since we weren't able to testPerl in such configurations.=head2 IEEE-format Floating Point Default on OpenVMS AlphaPerl now uses IEEE format (T_FLOAT) as the default internal floatingpoint format on OpenVMS Alpha, potentially breaking binary compatibilitywith external libraries or existing data.  G_FLOAT is still available asa configuration option.  The default on VAX (D_FLOAT) has not changed.=head2 New Unicode Semantics (no more C<use utf8>, almost)Previously in Perl 5.6 to use Unicode one would say "use utf8" andthen the operations (like string concatenation) were Unicode-awarein that lexical scope.This was found to be an inconvenient interface, and in Perl 5.8 theUnicode model has completely changed: now the "Unicodeness" is boundto the data itself, and for most of the time "use utf8" is not neededat all.  The only remaining use of "use utf8" is when the Perl scriptitself has been written in the UTF-8 encoding of Unicode.  (UTF-8 hasnot been made the default since there are many Perl scripts out therethat are using various national eight-bit character sets, which wouldbe illegal in UTF-8.)See L<perluniintro> for the explanation of the current model,and L<utf8> for the current use of the utf8 pragma.=head2 New Unicode PropertiesUnicode I<scripts> are now supported. Scripts are similar to (and superiorto) Unicode I<blocks>. The difference between scripts and blocks is thatscripts are the glyphs used by a language or a group of languages, whilethe blocks are more artificial groupings of (mostly) 256 characters basedon the Unicode numbering.In general, scripts are more inclusive, but not universally so. Forexample, while the script C<Latin> includes all the Latin characters andtheir various diacritic-adorned versions, it does not include the variouspunctuation or digits (since they are not solely C<Latin>).A number of other properties are now supported, including C<\p{L&}>,C<\p{Any}> C<\p{Assigned}>, C<\p{Unassigned}>, C<\p{Blank}> [561] andC<\p{SpacePerl}> [561] (along with their C<\P{...}> versions, of course).See L<perlunicode> for details, and more additions.The C<In> or C<Is> prefix to names used with the C<\p{...}> and C<\P{...}>are now almost always optional. The only exception is that a C<In> prefixis required to signify a Unicode block when a block name conflicts with ascript name. For example, C<\p{Tibetan}> refers to the script, whileC<\p{InTibetan}> refers to the block. When there is no name conflict, youcan omit the C<In> from the block name (e.g. C<\p{BraillePatterns}>), butto be safe, it's probably best to always use the C<In>).=head2 REF(...) Instead Of SCALAR(...)A reference to a reference now stringifies as "REF(0x81485ec)" insteadof "SCALAR(0x81485ec)" in order to be more consistent with the returnvalue of ref().=head2 pack/unpack D/F recycledThe undocumented pack/unpack template letters D/F have been recycledfor better use: now they stand for long double (if supported by theplatform) and NV (Perl internal floating point type).  (They usedto be aliases for d/f, but you never knew that.)=head2 glob() now returns filenames in alphabetical orderThe list of filenames from glob() (or <...>) is now by default sortedalphabetically to be csh-compliant (which is what happened beforein most UNIX platforms).  (bsd_glob() does still sort platformnatively, ASCII or EBCDIC, unless GLOB_ALPHASORT is specified.) [561]=head2 Deprecations=over 4=item *The semantics of bless(REF, REF) were unclear and until someone provesit to make some sense, it is forbidden.=item *The obsolete chat2 library that should never have been allowedto escape the laboratory has been decommissioned.=item *Using chdir("") or chdir(undef) instead of explicit chdir() isdoubtful.  A failure (think chdir(some_function()) can lead intounintended chdir() to the home directory, therefore this behaviouris deprecated.=item *The builtin dump() function has probably outlived most of itsusefulness.  The core-dumping functionality will remain in futureavailable as an explicit call to C<CORE::dump()>, but in futurereleases the behaviour of an unqualified C<dump()> call may change.=item *The very dusty examples in the eg/ directory have been removed.Suggestions for new shiny examples welcome but the main issue is thatthe examples need to be documented, tested and (most importantly)maintained.=item *The (bogus) escape sequences \8 and \9 now give an optional warning("Unrecognized escape passed through").  There is no need to \-escapeany C<\w> character.=item *The *glob{FILEHANDLE} is deprecated, use *glob{IO} instead.=item *The C<package;> syntax (C<package> without an argument) has beendeprecated.  Its semantics were never that clear and itsimplementation even less so.  If you have used that feature todisallow all but fully qualified variables, C<use strict;> instead.=item *The unimplemented POSIX regex features [[.cc.]] and [[=c=]] are stillrecognised but now cause fatal errors.  The previous behaviour ofignoring them by default and warning if requested was unacceptablesince it, in a way, falsely promised that the features could be used.=item *In future releases, non-PerlIO aware XS modules may become completelyunsupported.  Since PerlIO is a drop-in replacement for stdio at thesource code level, this shouldn't be that drastic a change.=item *Previous versions of perl and some readings of some sections of CamelIII implied that the C<:raw> "discipline" was the inverse of C<:crlf>.Turning off "clrfness" is no longer enough to make a stream trulybinary. So the PerlIO C<:raw> layer (or "discipline", to use the Camelbook's older terminology) is now formally defined as being equivalentto binmode(FH) - which is in turn defined as doing whatever isnecessary to pass each byte as-is without any translation.  Inparticular binmode(FH) - and hence C<:raw> - will now turn off bothCRLF and UTF-8 translation and remove other layers (e.g. :encoding())which would modify byte stream.=item *The current user-visible implementation of pseudo-hashes (the weirduse of the first array element) is deprecated starting from Perl 5.8.0and will be removed in Perl 5.10.0, and the feature will beimplemented differently.  Not only is the current interface ratherugly, but the current implementation slows down normal array and hashuse quite noticeably. The C<fields> pragma interface will remainavailable.  The I<restricted hashes> interface is expected tobe the replacement interface (see L<Hash::Util>).  If your existingprograms depends on the underlying implementation, consider usingL<Class::PseudoHash> from CPAN.=item *The syntaxes C<< @a->[...] >> and  C<< %h->{...} >> have now been deprecated.=item *After years of trying, suidperl is considered to be too complex toever be considered truly secure.  The suidperl functionality is likelyto be removed in a future release.=item *The 5.005 threads model (module C<Thread>) is deprecated and expectedto be removed in Perl 5.10.  Multithreaded code should be migrated tothe new ithreads model (see L<threads>, L<threads::shared> andL<perlthrtut>).=item *The long deprecated uppercase aliases for the string comparisonoperators (EQ, NE, LT, LE, GE, GT) have now been removed.=item *The tr///C and tr///U features have been removed and will not return;the interface was a mistake.  Sorry about that.  For similarfunctionality, see pack('U0', ...) and pack('C0', ...). [561]=item *Earlier Perls treated "sub foo (@bar)" as equivalent to "sub foo (@)".The prototypes are now checked better at compile-time for invalidsyntax.  An optional warning is generated ("Illegal character inprototype...")  but this may be upgraded to a fatal error in a futurerelease.=item *The C<exec LIST> and C<system LIST> operations now produce warnings ontainted data and in some future release they will produce fatal errors.=item *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 existingbehaviour. See L<"Localising Tied Arrays and Hashes Is Broken">.=back=head1 Core Enhancements=head2 Unicode OverhaulUnicode 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 inregular expressions should work now, Unicode in tr/// should work now,Unicode in I/O should work now.  See L<perluniintro> for introductionand L<perlunicode> for details.=over 4=item *The Unicode Character Database coming with Perl has been upgradedto Unicode 3.2.0.  For more information, see http://www.unicode.org/ .[561+] (5.6.1 has UCD 3.0.1.)=item *For developers interested in enhancing Perl's Unicode capabilities:almost all the UCD files are included with the Perl distribution inthe F<lib/unicore> subdirectory.  The most notable omission, for spaceconsiderations, is the Unihan database.=item *The properties \p{Blank} and \p{SpacePerl} have been added. "Blank" is likeC isblank(), that is, it contains only "horizontal whitespace" (the spacecharacter is, the newline isn't), and the "SpacePerl" is the Unicodeequivalent of C<\s> (\p{Space} isn't, since that includes the verticaltabulator character, whereas C<\s> doesn't.)See "New Unicode Properties" earlier in this document for additionalinformation on changes with Unicode properties.=back=head2 PerlIO is Now The Default=over 4=item *IO is now by default done via PerlIO rather than system's "stdio".PerlIO allows "layers" to be "pushed" onto a file handle to alter thehandle's behaviour.  Layers can be specified at open time via 3-argform of open:   open($fh,'>:crlf :utf8', $path) || ...or on already opened handles via extended C<binmode>:   binmode($fh,':encoding(iso-8859-7)');The built-in layers are: unix (low level read/write), stdio (as inprevious Perls), perlio (re-implementation of stdio buffering in aportable manner), crlf (does CRLF <=> "\n" translation as on Win32,but available on any platform).  A mmap layer may be available ifplatform supports it (mostly UNIXes).Layers to be applied by default may be specified via the 'open' pragma.See L</"Installation and Configuration Improvements"> for the effectsof PerlIO on your architecture name.=item *If your platform supports fork(), you can use the list form of C<open>for pipes.  For example:    open KID_PS, "-|", "ps", "aux" or die $!;forks the ps(1) command (without spawning a shell, as there are morethan three arguments to open()), and reads its standard output via theC<KID_PS> filehandle.  See L<perlipc>.=item *File handles can be marked as accepting Perl's internal encoding of Unicode(UTF-8 or UTF-EBCDIC depending on platform) by a pseudo layer ":utf8" :   open($fh,">:utf8","Uni.txt");Note for EBCDIC users: the pseudo layer ":utf8" is erroneously namedfor you since it's not UTF-8 what you will be getting but insteadUTF-EBCDIC.  See L<perlunicode>, L<utf8>, andhttp://www.unicode.org/unicode/reports/tr16/ for more information.In future releases this naming may change.  See L<perluniintro>for more information about UTF-8.=item *If your environment variables (LC_ALL, LC_CTYPE, LANG) look like youwant to use UTF-8 (any of the variables match C</utf-?8/i>), yourSTDIN, STDOUT, STDERR handles and the default open layer (see L<open>)are marked as UTF-8.  (This feature, like other new features thatcombine Unicode and I/O, work only if you are using PerlIO, but that'sthe default.)Note that after this Perl really does assume that everything is UTF-8:for example if some input handle is not, Perl will probably very sooncomplain about the input data like this "Malformed UTF-8 ..." since

⌨️ 快捷键说明

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