📄 perl581delta.1
字号:
.PPTherefore a decision was made to backtrack the feature and change itfrom implicit silent default to explicit conscious option. The newPerl command line option \f(CW\*(C`\-C\*(C'\fR and its counterpart environmentvariable \s-1PERL_UNICODE\s0 can now be used to control how Perl and Unicodeinteract at interfaces like I/O and for example the command linearguments. See \*(L"\-C\*(R" in perlrun and \*(L"\s-1PERL_UNICODE\s0\*(R" in perlrun for moreinformation..Sh "Unsafe signals again available".IX Subsection "Unsafe signals again available"In Perl 5.8.0 the so-called \*(L"safe signals\*(R" were introduced. Thismeans that Perl no longer handles signals immediately but instead\&\*(L"between opcodes\*(R", when it is safe to do so. The earlier immediatehandling easily could corrupt the internal state of Perl, resultingin mysterious crashes..PPHowever, 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..PPTherefore perl 5.8.1 introduces a \*(L"backdoor\*(R" to restore the pre\-5.8.0(pre\-5.7.3, really) signal behaviour. Just set the environment variable\&\s-1PERL_SIGNALS\s0 to \f(CW\*(C`unsafe\*(C'\fR, and the old immediate (and unsafe)signal handling behaviour returns. See \*(L"\s-1PERL_SIGNALS\s0\*(R" in perlrunand \*(L"Deferred Signals (Safe Signals)\*(R" in perlipc..PPIn completely unrelated news, you can now use safe signals withPOSIX::SigAction. See \*(L"POSIX::SigAction\*(R" in \s-1POSIX\s0..Sh "Tied Arrays with Negative Array Indices".IX Subsection "Tied Arrays with Negative Array Indices"Formerly, the indices passed to \f(CW\*(C`FETCH\*(C'\fR, \f(CW\*(C`STORE\*(C'\fR, \f(CW\*(C`EXISTS\*(C'\fR, and\&\f(CW\*(C`DELETE\*(C'\fR methods in tied array class were always non-negative. Ifthe actual argument was negative, Perl would call \s-1FETCHSIZE\s0 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 \f(CW$NEGATIVE_INDICES\fR which is set toa true value, negative values will be passed to \f(CW\*(C`FETCH\*(C'\fR, \f(CW\*(C`STORE\*(C'\fR,\&\f(CW\*(C`EXISTS\*(C'\fR, and \f(CW\*(C`DELETE\*(C'\fR unchanged..Sh "local ${$x}".IX Subsection "local ${$x}"The syntaxes.PP.Vb 3\& local ${$x}\& local @{$x}\& local %{$x}.Ve.PPnow do localise variables, given that the \f(CW$x\fR is a valid variable name..Sh "Unicode Character Database 4.0.0".IX Subsection "Unicode Character Database 4.0.0"The 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..Sh "Deprecation Warnings".IX Subsection "Deprecation Warnings"There 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..PP\fI(Reminder) Pseudo-hashes are deprecated (really)\fR.IX Subsection "(Reminder) Pseudo-hashes are deprecated (really)".PPPseudo-hashes were deprecated in Perl 5.8.0 and will be removed inPerl 5.10.0, see perl58delta for details. Each attempt to accesspseudo-hashes will trigger the warning \f(CW\*(C`Pseudo\-hashes are deprecated\*(C'\fR.If you really want to continue using pseudo-hashes but not to see thedeprecation warnings, use:.PP.Vb 1\& no warnings \*(Aqdeprecated\*(Aq;.Ve.PPOr you can continue to use the fields pragma, but please don'texpect the data structures to be pseudohashes any more..PP\fI(Reminder) 5.005\-style threads are deprecated (really)\fR.IX Subsection "(Reminder) 5.005-style threads are deprecated (really)".PP5.005\-style threads (activated by \f(CW\*(C`use Thread;\*(C'\fR) were deprecated inPerl 5.8.0 and will be removed after Perl 5.8, see perl58delta fordetails. Each 5.005\-style thread creation will trigger the warning\&\f(CW\*(C`5.005 threads are deprecated\*(C'\fR. If you really want to continueusing the 5.005 threads but not to see the deprecation warnings, use:.PP.Vb 1\& no warnings \*(Aqdeprecated\*(Aq;.Ve.PP\fI(Reminder) The $* variable is deprecated (really)\fR.IX Subsection "(Reminder) The $* variable is deprecated (really)".PPThe \f(CW$*\fR 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 \f(CW\*(C`Use of $* is deprecated\*(C'\fR is given,now the variable will just finally be removed. The functionality hasbeen supplanted by the \f(CW\*(C`/s\*(C'\fR and \f(CW\*(C`/m\*(C'\fR modifiers on pattern matching.If you really want to continue using the \f(CW$*\fR\-variable but not to seethe deprecation warnings, use:.PP.Vb 1\& no warnings \*(Aqdeprecated\*(Aq;.Ve.Sh "Miscellaneous Enhancements".IX Subsection "Miscellaneous Enhancements"\&\f(CW\*(C`map\*(C'\fR in void context is no longer expensive. \f(CW\*(C`map\*(C'\fR is now contextaware, and will not construct a list if called in void context..PPIf a socket gets closed by the server while printing to it, the clientnow gets a \s-1SIGPIPE\s0. While this new feature was not planned, it fellnaturally out of PerlIO changes, and is to be considered an accidentalfeature..PPPerlIO::get_layers(\s-1FH\s0) returns the names of the PerlIO layersactive on a filehandle..PPPerlIO::via layers can now have an optional \s-1UTF8\s0 method toindicate whether the layer wants to \*(L"auto\-:utf8\*(R" the stream..PP\&\fIutf8::is_utf8()\fR has been added as a quick way to test whethera scalar is encoded internally in \s-1UTF\-8\s0 (Unicode)..SH "Modules and Pragmata".IX Header "Modules and Pragmata".Sh "Updated Modules And Pragmata".IX Subsection "Updated Modules And Pragmata"The following modules and pragmata have been updated since Perl 5.8.0:.IP "base" 4.IX Item "base".PD 0.IP "B::Bytecode" 4.IX Item "B::Bytecode".PDIn much better shape than it used to be. Still far from perfect, butmaybe worth a try..IP "B::Concise" 4.IX Item "B::Concise".PD 0.IP "B::Deparse" 4.IX Item "B::Deparse".IP "Benchmark" 4.IX Item "Benchmark".PDAn optional feature, \f(CW\*(C`:hireswallclock\*(C'\fR, now allows for highresolution wall clock times (uses Time::HiRes)..IP "ByteLoader" 4.IX Item "ByteLoader"See B::Bytecode..IP "bytes" 4.IX Item "bytes"Now has bytes::substr..IP "\s-1CGI\s0" 4.IX Item "CGI".PD 0.IP "charnames" 4.IX Item "charnames".PDOne can now have custom character name aliases..IP "\s-1CPAN\s0" 4.IX Item "CPAN"There is now a simple command line frontend to the \s-1CPAN\s0.pmmodule called \fIcpan\fR..IP "Data::Dumper" 4.IX Item "Data::Dumper"A new option, Pair, allows choosing the separator between hash keysand values..IP "DB_File" 4.IX Item "DB_File".PD 0.IP "Devel::PPPort" 4.IX Item "Devel::PPPort".IP "Digest::MD5" 4.IX Item "Digest::MD5".IP "Encode" 4.IX Item "Encode".PDSignificant updates on the encoding pragma functionality(tr/// and the \s-1DATA\s0 filehandle, formats)..SpIf a filehandle has been marked as to have an encoding, unmappablecharacters are detected already during input, not later (when thecorrupted data is being used)..SpThe \s-1ISO\s0 8859\-6 conversion table has been corrected (the 0x30..0x39erroneously mapped to U+0660..U+0669, instead of U+0030..U+0039). The\&\s-1GSM\s0 03.38 conversion did not handle escape sequences correctly. The\&\s-1UTF\-7\s0 encoding has been added (making Encode feature-complete withUnicode::String)..IP "fields" 4.IX Item "fields".PD 0.IP "libnet" 4.IX Item "libnet".IP "Math::BigInt" 4.IX Item "Math::BigInt".PDA 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..SpSome new features were added, e.g. the \fIbroot()\fR method, you can now passparameters to \fIconfig()\fR to change some settings at runtime, and it is nowpossible to trap the creation of NaN and infinity..SpAs 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 \fIfsqrt()\fR and \fIflog()\fR are now much much faster..IP "MIME::Base64" 4.IX Item "MIME::Base64".PD 0.IP "\s-1NEXT\s0" 4.IX Item "NEXT".PDDiamond inheritance now works..IP "Net::Ping" 4.IX Item "Net::Ping".PD 0.IP "PerlIO::scalar" 4.IX Item "PerlIO::scalar".PDReading from non-string scalars (like the special variables, seeperlvar) now works..IP "podlators" 4.IX Item "podlators".PD 0.IP "Pod::LaTeX" 4.IX Item "Pod::LaTeX".IP "PodParsers" 4.IX Item "PodParsers".IP "Pod::Perldoc" 4.IX Item "Pod::Perldoc".PDComplete rewrite. As a side-effect, no longer refuses to startup whenrun by root..IP "Scalar::Util" 4.IX Item "Scalar::Util"New utilities: refaddr, isvstring, looks_like_number, set_prototype..IP "Storable" 4.IX Item "Storable"Can now store code references (via B::Deparse, so not foolproof)..IP "strict" 4.IX Item "strict"Earlier versions of the strict pragma did not check the parametersimplicitly passed to its \*(L"import\*(R" (use) and \*(L"unimport\*(R" (no) routine.This caused the false idiom such as:.Sp.Vb 2\& use strict qw(@ISA);\& @ISA = qw(Foo);.Ve.SpThis however (probably) raised the false expectation that the strictrefs, vars and subs were being enforced (and that \f(CW@ISA\fR was somehow\&\*(L"declared\*(R"). But the strict refs, vars, and subs are \fBnot\fR enforcedwhen using this false idiom..SpStarting from Perl 5.8.1, the above \fBwill\fR cause an error to beraised. This may cause programs which used to execute seeminglycorrectly without warnings and errors to fail when run under 5.8.1.This happens because.Sp.Vb 1\& use strict qw(@ISA);.Ve.Spwill now fail with the error:.Sp.Vb 1\& Unknown \*(Aqstrict\*(Aq tag(s) \*(Aq@ISA\*(Aq.Ve.SpThe remedy to this problem is to replace this code with the correct idiom:.Sp.Vb 3\& use strict;\& use vars qw(@ISA);\& @ISA = qw(Foo);.Ve.IP "Term::ANSIcolor" 4.IX Item "Term::ANSIcolor".PD 0.IP "Test::Harness" 4.IX Item "Test::Harness".PDNow much more picky about extra or missing output from test scripts..IP "Test::More" 4.IX Item "Test::More".PD 0.IP "Test::Simple" 4.IX Item "Test::Simple".IP "Text::Balanced" 4.IX Item "Text::Balanced"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -