X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldiag.pod;h=69c22d60f5228fe59c030ce4cc491749b22886e5;hb=1bf2966364b6356e9050b17d8920dd4a8ce27d97;hp=ad5841ca34668ecdb529b0e0417ab9af5ccf77e9;hpb=126c71c82576d5dc652db25ca9e3f8e18442c4fd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldiag.pod b/pod/perldiag.pod index ad5841c..69c22d6 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -163,6 +163,15 @@ error. that expected a numeric value instead. If you're fortunate the message will identify which operator was so unfortunate. +=item Argument list not closed for PerlIO layer "%s" + +(W layer) When pushing a layer with arguments onto the Perl I/O system you +forgot the ) that closes the argument list. (Layers take care of transforming +data between external and internal representations.) Perl stopped parsing +the layer list at this point and did not attempt to push this layer. +If your program didn't explicitly request the failing operation, it may be +the result of the value of the environment variable PERLIO. + =item Array @%s missing the @ in argument %d of %s() (D deprecated) Really old Perl let you omit the @ on array names in some @@ -195,16 +204,6 @@ thread. See L. (F) The failing code has attempted to get or set a key which is not in the current set of allowed keys of a restricted hash. -=item Attempt to delete readonly key '%s' from a restricted hash - -(F) The failing code attempted to delete a key whose value has been -declared readonly from a restricted hash. - -=item Attempt to delete disallowed key '%s' from a restricted hash - -(F) The failing code attempted to delete from a restricted hash a key -which is not in its key set. - =item Attempt to bless into a reference (F) The CLASSNAME argument to the bless() operator is expected to be @@ -815,16 +814,16 @@ the file, say, by doing C. functioning as a class, but that package doesn't define that particular method, nor does any of its base classes. See L. -=item Can't locate PerlIO%s - -(F) You tried to use in open() a PerlIO layer that does not exist, -e.g. open(FH, ">:nosuchlayer", "somefile"). - =item Can't locate package %s for @%s::ISA (W syntax) The @ISA array contained the name of another package that doesn't seem to exist. +=item Can't locate PerlIO%s + +(F) You tried to use in open() a PerlIO layer that does not exist, +e.g. open(FH, ">:nosuchlayer", "somefile"). + =item Can't make list assignment to \%ENV on this system (F) List assignment to %ENV is not supported on some systems, notably @@ -908,18 +907,10 @@ the command line for writing. redirection, and couldn't open the pipe into which to send data destined for stdout. -=item Can't open perl script%s: %s +=item Can't open perl script%s (F) The script you specified can't be opened for the indicated reason. -=item Can't provide tied hash usage; use keys(%hash) to test if empty - -(F) When a hash is evaluated in scalar context, bucket usage is -returned if the hash is populated, and false is returned if the hash -is empty. Bucket usage is not currently available for tied hashes. -To test if a hash is empty or populated, use keys(%hash) in scalar -context instead. - =item Can't read CRTL environ (S) A warning peculiar to VMS. Perl tried to read an element of %ENV @@ -1039,7 +1030,7 @@ calling sv_upgrade. =item Can't use anonymous symbol table for method lookup -(P) The internal routine that does method lookup was handed a symbol +(F) The internal routine that does method lookup was handed a symbol table that doesn't have a name. Symbol tables can become anonymous for example by undefining stashes: C. @@ -1294,6 +1285,12 @@ there are neither package declarations nor a C<$VERSION>. long for Perl to handle. You have to be seriously twisted to write code that triggers this error. +=item DESTROY created new reference to dead object '%s' + +(F) A DESTROY() method created a new reference to the object which is +just being DESTROYed. Perl is confused, and prefers to abort rather than +to create a dangling reference. + =item Did not produce a valid header See Server error. @@ -1351,8 +1348,8 @@ See L. =item (Do you need to predeclare %s?) -(S) This is an educated guess made in conjunction with the message "%s -found where operator expected". It often means a subroutine or module +(S syntax) This is an educated guess made in conjunction with the message +"%s found where operator expected". It often means a subroutine or module name is being referenced that hasn't been declared yet. This may be because of ordering problems in your file, or because of a missing "sub", "package", "require", or "use" statement. If you're referencing @@ -1372,8 +1369,8 @@ already been freed. =item elseif should be elsif -(S) There is no keyword "elseif" in Perl because Larry thinks it's ugly. -Your code will be interpreted as an attempt to call a method named +(S syntax) There is no keyword "elseif" in Perl because Larry thinks it's +ugly. Your code will be interpreted as an attempt to call a method named "elseif" for the class returned by the following block. This is unlikely to be what you want. @@ -1388,6 +1385,12 @@ a regular expression without specifying the property name. (F) While under the C pragma, switching the real and effective uids or gids failed. +=item %ENV is aliased to %s + +(F) You're running under taint mode, and the C<%ENV> variable has been +aliased to another hash, so it doesn't reflect anymore the state of the +program's environment. This is potentially insecure. + =item Error converting file specification %s (F) An error peculiar to VMS. Because Perl may have to deal with file @@ -1530,13 +1533,6 @@ a literal dollar sign, or was meant to introduce a variable name that happens to be missing. So you have to put either the backslash or the name. -=item Final @ should be \@ or @name - -(F) You must now decide whether the final @ in a string was meant to be -a literal "at" sign, or was meant to introduce a variable name that -happens to be missing. So you have to put either the backslash or the -name. - =item flock() on closed filehandle %s (W closed) The filehandle you're attempting to flock() got itself closed @@ -1572,8 +1568,8 @@ when you meant =item %s found where operator expected -(S) The Perl lexer knows whether to expect a term or an operator. If it -sees what it knows to be a term when it was expecting to see an +(S syntax) The Perl lexer knows whether to expect a term or an operator. +If it sees what it knows to be a term when it was expecting to see an operator, it gives you this warning. Usually it indicates that an operator or delimiter was omitted, such as a semicolon. @@ -1887,6 +1883,13 @@ elements of an attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon. See L. +=item Invalid separator character %s in PerlIO layer specification %s + +(W layer) When pushing layers onto the Perl I/O system, something other than a +colon or whitespace was seen between the elements of a layer list. +If the previous attribute had a parenthesised parameter list, perhaps that +list was terminated too soon. + =item Invalid type '%s' in %s (F) The given character is not a valid pack or unpack type. @@ -1915,11 +1918,23 @@ strange for a machine that supports C. (W unopened) You tried ioctl() on a filehandle that was never opened. Check you control flow and number of arguments. +=item IO layers (like "%s") unavailable + +(F) Your Perl has not been configured to have PerlIO, and therefore +you cannot use IO layers. To have PerlIO Perl must be configured +with 'useperlio'. + =item IO::Socket::atmark not implemented on this architecture (F) Your machine doesn't implement the sockatmark() functionality, neither as a system call or an ioctl call (SIOCATMARK). +=item $* is no longer supported + +(D deprecated) The special variable C<$*>, deprecated in older perls, has +been removed as of 5.9.0 and is no longer supported. You should use the +C and C regexp modifiers instead. + =item `%s' is not a code reference (W overload) The second (fourth, sixth, ...) argument of overload::constant @@ -1970,18 +1985,18 @@ an undefined value for the length. See L. to check the return value of your socket() call? See L. -=item lstat() on filehandle %s - -(W io) You tried to do an lstat on a filehandle. What did you mean -by that? lstat() makes sense only on filenames. (Perl did a fstat() -instead on the filehandle.) - =item Lookbehind longer than %d not implemented in regex; marked by <-- HERE in m/%s/ (F) There is currently a limit on the length of string which lookbehind can handle. This restriction may be eased in a future release. The <-- HERE shows in the regular expression about where the problem was discovered. +=item lstat() on filehandle %s + +(W io) You tried to do an lstat on a filehandle. What did you mean +by that? lstat() makes sense only on filenames. (Perl did a fstat() +instead on the filehandle.) + =item Lvalue subs returning %s not implemented yet (F) Due to limitations in the current implementation, array and hash @@ -2105,8 +2120,8 @@ can vary from one line to the next. =item (Missing operator before %s?) -(S) This is an educated guess made in conjunction with the message "%s -found where operator expected". Often the missing operator is a comma. +(S syntax) This is an educated guess made in conjunction with the message +"%s found where operator expected". Often the missing operator is a comma. =item Missing right brace on %s @@ -2120,8 +2135,8 @@ were last editing. =item (Missing semicolon on previous line?) -(S) This is an educated guess made in conjunction with the message "%s -found where operator expected". Don't automatically put a semicolon on +(S syntax) This is an educated guess made in conjunction with the message +"%s found where operator expected". Don't automatically put a semicolon on the previous line just because you saw this message. =item Modification of a read-only value attempted @@ -2210,6 +2225,11 @@ If you had a good reason for having a unique name, then just mention it again somehow to suppress the message. The C declaration is provided for this purpose. +NOTE: This warning detects symbols that have been used only once so $c, @c, +%c, *c, &c, sub c{}, c(), and c (the filehandle or format) are considered +the same; if a program uses $c only once but also uses any of the others it +will not trigger this warning. + =item Negative '/' count in unpack (F) The length count obtained from a length/code unpack operation was @@ -2239,6 +2259,15 @@ C appear to be nested quantifiers, but aren't. See L. (S internal) The symbol in question was declared but somehow went out of scope before it could possibly have been used. +=item Newline in left-justified string for %s + +(W printf) There is a newline in a string to be left justified by +C or C. + +The padding spaces will appear after the newline, which is probably not +what you wanted. Usually you should remove the newline from the string +and put formatting characters in the C format. + =item No %s allowed while running setuid (F) Certain operations are deemed to be too insecure for a setuid or @@ -2658,6 +2687,13 @@ there are in the savestack. (P) Failed an internal consistency check while trying to reset a weak reference. +=item panic: Devel::DProf inconsistent subroutine return + +(P) Devel::DProf called a subroutine that exited using goto(LABEL), +last(LABEL) or next(LABEL). Leaving that way a subroutine called from +an XSUB will lead very probably to a crash of the interpreter. This is +a bug that will hopefully one day get fixed. + =item panic: die %s (P) We popped the context stack to an eval context, and then discovered @@ -2798,15 +2834,15 @@ was string. (P) The compiler attempted to do a goto, or something weird like that. -=item panic: yylex - -(P) The lexer got into a bad state while processing a case modifier. - =item panic: utf16_to_utf8: odd bytelen (P) Something tried to call utf16_to_utf8 with an odd (as opposed to even) byte length. +=item panic: yylex + +(P) The lexer got into a bad state while processing a case modifier. + =item Parentheses missing around "%s" list (W parenthesis) You said something like @@ -2831,31 +2867,6 @@ redirected it with select().) "Can't locate object method \"%s\" via package \"%s\"". It often means that a method requires a package that has not been loaded. -=item perlio: argument list not closed for layer "%s" - -(W layer) When pushing a layer with arguments onto the Perl I/O system you -forgot the ) that closes the argument list. (Layers take care of transforming -data between external and internal representations.) Perl stopped parsing -the layer list at this point and did not attempt to push this layer. -If your program didn't explicitly request the failing operation, it may be -the result of the value of the environment variable PERLIO. - -=item perlio: invalid separator character %s in layer specification list %s - -(W layer) When pushing layers onto the Perl I/O system, something other than a -colon or whitespace was seen between the elements of a layer list. -If the previous attribute had a parenthesised parameter list, perhaps that -list was terminated too soon. - -=item perlio: unknown layer "%s" - -(W layer) An attempt was made to push an unknown layer onto the Perl I/O -system. (Layers take care of transforming data between external and -internal representations.) Note that some layers, such as C, -are not supported in all environments. If your program didn't -explicitly request the failing operation, it may be the result of the -value of the environment variable PERLIO. - =item Perl %s required--this is only version %s, stopped (F) The module in question uses features of a version of Perl more @@ -3013,8 +3024,8 @@ with a numeric comparison operator, like this : This expression is actually equivalent to C<$x & ($y == 0)>, due to the higher precedence of C<==>. This is probably not what you want. (If you -really meant to write this, disable the warning, or, better, write -C<$x & ($y == 0 ? 1 : 0)>). +really meant to write this, disable the warning, or, better, put the +parentheses explicitly and write C<$x & ($y == 0)>). =item Possible unintended interpolation of %s in string @@ -3204,6 +3215,12 @@ expression compiler gave it. (P) A "can't happen" error, because safemalloc() should have caught it earlier. +=item Repeated format line will never terminate (~~ and @# incompatible) + +(F) Your format containes the ~~ repeat-until-blank sequence and a +numeric field that will never go blank so that the repetition never +terminates. You might use ^# instead. See L. + =item Reversed %s= operator (W syntax) You wrote your assignment operator backwards. The = must @@ -3543,6 +3560,10 @@ about where the problem was discovered. See L. (F) While under the C pragma, we cannot switch the real and effective uids or gids. +=item %s syntax + +(F) The final summary message when a C succeeds. + =item syntax error (F) Probably means you had a syntax error. Common reasons include: @@ -3577,10 +3598,6 @@ yourself. a perl4 interpreter, especially if the next 2 tokens are "use strict" or "my $var" or "our $var". -=item %s syntax - -(F) The final summary message when a C succeeds. - =item sysread() on closed filehandle %s (W closed) You tried to read from a closed filehandle. @@ -3861,16 +3878,21 @@ what you are doing you can turn off this warning by C. (F) There are no byte-swapping functions for a machine with this byte order. -=item Unknown "re" subpragma '%s' (known ones are: %s) - -You tried to use an unknown subpragma of the "re" pragma. - =item Unknown open() mode '%s' (F) The second argument of 3-argument open() is not among the list of valid modes: C<< < >>, C<< > >>, C<<< >> >>>, C<< +< >>, C<< +> >>, C<<< +>> >>>, C<-|>, C<|->, C<< <& >>, C<< >& >>. +=item Unknown PerlIO layer "%s" + +(W layer) An attempt was made to push an unknown layer onto the Perl I/O +system. (Layers take care of transforming data between external and +internal representations.) Note that some layers, such as C, +are not supported in all environments. If your program didn't +explicitly request the failing operation, it may be the result of the +value of the environment variable PERLIO. + =item Unknown process %x sent message to prime_env_iter: %s (P) An error peculiar to VMS. Perl was reading values for %ENV before @@ -3878,6 +3900,10 @@ iterating over it, and someone else stuck a message in the stream of data Perl expected. Someone's very confused, or perhaps trying to subvert Perl's population of %ENV for nefarious purposes. +=item Unknown "re" subpragma '%s' (known ones are: %s) + +You tried to use an unknown subpragma of the "re" pragma. + =item Unknown switch condition (?(%.2s in regex; marked by <-- HERE in m/%s/ (F) The condition part of a (?(condition)if-clause|else-clause) construct @@ -3949,6 +3975,11 @@ script, a binary program, or a directory as a Perl program. recognized by Perl inside character classes. The character was understood literally. +=item Unrecognized escape \\%c passed through + +(W misc) You used a backslash-character combination which is not +recognized by Perl. + =item Unrecognized escape \\%c passed through in regex; marked by <-- HERE in m/%s/ (W regexp) You used a backslash-character combination which is not @@ -3957,11 +3988,6 @@ a C<'>-delimited regular expression. The character was understood literally. The <-- HERE shows in the regular expression about where the escape was discovered. -=item Unrecognized escape \\%c passed through - -(W misc) You used a backslash-character combination which is not -recognized by Perl. - =item Unrecognized signal name "%s" (F) You specified a signal name to the kill() function that was not @@ -4039,6 +4065,16 @@ earlier in the line, and you really meant a "less than". (W untie) A copy of the object returned from C (or C) was still valid when C was called. +=item Usage: POSIX::%s(%s) + +(F) You called a POSIX function with incorrect arguments. +See L for more information. + +=item Usage: Win32::%s(%s) + +(F) You called a Win32 function with incorrect arguments. +See L for more information. + =item Useless (?-%s) - don't use /%s modifier in regex; marked by <-- HERE in m/%s/ (W regexp) You have used an internal modifier such as (?-o) that has no @@ -4053,6 +4089,12 @@ must be written as The <-- HERE shows in the regular expression about where the problem was discovered. See L. +=item Useless localization of %s + +(W syntax) The localization of lvalues such as C is +legal, but in fact the local() currently has no effect. This may change at +some point in the future, but in the meantime such code is discouraged. + =item Useless (?%s) - use /%s modifier in regex; marked by <-- HERE in m/%s/ (W regexp) You have used an internal modifier such as (?o) that has no @@ -4159,6 +4201,19 @@ modifier is not presently meaningful in substitutions. use the /g modifier. Currently, /c is meaningful only when /g is used. (This may change in the future.) +=item Use of freed value in iteration + +(F) Perhaps you modified the iterated array within the loop? +This error is typically caused by code like the following: + + @a = (3,4); + @a = () for (1,2,@a); + +You are not supposed to modify arrays while they are being iterated over. +For speed and efficiency reasons, Perl internally does not do full +reference-counting of iterated items, hence deleting such an item in the +middle of an iteration causes Perl to see a freed value. + =item Use of *glob{FILEHANDLE} is deprecated (D deprecated) You are now encouraged to use the shorter *glob{IO} form @@ -4205,13 +4260,6 @@ C. (F) You attempted to use a feature of printf that is accessible from only C. This usually means there's a better way to do it in Perl. -=item Use of $* is deprecated - -(D deprecated) This variable magically turned on multi-line pattern -matching, both for you and for any luckless subroutine that you happen -to call. You should use the new C and C modifiers now to do -that without the dangerous action-at-a-distance effects of C<$*>. - =item Use of $# is deprecated (D deprecated) This was an ill-advised attempt to emulate a poorly @@ -4223,18 +4271,6 @@ defined B feature. Use an explicit printf() or sprintf() instead. generally because there's a better way to do it, and also because the old way has bad side effects. -=item Use of freed value in iteration (perhaps you modified the iterated array within the loop?) - -(F) This is typically caused by code like the following: - - @a = (3,4); - @a = () for (1,2,@a); - -You are not supposed to modify arrays while they are being iterated over. -For speed and efficiency reasons, Perl internally does not do full -reference-counting of iterated items, hence deleting such an item in the -middle of an iteration causes Perl to see a freed value. - =item Use of -l on filehandle %s (W io) A filehandle represents an opened file, and when you opened the file @@ -4329,6 +4365,36 @@ C operator. longer than 1024 characters. The return value has been truncated to 1024 characters. +=item Variable "%s" is not available + +(W closure) During compilation, an inner named subroutine or eval is +attempting to capture an outer lexical that is not currently available. +This can happen for one of two reasons. First, the outer lexical may be +declared in an outer anonymous subroutine that has not yet been created. +(Remember that named subs are created at compile time, while anonymous +subs are created at run-time.) For example, + + sub { my $a; sub f { $a } } + +At the time that f is created, it can't capture the current value of $a, +since the anonymous subroutine hasn't been created yet. Conversely, +the following won't give a warning since the anonymous subroutine has by +now been created and is live: + + sub { my $a; eval 'sub f { $a }' }->(); + +The second situation is caused by an eval accessing a variable that has +gone out of scope, for example, + + sub f { + my $a; + sub { eval '$a' } + } + f()->(); + +Here, when the '$a' in the eval is being compiled, f() is not currently being +executed, so its $a is not available for capture. + =item Variable "%s" is not imported%s (F) While "use strict" in effect, you referred to a global variable that @@ -4351,27 +4417,6 @@ instance. This is almost always a typographical error. Note that the earlier variable will still exist until the end of the scope or until all closure referents to it are destroyed. -=item Variable "%s" may be unavailable - -(W closure) An inner (nested) I subroutine is inside a -I subroutine, and outside that is another subroutine; and the -anonymous (innermost) subroutine is referencing a lexical variable -defined in the outermost subroutine. For example: - - sub outermost { my $a; sub middle { sub { $a } } } - -If the anonymous subroutine is called or referenced (directly or -indirectly) from the outermost subroutine, it will share the variable as -you would expect. But if the anonymous subroutine is called or -referenced when the outermost subroutine is not active, it will see the -value of the shared variable as it was before and during the *first* -call to the outermost subroutine, which is probably not what you want. - -In these circumstances, it is usually best to make the middle subroutine -anonymous, using the C syntax. Perl has specific support for -shared variables in nested anonymous subroutines; a named subroutine in -between interferes with this feature. - =item Variable syntax (A) You've accidentally run your script through B instead @@ -4381,22 +4426,18 @@ Perl yourself. =item Variable "%s" will not stay shared (W closure) An inner (nested) I subroutine is referencing a -lexical variable defined in an outer subroutine. +lexical variable defined in an outer named subroutine. -When the inner subroutine is called, it will probably see the value of +When the inner subroutine is called, it will see the value of the outer subroutine's variable as it was before and during the *first* call to the outer subroutine; in this case, after the first call to the outer subroutine is complete, the inner and outer subroutines will no longer share a common value for the variable. In other words, the variable will no longer be shared. -Furthermore, if the outer subroutine is anonymous and references a -lexical variable outside itself, then the outer and inner subroutines -will I share the given variable. - This problem can usually be solved by making the inner subroutine anonymous, using the C syntax. When inner anonymous subs that -reference variables in outer subroutines are called or referenced, they +reference variables in outer subroutines are created, they are automatically rebound to the current values of such variables. =item Version number must be a constant number @@ -4448,9 +4489,12 @@ So put in parentheses to say what you really mean. =item Wide character in %s (W utf8) Perl met a wide character (>255) when it wasn't expecting -one. This warning is by default on for I/O (like print) but can be -turned off by C. You are supposed to explicitly -mark the filehandle with an encoding, see L and L. +one. This warning is by default on for I/O (like print). The easiest +way to quiet this warning is simply to add the C<:utf8> layer to the +output, e.g. C. Another way to turn off the +warning is to add C but that is often closer to +cheating. In general, you are supposed to explicitly mark the +filehandle with an encoding, see L and L. =item Within []-length '%c' not allowed @@ -4464,6 +4508,16 @@ of the codes @, /, U, u, w or a *-length. Redesign the template. (W closed) The filehandle you're writing to got itself closed sometime before now. Check your control flow. +=item %s "\x%s" does not map to Unicode + +When reading in different encodings Perl tries to map everything +into Unicode characters. The bytes you read in are not legal in +this encoding, for example + + utf8 "\xE4" does not map to Unicode + +if you try to read in the a-diaereses Latin-1 as UTF-8. + =item 'X' outside of string (F) You had a (un)pack template that specified a relative position before @@ -4499,6 +4553,12 @@ which means that Perl 5 will try to call the subroutine when the assignment is executed, which is probably not what you want. (If it IS what you want, put an & in front.) +=item Your random numbers are not that random + +(F) When trying to initialise the random seed for hashes, Perl could +not get any randomness out of your system. This usually indicates +Something Very Wrong. + =back =cut