X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldiag.pod;h=10b77c9c532af76b9633b0a3e02b5ba528852d43;hb=0111df86b68202837d8ca044a27bbc00d7895fb1;hp=eab05567e3c868982e956364f90b6de90b4c572d;hpb=d4ced10d0773d7b2aaa8e52df351060660783e30;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldiag.pod b/pod/perldiag.pod index eab0556..10b77c9 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -44,6 +44,14 @@ 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 @@ -72,7 +80,7 @@ Alternatively, you can import the subroutine (or pretend that it's imported with the C pragma). To silently interpret it as the Perl operator, use the C prefix -on the operator (e.g. C) or by declaring the subroutine +on the operator (e.g. C) or declare the subroutine to be an object method (see L or L). @@ -112,8 +120,8 @@ which 'splits' output into two streams, such as =item Applying %s to %s will act on scalar(%s) -(W misc) The pattern match (//), substitution (s///), and -transliteration (tr///) operators work on scalar values. If you apply +(W misc) The pattern match (C), substitution (C), and +transliteration (C) operators work on scalar values. If you apply one of them to an array or a hash, it will convert the array or hash to a scalar value -- the length of an array, or the population info of a hash -- and then work on that scalar value. This is probably not what @@ -182,10 +190,26 @@ 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 Negative offset to vec in lvalue context +=item Attempt to access disallowed key '%s' in a restricted hash -(F) When vec is called in an lvalue context, the second argument must be -greater than or equal to zero. +(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 +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 @@ -261,7 +285,7 @@ avoid this warning. used as an lvalue, which is pretty strange. Perhaps you forgot to dereference it first. See L. -=item Bad arg length for %s, is %d, should be %d +=item Bad arg length for %s, is %d, should be %s (F) You passed a buffer of the wrong size to one of msgctl(), semctl() or shmctl(). In C parlance, the correct sizes are, respectively, @@ -270,7 +294,7 @@ S. =item Bad evalled substitution pattern -(F) You've used the /e switch to evaluate the replacement for a +(F) You've used the C switch to evaluate the replacement for a substitution, but perl found a syntax error in the code to evaluate, most likely an unexpected right brace '}'. @@ -536,9 +560,9 @@ quotas or other plumbing problems. =item Can't declare class for non-scalar %s in "%s" -(S) Currently, only scalar variables can declared with a specific class -qualifier in a "my" or "our" declaration. The semantics may be extended -for other types of variables in future. +(F) Currently, only scalar variables can be declared with a specific +class qualifier in a "my" or "our" declaration. The semantics may be +extended for other types of variables in future. =item Can't declare %s in "%s" @@ -567,10 +591,10 @@ C<-i.bak>, or some such. characters and Perl was unable to create a unique filename during inplace editing with the B<-i> switch. The file was ignored. -=item Can't do {n,m} with n > m before << HERE in regex m/%s/ +=item Can't do {n,m} with n > m in regex; marked by <-- HERE in m/%s/ (F) Minima must be less than or equal to maxima. If you really want your -regexp to match something 0 times, just put {0}. The << HERE shows in the +regexp to match something 0 times, just put {0}. The <-- HERE shows in the regular expression about where the problem was discovered. See L. =item Can't do setegid! @@ -604,7 +628,7 @@ line. =item Can't exec "%s": %s -(W exec) An system(), exec(), or piped open call could not execute the +(W exec) A system(), exec(), or piped open call could not execute the named program for the indicated reason. Typical reasons include: the permissions were wrong on the file, the file wasn't found in C<$ENV{PATH}>, the executable in question was compiled for another @@ -631,7 +655,7 @@ is no builtin with the name C. =item Can't find %s character property "%s" (F) You used C<\p{}> or C<\P{}> but the character property by that name -could not be find. Maybe you mispelled the name of the property +could not be found. Maybe you misspelled the name of the property (remember that the names of character properties consist only of alphanumeric characters), or maybe you forgot the C or C prefix? @@ -666,7 +690,9 @@ 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. Escape the C<\p>, either +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>). @@ -791,6 +817,11 @@ 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 (perhaps you forgot to load "%s"?) (F) This is an educated guess made in conjunction with the message @@ -844,6 +875,16 @@ switches, or explicitly, failed for the indicated reason. Usually this is because you don't have read permission for a file which you named on the command line. +=item Can't open a reference + +(W io) You tried to open a scalar reference for reading or writing, +using the 3-arg open() syntax : + + open FH, '>', $ref; + +but your version of perl is compiled without perlio, and this form of +open is not supported. + =item Can't open bidirectional pipe (W pipe) You tried to say C, which is not supported. @@ -1076,15 +1117,35 @@ 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 chmod() mode argument is missing initial 0 +=item Character in "C" format wrapped + +(W pack) You said + + pack("C", $x) + +where $x is either less than 0 or more than 255; the C<"C"> format is +only for encoding native operating system characters (ASCII, EBCDIC, +and so on) and not for Unicode characters, so Perl behaved as if you meant + + pack("C", $x & 255) + +If you actually want to pack Unicode codepoints, use the C<"U"> format +instead. + +=item Character in "c" format wrapped -(W chmod) A novice will sometimes say +(W pack) You said - chmod 777, $filename + pack("c", $x) -not realizing that 777 will be interpreted as a decimal number, -equivalent to 01411. Octal constants are introduced with a leading 0 in -Perl, as in C. +where $x is either less than -128 or more than 127; the C<"c"> format +is only for encoding native operating system characters (ASCII, EBCDIC, +and so on) and not for Unicode characters, so Perl behaved as if you meant + + pack("c", $x & 255); + +If you actually want to pack Unicode codepoints, use the C<"U"> format +instead. =item close() on unopened filehandle %s @@ -1113,6 +1174,29 @@ in the regular expression engine; or rewriting the regular expression so that it is simpler or backtracks less. (See L for information on I.) +=item cond_broadcast() called on unlocked variable + +(W threads) Within a thread-enabled program, you tried to call +cond_broadcast() on a variable which wasn't locked. The cond_broadcast() +function is used to wake up another thread that is waiting in a +cond_wait(). To ensure that the signal isn't sent before the other thread +has a chance to enter the wait, it is usual for the signaling thread to +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 +cond_signal() on a variable which wasn't locked. The cond_signal() +function is used to wake up another thread that is waiting in a +cond_wait(). To ensure that the signal isn't sent before the other thread +has a chance to enter the wait, it is usual for the signaling thread to +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 connect() on closed socket %s (W closed) You tried to do a connect on a closed socket. Did you forget @@ -1137,7 +1221,7 @@ See L and L. =item Constant subroutine %s redefined -(S|W redefine) You redefined a subroutine which had previously been +(S) You redefined a subroutine which had previously been eligible for inlining. See L for commentary and workarounds. @@ -1200,6 +1284,11 @@ array is empty, just use C for example. checks for an undefined I value. If you want to see if the hash is empty, just use C for example. +=item %s defines neither package nor VERSION--version check failed + +(F) You said something like "use Module 42" but in the Module file +there are neither package declarations nor a C<$VERSION>. + =item Delimiter for here document is too long (F) In a here document construct like C<<, the label C is too @@ -1243,6 +1332,11 @@ you called it with no args and both C<$@> and C<$_> were empty. See Server error. +=item %s does not define %s::VERSION--version check failed + +(F) You said something like "use Module 42" but the Module did not +define a C<$VERSION.> + =item Don't know how to handle magic of type '%s' (P) The internal handling of magical variables has been cursed. @@ -1262,6 +1356,11 @@ something that isn't defined yet, you don't actually have to define the subroutine or package before the current location. You can use an empty "sub foo;" or "package FOO;" to enter a "forward" declaration. +=item dump() better written as CORE::dump() + +(W misc) You used the obsolescent C built-in function, without fully +qualifying it as C. Maybe it's a typo. See L. + =item Duplicate free() ignored (S malloc) An internal routine called free() on something that had @@ -1274,6 +1373,12 @@ 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. +=item Empty %s + +(F) C<\p> and C<\P> are used to introduce a named Unicode property, as +described in L and L. You used C<\p> or C<\P> in +a regular expression without specifying the property name. + =item entering effective %s failed (F) While under the C pragma, switching the real and @@ -1315,6 +1420,10 @@ Perl identifier. If you're just trying to glob a long list of filenames, try using the glob() operator, or put the filenames into a variable and glob that. +=item exec? I'm not *that* kind of operating system + +(F) The C function is not implemented in MacPerl. See L. + =item Execution of %s aborted due to compilation errors (F) The final summary message when a Perl compilation fails. @@ -1326,7 +1435,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 @@ -1363,12 +1472,13 @@ Check the #! line, or manually feed your script into Perl yourself. END subroutine. Processing of the remainder of the queue of such routines has been prematurely ended. -=item false [] range "%s" in regexp +=item False [] range "%s" in regex; marked by <-- HERE in m/%s/ (W regexp) A character class range must start and end at a literal -character, not another character class like C<\d> or C<[:alpha:]>. The -"-" in your false range is interpreted as a literal "-". Consider -quoting the "-", "\-". See L. +character, not another character class like C<\d> or C<[:alpha:]>. The "-" +in your false range is interpreted as a literal "-". Consider quoting the +"-", "\-". The <-- HERE shows in the regular expression about where the +problem was discovered. See L. =item Fatal VMS error at %s, line %d @@ -1417,11 +1527,13 @@ 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 before << HERE in regex m/%s/ +=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. +meant it literally. The <-- HERE shows in the regular expression about +where the problem was discovered. See L. =item Format not terminated @@ -1433,7 +1545,7 @@ to the end of your file without finding such a line. (W redefine) You redefined a format. To suppress this warning, say { - no warnings; + no warnings 'redefine'; eval "format NAME =..."; } @@ -1520,6 +1632,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 + +(F) In pack/unpack a ()-group started with a count. A count is +supposed to follow something: a template character or a ()-group. + =item %s had compilation errors (F) The final summary message when a C fails. @@ -1571,6 +1688,11 @@ when Perl was built using standard options. For some reason, your version of Perl appears to have been built without this support. Talk to your Perl administrator. +=item Illegal character in prototype for %s : %s + +(W syntax) An illegal character was found in a prototype declaration. Legal +characters in prototypes are $, @, %, *, ;, [, ], &, and \. + =item Illegal division by zero (F) You tried to divide a number by 0. Either something was wrong in @@ -1595,17 +1717,17 @@ two from 1 to 32 (or 64, if your platform supports that). =item Illegal octal digit %s -(F) You used an 8 or 9 in a octal number. +(F) You used an 8 or 9 in an octal number. =item Illegal octal digit %s ignored -(W digit) You may have tried to use an 8 or 9 in a octal number. +(W digit) You may have tried to use an 8 or 9 in an octal number. Interpretation of the octal number stopped before the 8 or 9. =item Illegal switch in PERL5OPT: %s (X) The PERL5OPT environment variable may only be used to set the -following switches: B<-[DIMUdmw]>. +following switches: B<-[DIMUdmtw]>. =item Ill-formed CRTL environ value "%s" @@ -1631,6 +1753,12 @@ would otherwise result in the same message being repeated. Failure of user callbacks dispatched using the C flag could also result in this warning. See L. +=item In EBCDIC the v-string components cannot exceed 2147483647 + +(F) An error peculiar to EBCDIC. Internally, v-strings are stored as +Unicode code points, and encoded in EBCDIC as UTF-EBCDIC. The UTF-EBCDIC +encoding is limited to code points no larger than 2147483647 (0x7FFFFFFF). + =item Insecure dependency in %s (F) You tried to do something that the tainting mechanism didn't like. @@ -1667,13 +1795,12 @@ transparently promotes all numbers to a floating point representation internally--subject to loss of precision errors in subsequent operations. -=item Internal disaster before << HERE in regex m/%s/ +=item Internal disaster in regex; marked by <-- HERE in m/%s/ (P) Something went badly wrong in the regular expression parser. -The << HERE shows in the regular expression about where the problem was +The <-- HERE shows in the regular expression about where the problem was discovered. - =item Internal inconsistency in tracking vforks (S) A warning peculiar to VMS. Perl keeps track of the number of times @@ -1683,11 +1810,11 @@ L). Somehow, this count has become scrambled, so Perl is making a guess and treating this C as a request to terminate the Perl script and execute the specified command. -=item Internal urp before << HERE in regex m/%s/ - -(P) Something went badly awry in the regular expression parser. The <<. (W printf) Perl does not understand the given format conversion. See L. -=item invalid [] range "%s" in regexp +=item Invalid [] range "%s" in regex; marked by <-- HERE in m/%s/ (F) The range specified in a character class had a minimum character -greater than the maximum character. One possibility is that you -forgot the C<{}> from your ending C<\x{}> - C<\x> without the curly -braces can go only up to C. See L. +greater than the maximum character. One possibility is that you forgot the +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. @@ -1760,13 +1888,14 @@ neither as a system call or an ioctl call (SIOCATMARK). =item `%s' is not a code reference -(W) The second (fourth, sixth, ...) argument of overload::constant needs -to be a code reference. Either an anonymous subroutine, or a reference +(W overload) The second (fourth, sixth, ...) argument of overload::constant +needs to be a code reference. Either an anonymous subroutine, or a reference to a subroutine. =item `%s' is not an overloadable type -(W) You tried to overload a constant type the overload package is unaware of. +(W overload) You tried to overload a constant type the overload package is +unaware of. =item junk on end of regexp @@ -1803,7 +1932,7 @@ L. =item lstat() on filehandle %s -(W io) You tried to do a lstat on a filehandle. What did you mean +(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.) @@ -1813,11 +1942,13 @@ instead on the filehandle.) values cannot be returned in subroutines used in lvalue context. See L. -=item Lookbehind longer than %d not implemented before << HERE %s +=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. +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 PERLLIB_PREFIX @@ -1826,7 +1957,6 @@ the regular expression about where the problem was discovered. prefix1;prefix2 or - prefix1 prefix2 with nonempty prefix1 and prefix2. If C is indeed a prefix of @@ -1834,20 +1964,40 @@ a builtin library search path, prefix2 is substituted. The error may appear if components are not found, or are too long. See "PERLLIB_PREFIX" in L. +=item Malformed prototype for %s: %s + +(F) You tried to use a function with a malformed prototype. The +syntax of function prototypes is given a brief compile-time check for +obvious errors like invalid characters. A more rigorous check is run +when the function is called. + =item Malformed UTF-8 character (%s) Perl detected something that didn't comply with UTF-8 encoding rules. +One possible cause is that you read in data that you thought to be in +UTF-8 but it wasn't (it was for example legacy 8-bit data). Another +possibility is careless use of utf8::upgrade(). + =item Malformed UTF-16 surrogate 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 +=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. See -L. +regular expression engine didn't specifically check for that. The <-- HERE +shows in the regular expression about where the problem was discovered. +See L. + +=item "%s" may clash with future reserved word + +(W) This warning may be due to running a perl5 script through a perl4 +interpreter, especially if the word that is being warned about is +"use" or "my". =item % may only be used in unpack @@ -1907,6 +2057,10 @@ can vary from one line to the next. (S) 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 + +(F) Missing right brace in C<\p{...}> or C<\P{...}>. + =item Missing right curly or square bracket (F) The lexer counted more opening curly or square brackets than closing @@ -1959,6 +2113,13 @@ couldn't be created for some peculiar reason. you omitted the name of the module. Consult L for full details about C<-M> and C<-m>. +=item More than one argument to open + +(F) The C function has been asked to open multiple files. This +can happen if you are trying to open a pipe to a command that takes a +list of arguments, but have forgotten to specify a piped open mode. +See L for details. + =item msg%s not implemented (F) You don't have System V message IPC on your system. @@ -2008,16 +2169,20 @@ provided for this purpose. (F) You tried to do a read/write/send/recv operation with a buffer length that is less than 0. This is difficult to imagine. -=item Nested quantifiers before << HERE in regex m/%s/ +=item Negative offset to vec in lvalue context + +(F) When C is called in an lvalue context, the second argument must be +greater than or equal to zero. + +=item Nested quantifiers in regex; marked by <-- HERE in m/%s/ (F) You can't quantify a quantifier without intervening parentheses. So -things like ** or +* or ?* are illegal. The << HERE shows in the regular +things like ** or +* or ?* are illegal. The <-- HERE shows in the regular expression about where the problem was discovered. -Note, however, that the minimal matching quantifiers, C<*?>, C<+?>, and +Note that the minimal matching quantifiers, C<*?>, C<+?>, and C appear to be nested quantifiers, but aren't. See L. - =item %s never introduced (S internal) The symbol in question was declared but somehow went out of @@ -2143,6 +2308,11 @@ immediately after the switch, without intervening spaces. (F) The indicated command line switch needs a mandatory argument, but you haven't specified one. +=item No such class %s + +(F) You provided a class qualifier in a "my" or "our" declaration, but +this class doesn't exist at this point in your program. + =item No such pipe open (P) An error peculiar to VMS. The internal routine my_pclose() tried to @@ -2238,6 +2408,12 @@ 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