X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldiag.pod;h=b6558ec9987d5334626985c90a460a0a7b338c55;hb=96ebfdd73e972d4b593cecc5713f33f847828ab9;hp=6907866f8a25266978f7779765d3f2e2af9b917a;hpb=6b3c793055c8e1f1559475f3dd89298a3a9858dc;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 6907866..b6558ec 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -44,14 +44,6 @@ letter. =over 4 -=item A thread exited while %d other threads were still running - -(W) When using threaded Perl, a thread (not necessarily the main -thread) exited while there were still other threads running. -Usually it's a good idea to first collect the return values of the -created threads by joining them, and only then exit from then main -thread. See L. - =item accept() on closed socket %s (W closed) You tried to do an accept on a closed socket. Did you forget @@ -64,7 +56,7 @@ L. =item '!' allowed only after types %s -(F) The '!' is allowed in pack() and unpack() only after certain types. +(F) The '!' is allowed in pack() or unpack() only after certain types. See L. =item Ambiguous call resolved as CORE::%s(), qualify as such or use & @@ -190,17 +182,19 @@ spots. This is now heavily deprecated. must either both be scalars or both be lists. Otherwise Perl won't know which context to supply to the right side. +=item A thread exited while %d threads were running + +(W) When using threaded Perl, a thread (not necessarily the main +thread) exited while there were still other threads running. +Usually it's a good idea to first collect the return values of the +created threads by joining them, and only then exit from the main +thread. See L. + =item Attempt to access disallowed key '%s' in a restricted hash (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 clear a restricted hash - -(F) It is currently not allowed to clear a restricted hash, even if the -new hash would contain the same keys as before. This may change in -the future. - =item Attempt to delete readonly key '%s' from a restricted hash (F) The failing code attempted to delete a key whose value has been @@ -229,6 +223,16 @@ example by: bless $self, "$proto"; +=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 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 free non-arena SV: 0x%lx (P internal) All SV objects are supposed to be allocated from arenas @@ -318,12 +322,6 @@ which is left unnoticed if C uses I system malloc(). (P) One of the internal hash routines was passed a null HV pointer. -=item Bad index while coercing array into hash - -(F) The index looked up in the hash found as the 0'th element of a -pseudo-hash is not legal. Index values must be at 1 or greater. -See L. - =item Badly placed ()'s (A) You've accidentally run your script through B instead @@ -440,11 +438,6 @@ Check you control flow and number of arguments. (P) Perl detected an attempt to copy an internal value that is not copyable. -=item B<-P> not allowed for setuid/setgid script - -(F) The script would have to be opened by the C preprocessor by name, -which provides a race condition that breaks security. - =item Buffer overflow in prime_env_iter: %s (W internal) A warning peculiar to VMS. While Perl was preparing to @@ -467,11 +460,23 @@ checking. Alternatively, if you are certain that you're calling the function correctly, you may put an ampersand before the name to avoid the warning. See L. -=item / cannot take a count +=item Cannot compress integer in pack -(F) You had an unpack template indicating a counted-length string, but -you have also specified an explicit size for the string. See -L. +(F) An argument to pack("w",...) was too large to compress. The BER +compressed integer format can only be used with positive integers, and you +attempted to compress Infinity or a very large number (> 1e308). +See L. + +=item Cannot compress negative numbers in pack + +(F) An argument to pack("w",...) was negative. The BER compressed integer +format can only be used with positive integers. See L. + +=item Can only compress unsigned integers in pack + +(F) An argument to pack("w",...) was not an integer. The BER compressed +integer format can only be used with positive integers, and you attempted +to compress something else. See L. =item Can't bless non-reference value @@ -675,6 +680,15 @@ found in the PATH. found in the PATH, or at least not with the correct permissions. The script exists in the current directory, but PATH prohibits running it. +=item Can't find %s property definition %s + +(F) You may have tried to use C<\p> which means a Unicode property (for +example C<\p{Lu}> is all uppercase letters). If you did mean to use a +Unicode property, see L for the list of known properties. +If you didn't mean to use a Unicode property, escape the C<\p>, either +by C<\\p> (just the C<\p>) or by C<\Q\p> (the rest of the string, until +possible C<\E>). + =item Can't find string terminator %s anywhere before EOF (F) Perl strings can stretch over multiple lines. This message means @@ -687,15 +701,6 @@ If you're getting this error from a here-document, you may have included unseen whitespace before or after your closing tag. A good programmer's editor will have a way to help you find these characters. -=item Can't find %s property definition %s - -(F) You may have tried to use C<\p> which means a Unicode property for -example \p{Lu} is all uppercase letters. if you did mean to use a -Unicode property, see L for the list of known properties. -If you didn't mean to use a Unicode property, escape the C<\p>, either -C<\\p> (just the C<\p>) or by C<\Q\p> (the rest of the string, until -possible C<\E>). - =item Can't fork (F) A fatal error occurred while trying to fork while opening a @@ -780,13 +785,6 @@ lexical variable using "my". This is not allowed. If you want to localize a package variable of the same name, qualify it with the package name. -=item Can't localize pseudo-hash element - -(F) You said something like C<< local $ar->{'key'} >>, where $ar is a -reference to a pseudo-hash. That hasn't been implemented yet, but you -can get a similar effect by localizing the corresponding array element -directly -- C<< local $ar->[$ar->[0]{'key'}] >>. - =item Can't localize through a reference (F) You said something like C, which Perl can't currently @@ -822,12 +820,6 @@ method, nor does any of its base classes. See L. (F) You tried to use in open() a PerlIO layer that does not exist, e.g. open(FH, ">:nosuchlayer", "somefile"). -=item (perhaps you forgot to load "%s"?) - -(F) This is an educated guess made in conjunction with the message -"Can't locate object method \"%s\" via package \"%s\"". It often means -that a method requires a package that has not been loaded. - =item Can't locate package %s for @%s::ISA (W syntax) The @ISA array contained the name of another package that @@ -977,6 +969,11 @@ suidperl. temporary or readonly values) from a subroutine used as an lvalue. This is not allowed. +=item Can't return outside a subroutine + +(F) The return statement was executed in mainline code, that is, where +there was no subroutine call to return out of. See L. + =item Can't return %s to lvalue scalar context (F) You tried to return a complete array or hash from an lvalue subroutine, @@ -985,11 +982,6 @@ to return only one value. You probably meant to write parentheses around the call to the subroutine, which tell Perl that the call should be in list context. -=item Can't return outside a subroutine - -(F) The return statement was executed in mainline code, that is, where -there was no subroutine call to return out of. See L. - =item Can't stat script "%s" (P) For some reason you can't fstat() the script even though you have it @@ -1037,17 +1029,17 @@ indicates that such a conversion was attempted. upgradability. Upgrading to undef indicates an error in the code calling sv_upgrade. -=item Can't use an undefined value as %s reference - -(F) A value used as either a hard reference or a symbolic reference must -be a defined value. This helps to delurk some insidious errors. - =item Can't use anonymous symbol table for method lookup (P) 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. +=item Can't use an undefined value as %s reference + +(F) A value used as either a hard reference or a symbolic reference must +be a defined value. This helps to delurk some insidious errors. + =item Can't use bareword ("%s") as %s ref while "strict refs" in use (F) Only hard references are allowed by "strict refs". Symbolic @@ -1117,7 +1109,7 @@ references can be weakened. with an assignment operator, which implies modifying the value itself. Perhaps you need to copy the value to a temporary, and repeat that. -=item Character in "C" format wrapped +=item Character in "C" format wrapped in pack (W pack) You said @@ -1132,7 +1124,7 @@ and so on) and not for Unicode characters, so Perl behaved as if you meant If you actually want to pack Unicode codepoints, use the C<"U"> format instead. -=item Character in "c" format wrapped +=item Character in "c" format wrapped in pack (W pack) You said @@ -1151,6 +1143,11 @@ instead. (W unopened) You tried to close a filehandle that was never opened. +=item Code missing after '/' + +(F) You had a (sub-)template that ends with a '/'. There must be another +template code following the slash. See L. + =item %s: Command not found (A) You've accidentally run your script through B instead of Perl. @@ -1185,7 +1182,6 @@ first wait for a lock on variable. This lock attempt will only succeed after the other thread has entered cond_wait() and thus relinquished the lock. - =item cond_signal() called on unlocked variable (W threads) Within a thread-enabled program, you tried to call @@ -1254,16 +1250,11 @@ valid magic number. (P) The malloc package that comes with Perl had an internal failure. -=item C<-p> destination: %s +=item Count after length/code in unpack -(F) An error occurred during the implicit output invoked by the C<-p> -command-line switch. (This output goes to STDOUT unless you've -redirected it with select().) - -=item C<-T> and C<-B> not implemented on filehandles - -(F) Perl can't peek at the stdio buffer of filehandles when it doesn't -know about your kind of stdio. You'll have to use a filename instead. +(F) You had an unpack template indicating a counted-length string, but +you have also specified an explicit size for the string. See +L. =item Deep recursion on subroutine "%s" @@ -1337,6 +1328,11 @@ See Server error. (F) You said something like "use Module 42" but the Module did not define a C<$VERSION.> +=item '/' does not take a repeat count + +(F) You cannot put a repeat count of any kind right after the '/' code. +See L. + =item Don't know how to handle magic of type '%s' (P) The internal handling of magical variables has been cursed. @@ -1435,7 +1431,7 @@ goto, or a loop control statement. =item Exiting format via %s -(W exiting) You are exiting an eval by unconventional means, such as a +(W exiting) You are exiting a format by unconventional means, such as a goto, or a loop control statement. =item Exiting pseudo-block via %s @@ -1494,17 +1490,30 @@ PDP-11 or something? =item Filehandle %s opened only for input -(W io) You tried to write on a read-only filehandle. If you intended it -to be a read-write filehandle, you needed to open it with "+<" or "+>" -or "+>>" instead of with "<" or nothing. If you intended only to write -the file, use ">" or ">>". See L. +(W io) You tried to write on a read-only filehandle. If you intended +it to be a read-write filehandle, you needed to open it with "+<" or +"+>" or "+>>" instead of with "<" or nothing. If you intended only to +write the file, use ">" or ">>". See L. =item Filehandle %s opened only for output -(W io) You tried to read from a filehandle opened only for writing. If +(W io) You tried to read from a filehandle opened only for writing, If you intended it to be a read/write filehandle, you needed to open it with "+<" or "+>" or "+>>" instead of with "<" or nothing. If you intended only to read from the file, use "<". See L. +Another possibility is that you attempted to open filedescriptor 0 +(also known as STDIN) for output (maybe you closed STDIN earlier?). + +=item Filehandle %s reopened as %s only for input + +(W io) You opened for reading a filehandle that got the same filehandle id +as STDOUT or STDERR. This occured because you closed STDOUT or STDERR +previously. + +=item Filehandle STDIN reopened as %s only for output + +(W io) You opened for writing a filehandle that got the same filehandle id +as STDIN. This occured because you closed STDIN previously. =item Final $ should be \$ or $name @@ -1527,14 +1536,6 @@ some time before now. Check your control flow. flock() operates on filehandles. Are you attempting to call flock() on a dirhandle by the same name? -=item Quantifier follows nothing in regex; - -marked by <-- HERE in m/%s/ - -(F) You started a regular expression with a quantifier. Backslash it if you -meant it literally. The <-- HERE shows in the regular expression about -where the problem was discovered. See L. - =item Format not terminated (F) A format must be terminated by a line with a solitary dot. Perl got @@ -1632,10 +1633,11 @@ version of Perl, and this should not happen anyway. (F) Unlike with "next" or "last", you're not allowed to goto an unspecified destination. See L. -=item %s-group starts with a count +=item ()-group starts with a count -(F) In pack/unpack a ()-group started with a count. A count is +(F) A ()-group started with a count. A count is supposed to follow something: a template character or a ()-group. + See L. =item %s had compilation errors @@ -1693,6 +1695,11 @@ to your Perl administrator. (W syntax) An illegal character was found in a prototype declaration. Legal characters in prototypes are $, @, %, *, ;, [, ], &, and \. +=item Illegal declaration of anonymous subroutine + +(F) When using the C keyword to construct an anonymous subroutine, +you must always specify a block of code. See L. + =item Illegal division by zero (F) You tried to divide a number by 0. Either something was wrong in @@ -1742,6 +1749,11 @@ name or CLI symbol definition when preparing to iterate over %ENV, and didn't see the expected delimiter between key and value, so the line was ignored. +=item Impossible to activate assertion call + +(W assertions) You're calling an assertion function in a block that is +not under the control of the C pragma. + =item (in cleanup) %s (W misc) This prefix usually indicates that a DESTROY() method raised @@ -1779,9 +1791,9 @@ the world. See L. (F) You can't use system(), exec(), or a piped open in a setuid or setgid script if any of C<$ENV{PATH}>, C<$ENV{IFS}>, C<$ENV{CDPATH}>, -C<$ENV{ENV}> or C<$ENV{BASH_ENV}> are derived from data supplied (or -potentially supplied) by the user. The script must set the path to a -known value, using trustworthy data. See L. +C<$ENV{ENV}>, C<$ENV{BASH_ENV}> or C<$ENV{TERM}> are derived from data +supplied (or potentially supplied) by the user. The script must set +the path to a known value, using trustworthy data. See L. =item Integer overflow in %s number @@ -1795,6 +1807,15 @@ transparently promotes all numbers to a floating point representation internally--subject to loss of precision errors in subsequent operations. +=item Integer overflow in version + +(F) Some portion of a version initialization is too large for the +size of integers for your architecture. This is not a warning +because there is no rational reason for a version to try and use a +element larger than typically 2**32. This is usually caused by +trying to use some odd mathematical operation as a version, like +100/9. + =item Internal disaster in regex; marked by <-- HERE in m/%s/ (P) Something went badly wrong in the regular expression parser. @@ -1846,7 +1867,7 @@ C<{}> from your ending C<\x{}> - C<\x> without the curly braces can go only up to C. The <-- HERE shows in the regular expression about where the problem was discovered. See L. -=item Invalid [] range "%s" in transliteration operator +=item Invalid range "%s" in transliteration operator (F) The range specified in the tr/// or y/// operator had a minimum character greater than the maximum character. See L. @@ -1858,18 +1879,23 @@ 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 type in pack: '%s' +=item Invalid type '%s' in %s -(F) The given character is not a valid pack type. See L. -(W pack) The given character is not a valid pack type but used to be +(F) The given character is not a valid pack or unpack type. +See L. +(W) The given character is not a valid pack or unpack type but used to be silently ignored. -=item Invalid type in unpack: '%s' +=item Invalid version format (multiple underscores) -(F) The given character is not a valid unpack type. See -L. -(W unpack) The given character is not a valid unpack type but used to be -silently ignored. +(F) Versions may contain at most a single underscore, which signals +that the version is a beta release. See L for the allowed +version formats. + +=item Invalid version format (underscores before decimal) + +(F) Versions may not contain decimals after the optional underscore. +See L for the allowed version formats. =item ioctl is not implemented @@ -1924,6 +1950,12 @@ L. (F) While under the C pragma, switching the real and effective uids or gids failed. +=item length/code after end of string in unpack + +(F) While unpacking, the string buffer was alread used up when an unpack +length/code combination tried to obtain more data. This results in +an undefined value for the length. See L. + =item listen() on closed socket %s (W closed) You tried to do a listen on a closed socket. Did you forget @@ -1936,19 +1968,27 @@ L. 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 Lvalue subs returning %s not implemented yet (F) Due to limitations in the current implementation, array and hash values cannot be returned in subroutines used in lvalue context. See L. -=item Lookbehind longer than %d not implemented in regex; +=item Malformed integer in [] in pack -marked by <-- HERE in m/%s/ +(F) Between the brackets enclosing a numeric repeat count only digits +are permitted. See L. -(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 Malformed integer in [] in unpack + +(F) Between the brackets enclosing a numeric repeat count only digits +are permitted. See L. =item Malformed PERLLIB_PREFIX @@ -1984,9 +2024,7 @@ possibility is careless use of utf8::upgrade(). Perl thought it was reading UTF-16 encoded character data but while doing it Perl met a malformed Unicode surrogate. -=item %s matches null string many times in regex; - -marked by <-- HERE in m/%s/ +=item %s matches null string many times in regex; marked by <-- HERE in m/%s/ (W regexp) The pattern you've specified would be an infinite loop if the regular expression engine didn't specifically check for that. The <-- HERE @@ -1999,7 +2037,7 @@ See L. interpreter, especially if the word that is being warned about is "use" or "my". -=item % may only be used in unpack +=item % may not be used in pack (F) You can't pack a string by supplying a checksum, because the checksumming process loses information, and you can't go the other way. @@ -2041,6 +2079,11 @@ double-quotish context. C construction, but the command was missing or blank. +=item Missing control char name in \c + +(F) A double-quoted string ended with "\c", without the required control +character name. + =item Missing name in "my sub" (F) The reserved syntax for lexically scoped subroutines requires that @@ -2129,22 +2172,17 @@ See L for details. (W syntax) Multidimensional arrays aren't written like C<$foo[1,2,3]>. They're written like C<$foo[1][2][3]>, as in C. -=item / must be followed by a*, A* or Z* +=item '/' must be followed by 'a*', 'A*' or 'Z*' (F) You had a pack template indicating a counted-length string, Currently the only things that can have their length counted are a*, A* or Z*. See L. -=item / must be followed by a, A or Z +=item '/' must follow a numeric type in unpack -(F) You had an unpack template indicating a counted-length string, which -must be followed by one of the letters a, A or Z to indicate what sort -of string is to be unpacked. See L. - -=item / must follow a numeric type - -(F) You had an unpack template that contained a '#', but this did not -follow some numeric unpack specification. See L. +(F) You had an unpack template that contained a '/', but this did not +follow some unpack specification producing a numeric value. +See L. =item "my sub" not yet implemented @@ -2164,6 +2202,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. +=item Negative '/' count in unpack + +(F) The length count obtained from a length/code unpack operation was +negative. See L. + =item Negative length (F) You tried to do a read/write/send/recv operation with a buffer @@ -2195,10 +2238,6 @@ setgid script to even be allowed to attempt. Generally speaking there will be another way to do what you want that is, if not secure, at least securable. See L. -=item No B<-e> allowed in setuid scripts - -(F) A setuid script can't be specified by the user. - =item No comma allowed after %s (F) A list operator that has a filehandle or "indirect object" is not @@ -2243,12 +2282,21 @@ but for some reason the perl5db.pl file (or some facsimile thereof) didn't define a DB::sub routine to be called at the beginning of each ordinary subroutine call. +=item No B<-e> allowed in setuid scripts + +(F) A setuid script can't be specified by the user. + =item No error file after 2> or 2>> on command line (F) An error peculiar to VMS. Perl handles its own command line redirection, and found a '2>' or a '2>>' on the command line, but can't find the name of the file to which to write data destined for stderr. +=item No group ending character '%c' found in template + +(F) A pack or unpack template has an opening '(' or '[' without its +matching counterpart. See L. + =item No input file after < on command line (F) An error peculiar to VMS. Perl handles its own command line @@ -2319,19 +2367,6 @@ this class doesn't exist at this point in your program. close a pipe which hadn't been opened. This should have been caught earlier as an attempt to close an unopened filehandle. -=item No such pseudo-hash field "%s" - -(F) You tried to access an array as a hash, but the field name used is -not defined. The hash at index 0 should map all valid field names to -array indices for that to work. - -=item No such pseudo-hash field "%s" in variable %s of type %s - -(F) You tried to access a field of a typed variable where the type does -not know about the field name. The field names are looked up in the -%FIELDS hash in the type package at compile time. The %FIELDS hash is -%usually set up with the 'fields' pragma. - =item No such signal: SIG%s (W signal) You specified a signal name as a subscript to %SIG that was @@ -2408,12 +2443,6 @@ supplied. See L. of Perl. Check the #! line, or manually feed your script into Perl yourself. -=item %s not allowed in length fields - -(F) The count in the (un)pack template may be replaced by C<[TEMPLATE]> only if -C