perl594delta.pod

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

POD
383
字号
=head1 NAMEperl594delta - what is new for perl v5.9.4=head1 DESCRIPTIONThis document describes differences between the 5.9.3 and the 5.9.4development releases. See L<perl590delta>, L<perl591delta>, L<perl592delta>and L<perl593delta> for the differences between 5.8.0 and 5.9.3.=head1 Incompatible Changes=head2 chdir FOOA bareword argument to chdir() is now recognized as a file handle.Earlier releases interpreted the bareword as a directory name.(Gisle Aas)=head2 Handling of pmc filesAn old feature of perl was that before C<require> or C<use> look for afile with a F<.pm> extension, they will first look for a similar filenamewith a F<.pmc> extension. If this file is found, it will be loaded inplace of any potentially existing file ending in a F<.pm> extension.Previously, F<.pmc> files were loaded only if more recent than thematching F<.pm> file. Starting with 5.9.4, they'll be always loaded ifthey exist. (This trick is used by Pugs.)=head2 @- and @+ in patternsThe special arrays C<@-> and C<@+> are no longer interpolated in regularexpressions. (Sadahiro Tomoyuki)=head2 $AUTOLOAD can now be taintedIf you call a subroutine by a tainted name, and if it defers to anAUTOLOAD function, then $AUTOLOAD will be (correctly) tainted.(Rick Delaney)=head1 Core Enhancements=head2 state() variablesA new class of variables has been introduced. State variables are similarto C<my> variables, but are declared with the C<state> keyword in place ofC<my>. They're visible only in their lexical scope, but their value ispersistent: unlike C<my> variables, they're not undefined at scope entry,but retain their previous value. (Rafael Garcia-Suarez)To use state variables, one needs to enable them by using    use feature "state";or by using the C<-E> command-line switch in one-liners.See L<perlsub/"Persistent variables via state()">.=head2 UNIVERSAL::DOES()The C<UNIVERSAL> class has a new method, C<DOES()>. It has been added tosolve semantic problems with the C<isa()> method. C<isa()> checks forinheritance, while C<DOES()> has been designed to be overridden whenmodule authors use other types of relations between classes (in additionto inheritance). (chromatic)See L<< UNIVERSAL/"$obj->DOES( ROLE )" >>.=head2 Exceptions in constant foldingThe constant folding routine is now wrapped in an exception handler, andif folding throws an exception (such as attempting to evaluate 0/0), perlnow retains the current optree, rather than aborting the whole program.(Nicholas Clark, Dave Mitchell)=head2 Source filters in @INCIt's possible to enhance the mechanism of subroutine hooks in @INC byadding a source filter on top of the filehandle opened and returned by thehook. This feature was planned a long time ago, but wasn't quite workinguntil now. See L<perlfunc/require> for details. (Nicholas Clark)=head2 MADMAD, which stands for I<Misc Attribute Decoration>, is astill-in-development work leading to a Perl 5 to Perl 6 converter. Toenable it, it's necessary to pass the argument C<-Dmad> to Configure. Theobtained perl isn't binary compatible with a regular perl 5.9.4, and hasspace and speed penalties; moreover not all regression tests still passwith it. (Larry Wall, Nicholas Clark)=head1 Modules and Pragmas=over 4=item *C<encoding::warnings> is now a lexical pragma. (Although on older perls,which don't have support for lexical pragmas, it keeps its globalbehaviour.) (Audrey Tang)=item *C<threads> is now a dual-life module, also available on CPAN. It has beenexpanded in many ways. A kill() method is available for thread signalling.One can get thread status, or the list of running or joinable threads.A new C<< threads->exit() >> method is used to exit from the application(this is the default for the main thread) or from the current thread only(this is the default for all other threads). On the other hand, the exit()built-in now always causes the whole application to terminate. (JerryD. Hedden)=back=head2 New Core Modules=over 4=item *C<Hash::Util::FieldHash>, by Anno Siegel, has been added. This moduleprovides support for I<field hashes>: hashes that maintain an associationof a reference with a value, in a thread-safe garbage-collected way.Such hashes are useful to implement inside-out objects.=item *C<Module::Build>, by Ken Williams, has been added. It's an alternative toC<ExtUtils::MakeMaker> to build and install perl modules.=item *C<Module::Load>, by Jos Boumans, has been added. It provides a singleinterface to load Perl modules and F<.pl> files.=item *C<Module::Loaded>, by Jos Boumans, has been added. It's used to markmodules as loaded or unloaded.=item *C<Package::Constants>, by Jos Boumans, has been added. It's a simplehelper to list all constants declared in a given package.=item *C<Win32API::File>, by Tye McQueen, has been added (for Windows builds).This module provides low-level access to Win32 system API calls forfiles/dirs.=back=head1 Utility Changes=head2 config_dataC<config_data> is a new utility that comes with C<Module::Build>. Itprovides a command-line interface to the configuration of Perl modulesthat use Module::Build's framework of configurability (that is,C<*::ConfigData> modules that contain local configuration information fortheir parent modules.)=head1 Documentation=head2 New manpage, perlpragmaThe L<perlpragma> manpage documents how to write one's own lexicalpragmas in pure Perl (something that is possible starting with 5.9.4).=head2 New manpage, perlregutsThe L<perlreguts> manpage, courtesy of Yves Orton, describes internals of thePerl regular expression engine.=head2 New manpage, perlunitutThe L<perlunitut> manpage is an tutorial for programming with Unicode andstring encodings in Perl, courtesy of Juerd Waalboer.=head1 Performance Enhancements=head2 Memory optimisationsSeveral internal data structures (typeglobs, GVs, CVs, formats) have beenrestructured to use less memory. (Nicholas Clark)=head2 UTF-8 cache optimisationThe UTF-8 caching code is now more efficient, and used more often.(Nicholas Clark)=head2 Regular expressions=over 4=item Engine de-recursivisedThe regular expression engine is no longer recursive, meaning thatpatterns that used to overflow the stack will either die with usefulexplanations, or run to completion, which, since they were able to blowthe stack before, will likely take a very long time to happen. If you wereexperiencing the occasional stack overflow (or segfault) and upgrade todiscover that now perl apparently hangs instead, look for a degenerateregex. (Dave Mitchell)=item Single char char-classes treated as literalsClasses of a single character are now treated the same as if the characterhad been used as a literal, meaning that code that uses char-classes as anescaping mechanism will see a speedup. (Yves Orton)=item Trie optimisation of literal string alternationsAlternations, where possible, are optimised into more efficient matchingstructures. String literal alternations are merged into a trie and arematched simultaneously.  This means that instead of O(N) time for matchingN alternations at a given point the new code performs in O(1) time. (YvesOrton)B<Note:> Much code exists that works around perl's historic poorperformance on alternations. Often the tricks used to do so will disablethe new optimisations. Hopefully the utility modules used for this purposewill be educated about these new optimisations by the time 5.10 isreleased.=item Aho-Corasick start-point optimisationWhen a pattern starts with a trie-able alternation and there aren'tbetter optimisations available the regex engine will use Aho-Corasickmatching to find the start point. (Yves Orton)=back=head2 Sloppy stat on WindowsOn Windows, perl's stat() function normally opens the file to determinethe link count and update attributes that may have been changed throughhard links. Setting ${^WIN32_SLOPPY_STAT} to a true value speeds upstat() by not performing this operation. (Jan Dubois)=head1 Installation and Configuration Improvements=head2 Relocatable installationsThere is now Configure support for creating a relocatable perl tree. Ifyou Configure with C<-Duserelocatableinc>, then the paths in @INC (andeverything else in %Config) can be optionally located via the path of theperl executable.That means that, if the string C<".../"> is found at the start of anypath, it's substituted with the directory of $^X. So, the relocation canbe configured on a per-directory basis, although the default withC<-Duserelocatableinc> is that everything is relocated. The initialinstall is done to the original configured prefix.=head2 PortsMany improvements have been made towards making Perl work correctly onz/OS.Perl has been reported to work on DragonFlyBSD.=head2 Compilation improvementsAll F<ppport.h> files in the XS modules bundled with perl are nowautogenerated at build time. (Marcus Holland-Moritz)=head2 New probesThe configuration process now detects whether strlcat() and strlcpy() areavailable.  When they are not available, perl's own version is used (fromRuss Allbery's public domain implementation).  Various places in the perlinterpreter now use them. (Steve Peters)=head2 Windows build improvements=over 4=item Building XS extensionsSupport for building XS extension modules with the free MinGW compiler hasbeen improved in the case where perl itself was built with the MicrosoftVC++ compiler. (ActiveState)=item Support for 64-bit compilerSupport for building perl with Microsoft's 64-bit compiler has beenimproved. (ActiveState)=back=head1 Selected Bug Fixes=head2 PERL5SHELL and taintingOn Windows, the PERL5SHELL environment variable is now checked fortaintedness. (Rafael Garcia-Suarez)=head2 Using *FILE{IO}C<stat()> and C<-X> filetests now treat *FILE{IO} filehandles like *FILEfilehandles. (Steve Peters)=head2 Overloading and reblessingOverloading now works when references are reblessed into another class.Internally, this has been implemented by moving the flag for "overloading"from the reference to the referent, which logically is where it shouldalways have been. (Nicholas Clark)=head2 Overloading and UTF-8A few bugs related to UTF-8 handling with objects that havestringification overloaded have been fixed. (Nicholas Clark)=head2 eval memory leaks fixedTraditionally, C<eval 'syntax error'> has leaked badly. Many (but not all)of these leaks have now been eliminated or reduced. (Dave Mitchell)=head2 Random device on WindowsIn previous versions, perl would read the file F</dev/urandom> if itexisted when seeding its random number generator.  That file is unlikelyto exist on Windows, and if it did would probably not contain appropriatedata, so perl no longer tries to read it on Windows. (Alex Davies)=head1 New or Changed Diagnostics=over 4=item State variable %s will be reinitializedOne can assign initial values to state variables, but not when they'redeclared as a sub-part of a list assignment. See L<perldiag>.=back=head1 Changed InternalsA new file, F<mathoms.c>, contains functions that aren't used anymore inthe perl core, but remain around because modules out there mightstill use them. They come from a factorization effort: for example, manyPP functions are now shared for several ops.The implementation of the special variables $^H and %^H has changed, toallow implementing lexical pragmas in pure perl.=head1 Known ProblemsOne warning test (number 263 in F<lib/warnings.t>) fails under UTF-8locales.Bytecode tests fail under several platforms. We are considering removingsupport for byteloader and compiler before the 5.10.0 release.=head1 Reporting BugsIf you find what you think is a bug, you might check the articlesrecently posted to the comp.lang.perl.misc newsgroup and the perlbug database at http://rt.perl.org/rt3/ .  There may also beinformation at http://www.perl.org/ , the Perl Home Page.If you believe you have an unreported bug, please run the B<perlbug>program included with your release.  Be sure to trim your bug downto a tiny but sufficient test case.  Your bug report, along with theoutput of C<perl -V>, will be sent off to perlbug@perl.org to beanalysed by the Perl porting team.=head1 SEE ALSOThe F<Changes> file for exhaustive details on what changed.The F<INSTALL> file for how to build Perl.The F<README> file for general stuff.The F<Artistic> and F<Copying> files for copyright information.=cut

⌨️ 快捷键说明

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