perl591delta.pod
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· POD 代码 · 共 324 行
POD
324 行
=head1 NAMEperl591delta - what is new for perl v5.9.1=head1 DESCRIPTIONThis document describes differences between the 5.9.0 and the 5.9.1development releases. See L<perl590delta> for the differences between5.8.0 and 5.9.0.=head1 Incompatible Changes=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 The C<:unique> attribute is only meaningful for globalsNow applying C<:unique> to lexical variables and to subroutines willresult in a compilation error.=head1 Core Enhancements=head2 Lexical C<$_>The default variable C<$_> can now be lexicalized, by declaring it likeany other lexical variable, with a simple my $_;The operations that default on C<$_> will use the lexically-scopedversion of C<$_> when it exists, instead of the global C<$_>.In a C<map> or a C<grep> block, if C<$_> was previously my'ed, then theC<$_> inside the block is lexical as well (and scoped to the block).In a scope where C<$_> has been lexicalized, you can still have access tothe global version of C<$_> by using C<$::_>, or, more simply, byoverriding the lexical declaration with C<our $_>.=head2 Tied hashes in scalar contextAs of perl 5.8.2/5.9.0, tied hashes did not return anything useful inscalar context, for example when used as boolean tests: if (%tied_hash) { ... }The old nonsensical behaviour was always to return false,regardless of whether the hash is empty or has elements.There is now an interface for the implementors of tied hashes to implementthe behaviour of a hash in scalar context, via the SCALAR method (seeL<perltie>). Without a SCALAR method, perl will try to guess whetherthe hash is empty, by testing if it's inside an iteration (in this caseit can't be empty) or by calling FIRSTKEY.=head2 FormatsFormats were improved in several ways. A new field, C<^*>, can be used forvariable-width, one-line-at-a-time text. Null characters are now handledcorrectly in picture lines. Using C<@#> and C<~~> together will nowproduce a compile-time error, as those format fields are incompatible.L<perlform> has been improved, and miscellaneous bugs fixed.=head2 Stacked filetest operatorsAs a new form of syntactic sugar, it's now possible to stack up filetestoperators. You can now write C<-f -w -x $file> in a row to meanC<-x $file && -w _ && -f _>. See L<perlfunc/-X>.=head1 Modules and Pragmata=over 4=item BenchmarkIn C<Benchmark>, cmpthese() and timestr() now use the time statistics ofchildren instead of parent when the selected style is 'nop'.=item CarpThe error messages produced by C<Carp> now include spaces between thearguments in function argument lists: this makes long error messagesappear more nicely in browsers and other tools.=item ExporterC<Exporter> will now recognize grouping tags (such as C<:name>) anywherein the import list, not only at the beginning.=item FindBinA function C<again> is provided to resolve problems where modules in differentdirectories wish to use FindBin.=item List::UtilYou can now weaken references to read only values.=item threads::sharedC<cond_wait> has a new two argument form. C<cond_timedwait> has been added.=back=head1 Utility ChangesC<find2perl> now assumes C<-print> as a default action. Previously, itneeded to be specified explicitly.A new utility, C<prove>, makes it easy to run an individual regression testat the command line. C<prove> is part of Test::Harness, which users of earlierPerl versions can install from CPAN.The perl debugger now supports a C<save> command, to save the currenthistory to a file, and an C<i> command, which prints the inheritance treeof its argument (if the C<Class::ISA> module is installed.)=head1 DocumentationThe documentation has been revised in places to produce more standard manpages.The long-existing feature of C</(?{...})/> regexps setting C<$_> and pos()is now documented.=head1 Performance EnhancementsSorting arrays in place (C<@a = sort @a>) is now optimized to avoidmaking a temporary copy of the array.The operations involving case mapping on UTF-8 strings (uc(), lc(),C<//i>, etc.) have been greatly speeded up.Access to elements of lexical arrays via a numeric constant between 0 and255 is now faster. (This used to be only the case for global arrays.)=head1 Selected Bug Fixes=head2 UTF-8 bugsUsing substr() on a UTF-8 string could cause subsequent accesses on thatstring to return garbage. This was due to incorrect UTF-8 offsets beingcached, and is now fixed.join() could return garbage when the same join() statement was used toprocess 8 bit data having earlier processed UTF-8 data, due to the flagson that statement's temporary workspace not being reset correctly. Thisis now fixed.Using Unicode keys with tied hashes should now work correctly.chop() and chomp() used to mangle UTF-8 strings. This has been fixed.sprintf() used to misbehave when the format string was in UTF-8. This isnow fixed.=head2 Threading bugsHashes with the C<:unique> attribute weren't made read-only in newthreads. They are now.=head2 More bugsC<$a .. $b> will now work as expected when either $a or $b is C<undef>.Reading $^E now preserves $!. Previously, the C code implementing $^Edid not preserve C<errno>, so reading $^E could cause C<errno> and thereforeC<$!> to change unexpectedly.C<strict> wasn't in effect in regexp-eval blocks (C</(?{...})/>).=head1 New or Changed DiagnosticsA new deprecation warning, I<Deprecated use of my() in false conditional>,has been added, to warn against the use of the dubious and deprecatedconstruct my $x if 0;See L<perldiag>.The fatal error I<DESTROY created new reference to dead object> is nowdocumented in L<perldiag>.A new error, I<%ENV is aliased to %s>, is produced when taint checks areenabled and when C<*ENV> has been aliased (and thus doesn't reflect theprogram's environment anymore.)=head1 Changed InternalsThese news matter to you only if you either write XS code or like toknow about or hack Perl internals (using Devel::Peek or any of theC<B::> modules counts), or like to run Perl with the C<-D> option.=head2 Reordering of SVt_* constantsThe relative ordering of constants that define the various types of C<SV>have changed; in particular, C<SVt_PVGV> has been moved before C<SVt_PVLV>,C<SVt_PVAV>, C<SVt_PVHV> and C<SVt_PVCV>. This is unlikely to make anydifference unless you have code that explicitly makes assumptions about thatordering. (The inheritance hierarchy of C<B::*> objects has been changedto reflect this.)=head2 Removal of CPP symbolsThe C preprocessor symbols C<PERL_PM_APIVERSION> andC<PERL_XS_APIVERSION>, which were supposed to give the version number ofthe oldest perl binary-compatible (resp. source-compatible) with thepresent one, were not used, and sometimes had misleading values. They havebeen removed.=head2 Less space is used by opsThe C<BASEOP> structure now uses less space. The C<op_seq> field has beenremoved and replaced by two one-bit fields, C<op_opt> and C<op_static>.C<opt_type> is now 9 bits long. (Consequently, the C<B::OP> class doesn'tprovide an C<seq> method anymore.)=head2 New parserperl's parser is now generated by bison (it used to be generated bybyacc.) As a result, it seems to be a bit more robust.=head1 Configuration and BuildingC<Configure> now invokes callbacks regardless of the value of the variablethey are called for. Previously callbacks were only invoked in theC<case $variable $define)> branch. This change should only affect platformmaintainers writing configuration hints files.The portability and cleanliness of the Win32 makefiles has been improved.=head1 Known ProblemsThere are still a couple of problems in the implementation of the lexicalC<$_>: it doesn't work inside C</(?{...})/> blocks and with regard to thereverse() built-in used without arguments. (See the TODO tests inF<t/op/mydef.t>.)=head2 Platform Specific ProblemsThe test F<ext/IPC/SysV/t/ipcsysv.t> may fail on OpenBSD. This hasn't beendiagnosed yet.On some configurations on AIX 5, one test in F<lib/Time/Local.t> fails.When configured with long doubles, perl may fail tests 224-236 inF<t/op/pow.t> on the same platform.For threaded builds, F<ext/threads/shared/t/wait.t> has been reported tofail some tests on HP-UX 10.20.=head1 To-do for perl 5.10.0This is a non-exhaustive, non-ordered, non-contractual and non-definitivelist of things to do (or nice to have) for perl 5.10.0 :Clean up and finish support for assertions. See L<assertions>.Reimplement the mechanism of lexical pragmas to be more extensible. Fixcurrent pragmas that don't work well (or at all) with lexical scopes or inrun-time eval(STRING) (C<sort>, C<re>, C<encoding> for example). MJD has apreliminary patch that implements this.Fix (or rewrite) the implementation of the C</(?{...})/> closures.Conversions from byte strings to UTF-8 currently map high bit charactersto Unicode without translation (or, depending on how you look at it, byimplicitly assuming that the byte strings are in Latin-1). As perl assumesthe C locale by default, upgrading a string to UTF-8 may change themeaning of its contents regarding character classes, case mapping, etc.This should probably emit a warning (at least).Introduce a new special block, UNITCHECK, which is run at the end of acompilation unit (module, file, eval(STRING) block). This will correspond tothe Perl 6 CHECK. Perl 5's CHECK cannot be changed or removed because theO.pm/B.pm backend framework depends on it.Study the possibility of adding a new prototype character, C<_>, meaning"this argument defaults to $_".Make the peephole optimizer optional.Allow lexical aliases (maybe via the syntax C<my \$alias = \$foo>.Fix the bugs revealed by running the test suite with the C<-t> switch (viaC<make test.taintwarn>).Make threads more robust.Make C<no 6> and C<no v6> work (opposite of C<use 5.005>, etc.).A test suite for the B module would be nice.A ponie.=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://bugs.perl.org/ . 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 + -
显示快捷键?