X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldiag.pod;h=3cd4ece052c3bb2914ddeab786867e279e0bdfa9;hb=ff44e9538d55b6678e360b6132341dbc2eb5d2c3;hp=6f7ed5fd3943162e412926e15e064e5bf849a03e;hpb=65191a1eeddc40c842b08b03bcc6e98666def342;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 6f7ed5f..3cd4ece 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1,3 +1,4 @@ +//depot/perl/pod/perldiag.pod#272 - edit change 14824 (text) =head1 NAME perldiag - various Perl diagnostics @@ -72,7 +73,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 +113,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 +183,12 @@ 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 key '%_' in fixed hash -(F) When vec is called in an lvalue context, the second argument must be -greater than or equal to zero. +(F) A hash has been marked as READONLY at the C level to turn it +into a "record" with a fixed set of keys. The failing code +has attempted to get or set the value of a key which does not +exist or to delete a key. =item Attempt to bless into a reference @@ -261,7 +264,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 +273,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 +539,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 +570,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 +607,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 @@ -628,6 +631,13 @@ found in the PATH did not have correct permissions. (F) A string of a form C was given to prototype(), but there 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 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? + =item Can't find label %s (F) You said to goto a label that isn't mentioned anywhere that it's @@ -1069,15 +1079,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 pack) You said -(W chmod) A novice will sometimes say + pack("c", $x) - chmod 777, $filename +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 -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. + pack("c", $x & 255); + +If you actually want to pack Unicode codepoints, use the C<"U"> format +instead. =item close() on unopened filehandle %s @@ -1193,6 +1223,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 @@ -1236,6 +1271,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. @@ -1255,6 +1295,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 @@ -1267,6 +1312,10 @@ 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) Empty C<\p{}> or C<\P{}>. + =item entering effective %s failed (F) While under the C pragma, switching the real and @@ -1308,6 +1357,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. @@ -1356,12 +1409,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 @@ -1410,11 +1464,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 @@ -1426,7 +1482,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 =..."; } @@ -1513,6 +1569,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. @@ -1564,6 +1625,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 @@ -1588,17 +1654,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" @@ -1624,6 +1690,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. @@ -1660,13 +1732,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 @@ -1676,11 +1747,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. 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. @@ -1751,13 +1825,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 @@ -1794,7 +1869,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.) @@ -1804,11 +1879,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 @@ -1817,7 +1894,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 @@ -1825,6 +1901,13 @@ 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. @@ -1834,11 +1917,20 @@ Perl detected something that didn't comply with UTF-8 encoding rules. 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 @@ -1863,7 +1955,8 @@ ended earlier on the current line. =item Misplaced _ in number -(W syntax) An underline in a decimal constant wasn't on a 3-digit boundary. +(W syntax) An underscore (underbar) in a numeric constant did not +separate two digits. =item Missing %sbrace%s on \N{} @@ -1897,6 +1990,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 @@ -1949,6 +2046,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. @@ -1998,16 +2102,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 @@ -2133,6 +2241,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 @@ -2228,6 +2341,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