X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldiag.pod;h=69c22d60f5228fe59c030ce4cc491749b22886e5;hb=1bf2966364b6356e9050b17d8920dd4a8ce27d97;hp=603dfc8812a9bb8b551e91b6bf48e7348e9ac18e;hpb=8e11cd2b6971dafecaf9e97b12c3f527025bae90;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 603dfc8..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 @@ -898,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 @@ -1284,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. @@ -1341,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 @@ -1362,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. @@ -1378,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 @@ -1555,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. @@ -1870,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. @@ -1898,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 @@ -2088,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 @@ -2103,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 @@ -2193,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 @@ -2222,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 @@ -2641,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 @@ -2814,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 @@ -3187,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 @@ -3850,6 +3884,15 @@ order. 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 @@ -4046,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 @@ -4060,12 +4109,6 @@ 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 use of %s in void context (W void) You did something without a side effect in a context that does @@ -4158,9 +4201,10 @@ 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 (perhaps you modified the iterated array within the loop?) +=item Use of freed value in iteration -(F) This is typically caused by code like the following: +(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); @@ -4216,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 @@ -4328,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 @@ -4350,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 @@ -4380,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 @@ -4447,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 @@ -4463,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 @@ -4498,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