perl581delta.pod

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

POD
1,103
字号
=head1 NAMEperl581delta - what is new for perl v5.8.1=head1 DESCRIPTIONThis document describes differences between the 5.8.0 release andthe 5.8.1 release.If you are upgrading from an earlier release such as 5.6.1, first readthe L<perl58delta>, which describes differences between 5.6.0 and5.8.0.In case you are wondering about 5.6.1, it was bug-fix-wise ratheridentical to the development release 5.7.1.  Confused?  This timelinehopefully helps a bit: it lists the new major releases, their maintenancereleases, and the development releases.          New     Maintenance  Development          5.6.0                             2000-Mar-22                               5.7.0        2000-Sep-02                  5.6.1                     2001-Apr-08                               5.7.1        2001-Apr-09                               5.7.2        2001-Jul-13                               5.7.3        2002-Mar-05          5.8.0                             2002-Jul-18                  5.8.1                     2003-Sep-25=head1 Incompatible Changes=head2 Hash RandomisationMainly due to security reasons, the "random ordering" of hasheshas been made even more random.  Previously while the order of hashelements from keys(), values(), and each() was essentially random,it was still repeatable.  Now, however, the order varies betweendifferent runs of Perl.B<Perl has never guaranteed any ordering of the hash keys>, and theordering has already changed several times during the lifetime ofPerl 5.  Also, the ordering of hash keys has always been, andcontinues to be, affected by the insertion order.The added randomness may affect applications.One possible scenario is when output of an application has includedhash data.  For example, if you have used the Data::Dumper module todump data into different files, and then compared the files to seewhether the data has changed, now you will have false positives sincethe order in which hashes are dumped will vary.  In general the cureis to sort the keys (or the values); in particular for Data::Dumper touse the C<Sortkeys> option.  If some particular order is reallyimportant, use tied hashes: for example the Tie::IxHash modulewhich by default preserves the order in which the hash elementswere added.More subtle problem is reliance on the order of "global destruction".That is what happens at the end of execution: Perl destroys all datastructures, including user data.  If your destructors (the DESTROYsubroutines) have assumed any particular ordering to the globaldestruction, there might be problems ahead.  For example, in adestructor of one object you cannot assume that objects of any otherclass are still available, unless you hold a reference to them.If the environment variable PERL_DESTRUCT_LEVEL is set to a non-zerovalue, or if Perl is exiting a spawned thread, it will also destructthe ordinary references and the symbol tables that are no longer in use.You can't call a class method or an ordinary function on a class thathas been collected that way.The hash randomisation is certain to reveal hidden assumptions aboutsome particular ordering of hash elements, and outright bugs: itrevealed a few bugs in the Perl core and core modules.To disable the hash randomisation in runtime, set the environmentvariable PERL_HASH_SEED to 0 (zero) before running Perl (for moreinformation see L<perlrun/PERL_HASH_SEED>), or to disable the featurecompletely in compile time, compile with C<-DNO_HASH_SEED> (see F<INSTALL>).See L<perlsec/"Algorithmic Complexity Attacks"> for the originalrationale behind this change.=head2 UTF-8 On Filehandles No Longer Activated By LocaleIn Perl 5.8.0 all filehandles, including the standard filehandles,were implicitly set to be in Unicode UTF-8 if the locale settingsindicated the use of UTF-8.  This feature caused too many problems,so the feature was turned off and redesigned: see L</"Core Enhancements">.=head2 Single-number v-strings are no longer v-strings before "=>"The version strings or v-strings (see L<perldata/"Version Strings">)feature introduced in Perl 5.6.0 has been a source of some confusion--especially when the user did not want to use it, but Perl thought itknew better.  Especially troublesome has been the feature that beforea "=>" a version string (a "v" followed by digits) has been interpretedas a v-string instead of a string literal.  In other words:	%h = ( v65 => 42 );has meant since Perl 5.6.0	%h = ( 'A' => 42 );(at least in platforms of ASCII progeny)  Perl 5.8.1 restores themore natural interpretation	%h = ( 'v65' => 42 );The multi-number v-strings like v65.66 and 65.66.67 still continue tobe v-strings in Perl 5.8.=head2 (Win32) The -C Switch Has Been RepurposedThe -C switch has changed in an incompatible way.  The old semanticsof this switch only made sense in Win32 and only in the "use utf8"universe in 5.6.x releases, and do not make sense for the Unicodeimplementation in 5.8.0.  Since this switch could not have been usedby anyone, it has been repurposed.  The behavior that this switchenabled in 5.6.x releases may be supported in a transparent,data-dependent fashion in a future release.For the new life of this switch, see L<"UTF-8 no longer default underUTF-8 locales">, and L<perlrun/-C>.=head2 (Win32) The /d Switch Of cmd.exePerl 5.8.1 uses the /d switch when running the cmd.exe shellinternally for system(), backticks, and when opening pipes to externalprograms.  The extra switch disables the execution of AutoRun commandsfrom the registry, which is generally considered undesirable whenrunning external programs.  If you wish to retain compatibility withthe older behavior, set PERL5SHELL in your environment to C<cmd /x/c>.=head1 Core Enhancements=head2 UTF-8 no longer default under UTF-8 localesIn Perl 5.8.0 many Unicode features were introduced.   One of themwas found to be of more nuisance than benefit: the automagic(and silent) "UTF-8-ification" of filehandles, including thestandard filehandles, if the user's locale settings indicateduse of UTF-8.For example, if you had C<en_US.UTF-8> as your locale, your STDIN andSTDOUT were automatically "UTF-8", in other words an implicitbinmode(..., ":utf8") was made.  This meant that trying to print, say,chr(0xff), ended up printing the bytes 0xc3 0xbf.  Hardly whatyou had in mind unless you were aware of this feature of Perl 5.8.0.The problem is that the vast majority of people weren't: for examplein RedHat releases 8 and 9 the B<default> locale setting is UTF-8, soall RedHat users got UTF-8 filehandles, whether they wanted it or not.The pain was intensified by the Unicode implementation of Perl 5.8.0(still) having nasty bugs, especially related to the use of s/// andtr///.  (Bugs that have been fixed in 5.8.1)Therefore a decision was made to backtrack the feature and change itfrom implicit silent default to explicit conscious option.  The newPerl command line option C<-C> and its counterpart environmentvariable PERL_UNICODE can now be used to control how Perl and Unicodeinteract at interfaces like I/O and for example the command linearguments.  See L<perlrun/-C> and L<perlrun/PERL_UNICODE> for moreinformation.=head2 Unsafe signals again availableIn Perl 5.8.0 the so-called "safe signals" were introduced.  Thismeans that Perl no longer handles signals immediately but instead"between opcodes", when it is safe to do so.  The earlier immediatehandling easily could corrupt the internal state of Perl, resultingin mysterious crashes.However, the new safer model has its problems too.  Because now anopcode, a basic unit of Perl execution, is never interrupted butinstead let to run to completion, certain operations that can take along time now really do take a long time.  For example, certainnetwork operations have their own blocking and timeout mechanisms, andbeing able to interrupt them immediately would be nice.Therefore perl 5.8.1 introduces a "backdoor" to restore the pre-5.8.0(pre-5.7.3, really) signal behaviour.  Just set the environment variablePERL_SIGNALS to C<unsafe>, and the old immediate (and unsafe)signal handling behaviour returns.  See L<perlrun/PERL_SIGNALS>and L<perlipc/"Deferred Signals (Safe Signals)">.In completely unrelated news, you can now use safe signals withPOSIX::SigAction.  See L<POSIX/POSIX::SigAction>.=head2 Tied Arrays with Negative Array IndicesFormerly, the indices passed to C<FETCH>, C<STORE>, C<EXISTS>, andC<DELETE> methods in tied array class were always non-negative.  Ifthe actual argument was negative, Perl would call FETCHSIZE implicitlyand add the result to the index before passing the result to the tiedarray method.  This behaviour is now optional.  If the tied array classcontains a package variable named C<$NEGATIVE_INDICES> which is set toa true value, negative values will be passed to C<FETCH>, C<STORE>,C<EXISTS>, and C<DELETE> unchanged.=head2 local ${$x}The syntaxes	local ${$x}	local @{$x}	local %{$x}now do localise variables, given that the $x is a valid variable name.=head2 Unicode Character Database 4.0.0The copy of the Unicode Character Database included in Perl 5.8 hasbeen updated to 4.0.0 from 3.2.0.  This means for example that theUnicode character properties are as in Unicode 4.0.0.=head2 Deprecation WarningsThere is one new feature deprecation.  Perl 5.8.0 forgot to addsome deprecation warnings, these warnings have now been added.Finally, a reminder of an impending feature removal.=head3 (Reminder) Pseudo-hashes are deprecated (really)Pseudo-hashes were deprecated in Perl 5.8.0 and will be removed inPerl 5.10.0, see L<perl58delta> for details.  Each attempt to accesspseudo-hashes will trigger the warning C<Pseudo-hashes are deprecated>.If you really want to continue using pseudo-hashes but not to see thedeprecation warnings, use:    no warnings 'deprecated';Or you can continue to use the L<fields> pragma, but please don'texpect the data structures to be pseudohashes any more.=head3 (Reminder) 5.005-style threads are deprecated (really)5.005-style threads (activated by C<use Thread;>) were deprecated inPerl 5.8.0 and will be removed after Perl 5.8, see L<perl58delta> fordetails.  Each 5.005-style thread creation will trigger the warningC<5.005 threads are deprecated>.  If you really want to continueusing the 5.005 threads but not to see the deprecation warnings, use:    no warnings 'deprecated';=head3 (Reminder) The $* variable is deprecated (really)The C<$*> variable controlling multi-line matching has been deprecatedand will be removed after 5.8.  The variable has been deprecated for along time, and a deprecation warning C<Use of $* is deprecated> is given,now the variable will just finally be removed.  The functionality hasbeen supplanted by the C</s> and C</m> modifiers on pattern matching.If you really want to continue using the C<$*>-variable but not to seethe deprecation warnings, use:    no warnings 'deprecated';=head2 Miscellaneous EnhancementsC<map> in void context is no longer expensive. C<map> is now contextaware, and will not construct a list if called in void context.If a socket gets closed by the server while printing to it, the clientnow gets a SIGPIPE.  While this new feature was not planned, it fellnaturally out of PerlIO changes, and is to be considered an accidentalfeature.PerlIO::get_layers(FH) returns the names of the PerlIO layersactive on a filehandle.PerlIO::via layers can now have an optional UTF8 method toindicate whether the layer wants to "auto-:utf8" the stream.utf8::is_utf8() has been added as a quick way to test whethera scalar is encoded internally in UTF-8 (Unicode).=head1 Modules and Pragmata=head2 Updated Modules And PragmataThe following modules and pragmata have been updated since Perl 5.8.0:=over 4=item base=item B::BytecodeIn much better shape than it used to be.  Still far from perfect, butmaybe worth a try.=item B::Concise=item B::Deparse=item BenchmarkAn optional feature, C<:hireswallclock>, now allows for highresolution wall clock times (uses Time::HiRes).=item ByteLoaderSee B::Bytecode.=item bytesNow has bytes::substr.=item CGI=item charnamesOne can now have custom character name aliases.=item CPANThere is now a simple command line frontend to the CPAN.pmmodule called F<cpan>.=item Data::DumperA new option, Pair, allows choosing the separator between hash keysand values.=item DB_File=item Devel::PPPort=item Digest::MD5=item EncodeSignificant updates on the encoding pragma functionality(tr/// and the DATA filehandle, formats).If a filehandle has been marked as to have an encoding, unmappablecharacters are detected already during input, not later (when thecorrupted data is being used).The ISO 8859-6 conversion table has been corrected (the 0x30..0x39erroneously mapped to U+0660..U+0669, instead of U+0030..U+0039).  TheGSM 03.38 conversion did not handle escape sequences correctly.  TheUTF-7 encoding has been added (making Encode feature-complete withUnicode::String).=item fields=item libnet=item Math::BigIntA lot of bugs have been fixed since v1.60, the version included in Perlv5.8.0. Especially noteworthy are the bug in Calc that caused div and mod tofail for some large values, and the fixes to the handling of bad inputs.Some new features were added, e.g. the broot() method, you can now passparameters to config() to change some settings at runtime, and it is nowpossible to trap the creation of NaN and infinity.As usual, some optimizations took place and made the math overall a tadfaster. In some cases, quite a lot faster, actually. Especially alternativelibraries like Math::BigInt::GMP benefit from this. In addition, a lot of thequite clunky routines like fsqrt() and flog() are now much much faster.=item MIME::Base64=item NEXTDiamond inheritance now works.

⌨️ 快捷键说明

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