📄 perl5004delta.1
字号:
additions also make it feasible to manipulate \f(CW\*(C`HE*\*(C'\fRs (hash entries),which can be more efficient. See perlguts for details..SH "Documentation Changes".IX Header "Documentation Changes"Many of the base and library pods were updated. Thesenew pods are included in section 1:.IP "perldelta" 4.IX Item "perldelta"This document..IP "perlfaq" 4.IX Item "perlfaq"Frequently asked questions..IP "perllocale" 4.IX Item "perllocale"Locale support (internationalization and localization)..IP "perltoot" 4.IX Item "perltoot"Tutorial on Perl \s-1OO\s0 programming..IP "perlapio" 4.IX Item "perlapio"Perl internal \s-1IO\s0 abstraction interface..IP "perlmodlib" 4.IX Item "perlmodlib"Perl module library and recommended practice for module creation.Extracted from perlmod (which is much smaller as a result)..IP "perldebug" 4.IX Item "perldebug"Although not new, this has been massively updated..IP "perlsec" 4.IX Item "perlsec"Although not new, this has been massively updated..SH "New Diagnostics".IX Header "New Diagnostics"Several new conditions will trigger warnings that weresilent before. Some only affect certain platforms.The following new warnings and errors outline these.These messages are classified as follows (listed inincreasing order of desperation):.PP.Vb 7\& (W) A warning (optional).\& (D) A deprecation (optional).\& (S) A severe warning (mandatory).\& (F) A fatal error (trappable).\& (P) An internal error you should never see (trappable).\& (X) A very fatal error (nontrappable).\& (A) An alien error message (not generated by Perl)..Ve.ie n .IP """my"" variable %s masks earlier declaration in same scope" 4.el .IP "``my'' variable \f(CW%s\fR masks earlier declaration in same scope" 4.IX Item "my variable %s masks earlier declaration in same scope"(W) A lexical variable has been redeclared in the same scope, effectivelyeliminating all access to the previous instance. This is almost alwaysa typographical error. Note that the earlier variable will still existuntil the end of the scope or until all closure referents to it aredestroyed..ie n .IP "%s argument is not a \s-1HASH\s0 element or slice" 4.el .IP "\f(CW%s\fR argument is not a \s-1HASH\s0 element or slice" 4.IX Item "%s argument is not a HASH element or slice"(F) The argument to \fIdelete()\fR must be either a hash element, such as.Sp.Vb 2\& $foo{$bar}\& $ref\->[12]\->{"susie"}.Ve.Spor a hash slice, such as.Sp.Vb 2\& @foo{$bar, $baz, $xyzzy}\& @{$ref\->[12]}{"susie", "queue"}.Ve.ie n .IP "Allocation too large: %lx" 4.el .IP "Allocation too large: \f(CW%lx\fR" 4.IX Item "Allocation too large: %lx"(X) You can't allocate more than 64K on an MS-DOS machine..IP "Allocation too large" 4.IX Item "Allocation too large"(F) You can't allocate more than 2^31+\*(L"small amount\*(R" bytes..ie n .IP "Applying %s\fR to \f(CW%s will act on scalar(%s)" 4.el .IP "Applying \f(CW%s\fR to \f(CW%s\fR will act on scalar(%s)" 4.IX Item "Applying %s to %s will act on scalar(%s)"(W) The pattern match (//), substitution (s///), and transliteration (tr///)operators work on scalar values. If you apply one of them to an arrayor a hash, it will convert the array or hash to a scalar value \*(-- thelength of an array, or the population info of a hash \*(-- and then work onthat scalar value. This is probably not what you meant to do. See\&\*(L"grep\*(R" in perlfunc and \*(L"map\*(R" in perlfunc for alternatives..IP "Attempt to free nonexistent shared string" 4.IX Item "Attempt to free nonexistent shared string"(P) Perl maintains a reference counted internal table of strings tooptimize the storage and access of hash keys and other strings. Thisindicates someone tried to decrement the reference count of a stringthat can no longer be found in the table..IP "Attempt to use reference as lvalue in substr" 4.IX Item "Attempt to use reference as lvalue in substr"(W) You supplied a reference as the first argument to \fIsubstr()\fR usedas an lvalue, which is pretty strange. Perhaps you forgot todereference it first. See \*(L"substr\*(R" in perlfunc..ie n .IP "Bareword ""%s"" refers to nonexistent package" 4.el .IP "Bareword ``%s'' refers to nonexistent package" 4.IX Item "Bareword %s refers to nonexistent package"(W) You used a qualified bareword of the form \f(CW\*(C`Foo::\*(C'\fR, butthe compiler saw no other uses of that namespace before that point.Perhaps you need to predeclare a package?.ie n .IP "Can't redefine active sort subroutine %s" 4.el .IP "Can't redefine active sort subroutine \f(CW%s\fR" 4.IX Item "Can't redefine active sort subroutine %s"(F) Perl optimizes the internal handling of sort subroutines and keepspointers into them. You tried to redefine one such sort subroutine when itwas currently active, which is not allowed. If you really want to dothis, you should write \f(CW\*(C`sort { &func } @x\*(C'\fR instead of \f(CW\*(C`sort func @x\*(C'\fR..ie n .IP "Can't use bareword (""%s"") as %s ref while ""strict refs"" in use" 4.el .IP "Can't use bareword (``%s'') as \f(CW%s\fR ref while ``strict refs'' in use" 4.IX Item "Can't use bareword (%s) as %s ref while strict refs in use"(F) Only hard references are allowed by \*(L"strict refs\*(R". Symbolic referencesare disallowed. See perlref..IP "Cannot resolve method `%s' overloading `%s' in package `%s'" 4.IX Item "Cannot resolve method `%s' overloading `%s' in package `%s'"(P) Internal error trying to resolve overloading specified by a methodname (as opposed to a subroutine reference)..ie n .IP "Constant subroutine %s redefined" 4.el .IP "Constant subroutine \f(CW%s\fR redefined" 4.IX Item "Constant subroutine %s redefined"(S) You redefined a subroutine which had previously been eligible forinlining. See \*(L"Constant Functions\*(R" in perlsub for commentary andworkarounds..ie n .IP "Constant subroutine %s undefined" 4.el .IP "Constant subroutine \f(CW%s\fR undefined" 4.IX Item "Constant subroutine %s undefined"(S) You undefined a subroutine which had previously been eligible forinlining. See \*(L"Constant Functions\*(R" in perlsub for commentary andworkarounds..IP "Copy method did not return a reference" 4.IX Item "Copy method did not return a reference"(F) The method which overloads \*(L"=\*(R" is buggy. See \*(L"Copy Constructor\*(R" in overload..IP "Died" 4.IX Item "Died"(F) You passed \fIdie()\fR an empty string (the equivalent of \f(CW\*(C`die ""\*(C'\fR) oryou called it with no args and both \f(CW$@\fR and \f(CW$_\fR were empty..ie n .IP "Exiting pseudo-block via %s" 4.el .IP "Exiting pseudo-block via \f(CW%s\fR" 4.IX Item "Exiting pseudo-block via %s"(W) You are exiting a rather special block construct (like a sort block orsubroutine) by unconventional means, such as a goto, or a loop controlstatement. See \*(L"sort\*(R" in perlfunc..IP "Identifier too long" 4.IX Item "Identifier too long"(F) Perl limits identifiers (names for variables, functions, etc.) to252 characters for simple names, somewhat more for compound names (like\&\f(CW$A::B\fR). You've exceeded Perl's limits. Future versions of Perl arelikely to eliminate these arbitrary limitations..ie n .IP "Illegal character %s (carriage return)" 4.el .IP "Illegal character \f(CW%s\fR (carriage return)" 4.IX Item "Illegal character %s (carriage return)"(F) A carriage return character was found in the input. This is anerror, and not a warning, because carriage return characters can breakmulti-line strings, including here documents (e.g., \f(CW\*(C`print <<EOF;\*(C'\fR)..ie n .IP "Illegal switch in \s-1PERL5OPT:\s0 %s" 4.el .IP "Illegal switch in \s-1PERL5OPT:\s0 \f(CW%s\fR" 4.IX Item "Illegal switch in PERL5OPT: %s"(X) The \s-1PERL5OPT\s0 environment variable may only be used to set thefollowing switches: \fB\-[DIMUdmw]\fR..IP "Integer overflow in hex number" 4.IX Item "Integer overflow in hex number"(S) The literal hex number you have specified is too big for yourarchitecture. On a 32\-bit architecture the largest hex literal is0xFFFFFFFF..IP "Integer overflow in octal number" 4.IX Item "Integer overflow in octal number"(S) The literal octal number you have specified is too big for yourarchitecture. On a 32\-bit architecture the largest octal literal is037777777777..IP "internal error: glob failed" 4.IX Item "internal error: glob failed"(P) Something went wrong with the external program(s) used for \f(CW\*(C`glob\*(C'\fRand \f(CW\*(C`<*.c>\*(C'\fR. This may mean that your csh (C shell) isbroken. If so, you should change all of the csh-related variables inconfig.sh: If you have tcsh, make the variables refer to it as if itwere csh (e.g. \f(CW\*(C`full_csh=\*(Aq/usr/bin/tcsh\*(Aq\*(C'\fR); otherwise, make them allempty (except that \f(CW\*(C`d_csh\*(C'\fR should be \f(CW\*(Aqundef\*(Aq\fR) so that Perl willthink csh is missing. In either case, after editing config.sh, run\&\f(CW\*(C`./Configure \-S\*(C'\fR and rebuild Perl..ie n .IP "Invalid conversion in %s: ""%s""" 4.el .IP "Invalid conversion in \f(CW%s:\fR ``%s''" 4.IX Item "Invalid conversion in %s: %s"(W) Perl does not understand the given format conversion.See \*(L"sprintf\*(R" in perlfunc..IP "Invalid type in pack: '%s'" 4.IX Item "Invalid type in pack: '%s'"(F) The given character is not a valid pack type. See \*(L"pack\*(R" in perlfunc..IP "Invalid type in unpack: '%s'" 4.IX Item "Invalid type in unpack: '%s'"(F) The given character is not a valid unpack type. See \*(L"unpack\*(R" in perlfunc..ie n .IP "Name ""%s::%s"" used only once: possible typo" 4.el .IP "Name ``%s::%s'' used only once: possible typo" 4.IX Item "Name %s::%s used only once: possible typo"(W) Typographical errors often show up as unique variable names.If you had a good reason for having a unique name, then just mentionit again somehow to suppress the message (the \f(CW\*(C`use vars\*(C'\fR pragma isprovided for just this purpose)..IP "Null picture in formline" 4.IX Item "Null picture in formline"(F) The first argument to formline must be a valid format picturespecification. It was found to be empty, which probably means yousupplied it an uninitialized value. See perlform..IP "Offset outside string" 4.IX Item "Offset outside string"(F) You tried to do a read/write/send/recv operation with an offsetpointing outside the buffer. This is difficult to imagine.The sole exception to this is that \f(CW\*(C`sysread()\*(C'\fRing past the bufferwill extend the buffer and zero pad the new area..IP "Out of memory!" 4.IX Item "Out of memory!"(X|F) The \fImalloc()\fR function returned 0, indicating there was insufficientremaining memory (or virtual memory) to satisfy the request..SpThe request was judged to be small, so the possibility to trap itdepends on the way Perl was compiled. By default it is not trappable.However, if compiled for this, Perl may use the contents of \f(CW$^M\fR asan emergency pool after \fIdie()\fRing with this message. In this case theerror is trappable \fIonce\fR..ie n .IP "Out of memory during request for %s" 4.el .IP "Out of memory during request for \f(CW%s\fR" 4.IX Item "Out of memory during request for %s"(F) The \fImalloc()\fR function returned 0, indicating there was insufficientremaining memory (or virtual memory) to satisfy the request. However,the request was judged large enough (compile-time default is 64K), soa possibility to shut down by trapping this error is granted..IP "panic: frexp" 4.IX Item "panic: frexp"(P) The library function \fIfrexp()\fR failed, making printf(\*(L"%f\*(R") impossible..IP "Possible attempt to put comments in \fIqw()\fR list" 4.IX Item "Possible attempt to put comments in qw() list"(W) \fIqw()\fR lists contain items separated by whitespace; as with literalstrings, comment characters are not ignored, but are instead treatedas literal data. (You may have used different delimiters than theparentheses shown here; braces are also frequently used.).SpYou probably wrote something like this:.Sp.Vb 4\& @list = qw(\& a # a comment\& b # another comment\& );.Ve.Spwhen you should have written this:.Sp.Vb 4\& @list = qw(\& a\& b\& );.Ve.SpIf you really want comments, build your list theold-fashioned way, with quotes and commas:.Sp.Vb 4\& @list = (\& \*(Aqa\*(Aq, # a comment\& \*(Aqb\*(Aq, # another comment\& );.Ve.IP "Possible attempt to separate words with commas" 4.IX Item "Possible attempt to separate words with commas"(W) \fIqw()\fR lists contain items separated by whitespace; therefore commasaren't needed to separate the items. (You may have used differentdelimiters than the parentheses shown here; braces are also frequentlyused.).SpYou probably wrote something like this:.Sp.Vb 1\& qw! a, b, c !;.Ve.Spwhich puts literal commas into some of the list items. Write it withoutcommas if you don't want them to appear in your data:.Sp.Vb 1\& qw! a b c !;.Ve.IP "Scalar value @%s{%s} better written as $%s{%s}" 4.IX Item "Scalar value @%s{%s} better written as $%s{%s}"(W) You've used a hash slice (indicated by @) to select a single element ofa hash. Generally it's better to ask for a scalar value (indicated by $).The difference is that \f(CW$foo{&bar}\fR always behaves like a scalar, both whenassigning to it and when evaluating its argument, while \f(CW@foo{&bar}\fR behaveslike a list when you assign to it, and provides a li
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -