X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldiag.pod;h=b6558ec9987d5334626985c90a460a0a7b338c55;hb=96ebfdd73e972d4b593cecc5713f33f847828ab9;hp=e59eee3b8ba7381c149cbbfa841364d3b07c9c0d;hpb=b5fe5ca2134a9ef76f895fb7bc7abec4e8196b08;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldiag.pod b/pod/perldiag.pod index e59eee3..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 the 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 & @@ -165,11 +157,6 @@ or a hash or array slice, such as: name, and not a subroutine call. C will generate this error. -=item '%s' trapped by operation mask - -(F) You tried to use an operator from a Safe compartment in which it's -disallowed. See L. - =item Argument "%s" isn't numeric%s (W numeric) The indicated string was fed as an argument to an operator @@ -195,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 @@ -234,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 @@ -439,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 @@ -466,29 +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 Can only compress unsigned integers - -(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 Cannot compress integer +=item Cannot compress integer in pack (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 +=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 / cannot take a count +=item Can only compress unsigned integers 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 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 @@ -692,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 @@ -704,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 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 fork (F) A fatal error occurred while trying to fork while opening a @@ -832,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 @@ -987,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, @@ -995,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 @@ -1047,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 @@ -1127,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 @@ -1142,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 @@ -1161,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. @@ -1195,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 @@ -1264,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" @@ -1347,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. @@ -1504,17 +1490,19 @@ 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 you intended it to be a read/write filehandle, you needed to open it +(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 @@ -1548,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 @@ -1653,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 @@ -1768,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 @@ -1805,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 @@ -1893,17 +1879,11 @@ 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' - -(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 -silently ignored. - -=item Invalid type in unpack: '%s' +=item Invalid type '%s' in %s -(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 +(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 version format (multiple underscores) @@ -1970,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 @@ -1982,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 @@ -2030,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 @@ -2045,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. @@ -2087,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 @@ -2175,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 @@ -2210,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 @@ -2241,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 @@ -2289,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 @@ -2441,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