perl5100delta.pod

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

POD
1,592
字号
system() operator. See L<perlrun> for details. (Contributed by Gisle Aas.)=item C<${^RE_TRIE_MAXBUF}>See L</"Trie optimisation of literal string alternations">.=item C<${^WIN32_SLOPPY_STAT}>See L</"Sloppy stat on Windows">.=back=head2 MiscellaneousC<unpack()> now defaults to unpacking the C<$_> variable.C<mkdir()> without arguments now defaults to C<$_>.The internal dump output has been improved, so that non-printable characterssuch as newline and backspace are output in C<\x> notation, rather thanoctal.The B<-C> option can no longer be used on the C<#!> line. It wasn'tworking there anyway, since the standard streams are already set upat this point in the execution of the perl interpreter. You can usebinmode() instead to get the desired behaviour.=head2 UCD 5.0.0The copy of the Unicode Character Database included in Perl 5 hasbeen updated to version 5.0.0.=head2 MADMAD, which stands for I<Miscellaneous 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.10, and hasspace and speed penalties; moreover not all regression tests still passwith it. (Larry Wall, Nicholas Clark)=head2 kill() on WindowsOn Windows platforms, C<kill(-9, $pid)> now kills a process tree.(On UNIX, this delivers the signal to all processes in the same processgroup.)=head1 Incompatible Changes=head2 Packing and UTF-8 stringsThe semantics of pack() and unpack() regarding UTF-8-encoded data has beenchanged. Processing is now by default character per character instead ofbyte per byte on the underlying encoding. Notably, code that used thingslike C<pack("a*", $string)> to see through the encoding of string will nowsimply get back the original $string. Packed strings can also get upgradedduring processing when you store upgraded characters. You can get the oldbehaviour by using C<use bytes>.To be consistent with pack(), the C<C0> in unpack() templates indicatesthat the data is to be processed in character mode, i.e. character bycharacter; on the contrary, C<U0> in unpack() indicates UTF-8 mode, wherethe packed string is processed in its UTF-8-encoded Unicode form on a byteby byte basis. This is reversed with regard to perl 5.8.X, but now consistentbetween pack() and unpack().Moreover, C<C0> and C<U0> can also be used in pack() templates to specifyrespectively character and byte modes.C<C0> and C<U0> in the middle of a pack or unpack format now switch to thespecified encoding mode, honoring parens grouping. Previously, parens wereignored.Also, there is a new pack() character format, C<W>, which is intended toreplace the old C<C>. C<C> is kept for unsigned chars coded as bytes inthe strings internal representation. C<W> represents unsigned (logical)character values, which can be greater than 255. It is therefore morerobust when dealing with potentially UTF-8-encoded data (as C<C> will wrapvalues outside the range 0..255, and not respect the string encoding).In practice, that means that pack formats are now encoding-neutral, exceptC<C>.For consistency, C<A> in unpack() format now trims all Unicode whitespacefrom the end of the string. Before perl 5.9.2, it used to strip only theclassical ASCII space characters.=head2 Byte/character count feature in unpack()A new unpack() template character, C<".">, returns the number of bytes orcharacters (depending on the selected encoding mode, see above) read so far.=head2 The C<$*> and C<$#> variables have been removedC<$*>, which was deprecated in favor of the C</s> and C</m> regexpmodifiers, has been removed.The deprecated C<$#> variable (output format for numbers) has beenremoved.Two new severe warnings, C<$#/$* is no longer supported>, have been added.=head2 substr() lvalues are no longer fixed-lengthThe lvalues returned by the three argument form of substr() used to be a"fixed length window" on the original string. In some cases this couldcause surprising action at distance or other undefined behaviour. Now thelength of the window adjusts itself to the length of the string assigned toit.=head2 Parsing of C<-f _>The identifier C<_> is now forced to be a bareword after a filetestoperator. This solves a number of misparsing issues when a global C<_>subroutine is defined.=head2 C<:unique>The C<:unique> attribute has been made a no-op, since its currentimplementation was fundamentally flawed and not threadsafe.=head2 Effect of pragmas in evalThe compile-time value of the C<%^H> hint variable can now propagate intoeval("")uated code. This makes it more useful to implement lexicalpragmas.As a side-effect of this, the overloaded-ness of constants now propagatesinto eval("").=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.=head2 $^V is now a C<version> object instead of a v-string$^V can still be used with the C<%vd> format in printf, but anycharacter-level operations will now access the string representationof the C<version> object and not the ordinals of a v-string.Expressions like C<< substr($^V, 0, 2) >> or C<< split //, $^V >>no longer work and must be rewritten.=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)=head2 Tainting and printfWhen perl is run under taint mode, C<printf()> and C<sprintf()> will nowreject any tainted format argument. (Rafael Garcia-Suarez)=head2 undef and signal handlersUndefining or deleting a signal handler via C<undef $SIG{FOO}> is nowequivalent to setting it to C<'DEFAULT'>. (Rafael Garcia-Suarez)=head2 strictures and dereferencing in defined()C<use strict 'refs'> was ignoring taking a hard reference in an argumentto defined(), as in :    use strict 'refs';    my $x = 'foo';    if (defined $$x) {...}This now correctly produces the run-time error C<Can't use string as aSCALAR ref while "strict refs" in use>.C<defined @$foo> and C<defined %$bar> are now also subject to C<strict'refs'> (that is, C<$foo> and C<$bar> shall be proper references there.)(C<defined(@foo)> and C<defined(%bar)> are discouraged constructs anyway.)(Nicholas Clark)=head2 C<(?p{})> has been removedThe regular expression construct C<(?p{})>, which was deprecated in perl5.8, has been removed. Use C<(??{})> instead. (Rafael Garcia-Suarez)=head2 Pseudo-hashes have been removedSupport for pseudo-hashes has been removed from Perl 5.9. (The C<fields>pragma remains here, but uses an alternate implementation.)=head2 Removal of the bytecode compiler and of perlccC<perlcc>, the byteloader and the supporting modules (B::C, B::CC,B::Bytecode, etc.) are no longer distributed with the perl sources. Thoseexperimental tools have never worked reliably, and, due to the lack ofvolunteers to keep them in line with the perl interpreter developments, itwas decided to remove them instead of shipping a broken version of those.The last version of those modules can be found with perl 5.9.4.However the B compiler framework stays supported in the perl core, as withthe more useful modules it has permitted (among others, B::Deparse andB::Concise).=head2 Removal of the JPLThe JPL (Java-Perl Lingo) has been removed from the perl sources tarball.=head2 Recursive inheritance detected earlierPerl will now immediately throw an exception if you modify any package'sC<@ISA> in such a way that it would cause recursive inheritance.Previously, the exception would not occur until Perl attempted to makeuse of the recursive inheritance while resolving a method or doing aC<$foo-E<gt>isa($bar)> lookup.=head1 Modules and Pragmata=head2 Upgrading individual core modulesEven more core modules are now also available separately through theCPAN.  If you wish to update one of these modules, you don't need towait for a new perl release.  From within the cpan shell, running the'r' command will report on modules with upgrades available.  SeeC<perldoc CPAN> for more information.=head2 Pragmata Changes=over 4=item C<feature>The new pragma C<feature> is used to enable new features that might breakold code. See L</"The C<feature> pragma"> above.=item C<mro>This new pragma enables to change the algorithm used to resolve inheritedmethods. See L</"New Pragma, C<mro>"> above.=item Scoping of the C<sort> pragmaThe C<sort> pragma is now lexically scoped. Its effect used to be global.=item Scoping of C<bignum>, C<bigint>, C<bigrat>The three numeric pragmas C<bignum>, C<bigint> and C<bigrat> are nowlexically scoped. (Tels)=item C<base>The C<base> pragma now warns if a class tries to inherit from itself.(Curtis "Ovid" Poe)=item C<strict> and C<warnings>C<strict> and C<warnings> will now complain loudly if they are loaded viaincorrect casing (as in C<use Strict;>). (Johan Vromans)=item C<version>The C<version> module provides support for version objects.=item C<warnings>The C<warnings> pragma doesn't load C<Carp> anymore. That means that codethat used C<Carp> routines without having loaded it at compile time mightneed to be adjusted; typically, the following (faulty) code won't workanymore, and will require parentheses to be added after the function name:    use warnings;    require Carp;    Carp::confess 'argh';=item C<less>C<less> now does something useful (or at least it tries to). In fact, ithas been turned into a lexical pragma. So, in your modules, you can nowtest whether your users have requested to use less CPU, or less memory,less magic, or maybe even less fat. See L<less> for more. (Joshua benJore)=back=head2 New modules=over 4=item *C<encoding::warnings>, by Audrey Tang, is a module to emit warningswhenever an ASCII character string containing high-bit bytes is implicitlyconverted into UTF-8. It's a lexical pragma since Perl 5.9.4; on olderperls, its effect is global.=item *C<Module::CoreList>, by Richard Clamp, is a small handy module that tellsyou what versions of core modules ship with any versions of Perl 5. Itcomes with a command-line frontend, C<corelist>.=item *C<Math::BigInt::FastCalc> is an XS-enabled, and thus faster, version ofC<Math::BigInt::Calc>.=item *C<Compress::Zlib> is an interface to the zlib compression library. Itcomes with a bundled version of zlib, so having a working zlib is not aprerequisite to install it. It's used by C<Archive::Tar> (see below).=item *C<IO::Zlib> is an C<IO::>-style interface to C<Compress::Zlib>.=item *C<Archive::Tar> is a module to manipulate C<tar> archives.=item *C<Digest::SHA> is a module used to calculate many types of SHA digests,has been included for SHA support in the CPAN module.=item *C<ExtUtils::CBuilder> and C<ExtUtils::ParseXS> have been added.=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.=item *C<Locale::Maketext::Simple>, needed by CPANPLUS, is a simple wrapper aroundC<Locale::Maketext::Lexicon>. Note that C<Locale::Maketext::Lexicon> isn'tincluded in the perl core; the behaviour of C<Locale::Maketext::Simple>gracefully degrades when the later isn't present.=item *C<Params::Check> implements a generic input parsing/checking mechanism. Itis used by CPANPLUS.=item *C<Term::UI> simplifies the task to ask questions at a terminal prompt.=item *C<Object::Accessor> provides an interface to create per-object accessors.=item *C<Module::Pluggable> is a simple framework to create modules that accept

⌨️ 快捷键说明

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