This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Alphabetise perldiag
[perl5.git] / pod / perldiag.pod
index 0f29f3e..23f147d 100644 (file)
@@ -54,7 +54,7 @@ L<perlfunc/accept>.
 
 (X) You can't allocate more than 64K on an MS-DOS machine.
 
-=item '%c' allowed only after types %s
+=item '%c' allowed only after types %s in %s
 
 (F) The modifiers '!', '<' and '>' are allowed in pack() or unpack() only
 after certain types.  See L<perlfunc/pack>.
@@ -214,6 +214,13 @@ 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 Argument "%s" treated as 0 in increment (++)
+
+(W numeric) The indicated string was fed as an argument to the C<++>
+operator which expects either a number or a string matching
+C</^[a-zA-Z]*[0-9]*\z/>.  See L<perlop/Auto-increment and
+Auto-decrement> for details.
+
 =item Array @%s missing the @ in argument %d of %s()
 
 (D deprecated) Really old Perl let you omit the @ on array names in some
@@ -221,11 +228,11 @@ spots.  This is now heavily deprecated.
 
 =item A sequence of multiple spaces in a charnames alias definition is deprecated
 
-(D) You defined a character name which had multiple space characters in
-a row.  Change them to single spaces.  Usually these names are defined
-in the C<:alias> import argument to C<use charnames>, but they could be
-defined by a translator installed into C<$^H{charnames}>.  See
-L<charnames/CUSTOM ALIASES>.
+(D deprecated) You defined a character name which had multiple space
+characters in a row.  Change them to single spaces.  Usually these
+names are defined in the C<:alias> import argument to C<use charnames>, but
+they could be defined by a translator installed into C<$^H{charnames}>.
+See L<charnames/CUSTOM ALIASES>.
 
 =item assertion botched: %s
 
@@ -259,6 +266,12 @@ thread.  See L<threads>.
 (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 bless into a freed package
+
+(F) You wrote C<bless $foo> with one argument after somehow causing
+the current package to be freed.  Perl cannot figure out what to
+do, so it throws up in hands in despair.
+
 =item Attempt to bless into a reference
 
 (F) The CLASSNAME argument to the bless() operator is expected to be
@@ -540,7 +553,7 @@ Check your control flow and number of arguments.
 
 =item "\B{" is deprecated; use "\B\{" or "\B[{]" instead in regex; marked by <-- HERE in m/%s/
 
-(W deprecated) Use of an unescaped "{" immediately following
+(D deprecated) Use of an unescaped "{" immediately following
 a C<\b> or C<\B> is now deprecated so as to reserve its use for Perl
 itself in a future release.  You can either precede the brace
 with a backslash, or enclose it in square brackets; the latter
@@ -557,7 +570,7 @@ copiable.
 
 =item Bizarre SvTYPE [%d]
 
-(P) When starting a new thread or return values from a thread, Perl
+(P) When starting a new thread or returning values from a thread, Perl
 encountered an invalid data type.
 
 =item Buffer overflow in prime_env_iter: %s
@@ -671,6 +684,16 @@ Something like this will reproduce the error:
     process $BADREF 1,2,3;
     $BADREF->process(1,2,3);
 
+=item Can't call mro_isa_changed_in() on anonymous symbol table
+
+(P) Perl got confused as to whether a hash was a plain hash or a
+symbol table hash when trying to update @ISA caches.
+
+=item Can't call mro_method_changed_in() on anonymous symbol table
+
+(F) An XS module tried to call C<mro_method_changed_in> on a hash that was
+not attached to the symbol table.
+
 =item Can't chdir to %s
 
 (F) You called C<perl -x/foo/bar>, but F</foo/bar> is not a directory
@@ -1000,7 +1023,7 @@ VMS.
 
 =item Can't make loaded symbols global on this platform while loading %s
 
-(W) A module passed the flag 0x01 to DynaLoader::dl_load_file() to request
+(S) A module passed the flag 0x01 to DynaLoader::dl_load_file() to request
 that symbols from the stated file are made available globally within the
 process, but that functionality is not available on this platform.  Whilst
 the module likely will still work, this may prevent the perl interpreter
@@ -1267,6 +1290,8 @@ test the type of the reference, if need be.
 
 =item Can't use string ("%s") as %s ref while "strict refs" in use
 
+=item Can't use string ("%s"...) as %s ref while "strict refs" in use
+
 (F) You've told Perl to dereference a string, something which
 C<use strict> blocks to prevent it happening accidentally.  See
 L<perlref/"Symbolic references">.  This can be triggered by an C<@> or C<$>
@@ -1310,7 +1335,7 @@ Perhaps you need to copy the value to a temporary, and repeat that.
 
 =item Character following "\c" must be ASCII
 
-(F)(W deprecated, syntax) In C<\cI<X>>, I<X> must be an ASCII character.
+(F)(D deprecated, syntax) In C<\cI<X>>, I<X> must be an ASCII character.
 It is planned to make this fatal in all instances in Perl v5.20.  In
 the cases where it isn't fatal, the character this evaluates to is
 derived by exclusive or'ing the code point of this character with 0x40.
@@ -1745,7 +1770,7 @@ define a C<$VERSION>.
 (F) You cannot put a repeat count of any kind right after the '/' code.
 See L<perlfunc/pack>.
 
-=item Don't know how to handle magic of type '%s'
+=item Don't know how to handle magic of type \%o
 
 (P) The internal handling of magical variables has been cursed.
 
@@ -1915,6 +1940,17 @@ to denote a capturing group of the form
 L<C<(?I<PARNO>)>|perlre/(?PARNO) (?-PARNO) (?+PARNO) (?R) (?0)>,
 but omitted the C<")">.
 
+=item Expecting '(?flags:(?[...' in regex; marked by <-- HERE in m/%s/
+
+(F) The C<(?[...])> extended character class regular expression construct
+only allows character classes (including character class escapes like
+C<\d>), operators, and parentheses.  The one exception is C<(?flags:...)>
+containing at least one flag and exactly one C<(?[...])> construct.
+This allows a regular expression containing just C<(?[...])> to be
+interpolated.  If you see this error message, then you probably
+have some other C<(?...)> construct inside your character class.  See
+L<perlrecharclass/Extended Bracketed Character Classes>.
+
 =item Experimental "%s" subs not enabled
 
 (F) To use lexical subs, you must first enable them:
@@ -1943,11 +1979,12 @@ queue of such routines has been prematurely ended.
 
 =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
+(W regexp)(F) 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
-"-", "\-".  The <-- HERE shows whereabouts in the regular expression the
-problem was discovered.  See L<perlre>.
+in your false range is interpreted as a literal "-".  In a C<(?[...])>
+construct, this is an error, rather than a warning.  Consider quoting
+the "-", "\-".  The <-- HERE shows whereabouts in the regular expression
+the problem was discovered.  See L<perlre>.
 
 =item Fatal VMS error (status=%d) at %s, line %d
 
@@ -2140,8 +2177,8 @@ has since been undefined.
 <-- HERE in m/%s/
 
 (F) Group names must follow the rules for perl identifiers, meaning
-they must start with a non-digit word character. A common cause of
-this error is using (?&0) instead of (?0). See L<perlre>.
+they must start with a non-digit word character.  A common cause of
+this error is using (?&0) instead of (?0).  See L<perlre>.
 
 =item ()-group starts with a count
 
@@ -2183,9 +2220,9 @@ of Perl are likely to eliminate these arbitrary limitations.
 
 =item Ignoring zero length \N{} in character class in regex; marked by <-- HERE in m/%s/
 
-(W regexp) Named Unicode character escapes C<(\N{...})> may return a zero-length
-sequence.  When such an escape is used in a character class its
-behaviour is not well defined.  Check that the correct escape has
+(W regexp) Named Unicode character escapes C<(\N{...})> may return a
+zero-length sequence.  When such an escape is used in a character class
+its behaviour is not well defined.  Check that the correct escape has
 been used, and the correct charname handler is in scope.
 
 =item Illegal binary digit %s
@@ -2200,8 +2237,10 @@ offending digit.
 
 =item Illegal character after '_' in prototype for %s : %s
 
-(W illegalproto) An illegal character was found in a prototype declaration.
-Legal characters in prototypes are $, @, %, *, ;, [, ], &, \, and +.
+(W illegalproto) An illegal character was found in a prototype
+declaration.  The '_' in a prototype must be followed by a ';',
+indicating the rest of the parameters are optional, or one of '@'
+or '%', since those two will accept 0 or more final parameters.
 
 =item Illegal character \%o (carriage return)
 
@@ -2315,15 +2354,12 @@ documentation in L<mro> for more information.
 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 Infinite recursion in regex; marked by <-- HERE in m/%s/
+=item Infinite recursion in regex
 
 (F) You used a pattern that references itself without consuming any input
 text.  You should check the pattern to ensure that recursive patterns
 either consume text or fail.
 
-The <-- HERE shows whereabouts in the regular expression the problem was
-discovered.
-
 =item Initialization of state variables in list context currently forbidden
 
 (F) Currently the implementation of "state" only permits the
@@ -2426,6 +2462,15 @@ L<perlvms/"exec LIST">).  Somehow, this count has become scrambled, so
 Perl is making a guess and treating this C<exec> as a request to
 terminate the Perl script and execute the specified command.
 
+=item internal %<num>p might conflict with future printf extensions
+
+(S internal) Perl's internal routine that handles C<printf> and C<sprintf>
+formatting follows a slightly different set of rules when called from
+C or XS code.  Specifically, formats consisting of digits followed
+by "p" (e.g., "%7p") are reserved for future use.  If you see this
+message, then an XS module tried to call that routine with one such
+reserved format.
+
 =item Internal urp in regex; marked by <-- HERE in m/%s/
 
 (P) Something went badly awry in the regular expression parser.  The
@@ -2578,7 +2623,7 @@ an arbitrary reference was blessed into the "version" class.
 (D regexp, deprecated) The two-character sequence C<"(*"> in
 this context in a regular expression pattern should be an
 indivisible token, with nothing intervening between the C<"(">
-and the C<"*">, but you separated them. Due to an accident of
+and the C<"*">, but you separated them.  Due to an accident of
 implementation, this prohibition was not enforced, but we do
 plan to forbid it in a future Perl version.  This message
 serves as giving you fair warning of this pending change.
@@ -2676,7 +2721,7 @@ effective uids or gids failed.
 length/code combination tried to obtain more data.  This results in
 an undefined value for the length.  See L<perlfunc/pack>.
 
-=item length() used on %s
+=item length() used on %s (did you mean "scalar(%s)"?)
 
 (W syntax) You used length() on either an array or a hash when you
 probably wanted a count of the items.
@@ -2766,6 +2811,12 @@ foo :lvalue;> declaration before the definition.
 
 See also L<attributes.pm|attributes>.
 
+=item Magical list constants are not supported
+
+(F) You assigned a magical array to a stash element, and then tried
+to use the subroutine from the same slot.  You are asking Perl to do
+something it cannot do, details subject to change between Perl versions.
+
 =item Malformed integer in [] in pack
 
 (F) Between the brackets enclosing a numeric repeat count only digits
@@ -2943,6 +2994,11 @@ they have a name with which they can be found.
 are always mentioned with the $ in Perl, unlike in the shells, where it
 can vary from one line to the next.
 
+=item Missing ']' in prototype for %s : %s
+
+(W illegalproto) A grouping was started with C<[> but never closed with
+C<]>.
+
 =item (Missing operator before %s?)
 
 (S syntax) This is an educated guess made in conjunction with the message
@@ -3037,6 +3093,14 @@ 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<perlfunc/open> for details.
 
+=item mprotect for %p %u failed with %d
+
+=item mprotect RW for %p %u failed with %d
+
+(S) You compiled perl with B<-D>PERL_DEBUG_READONLY_OPS (see
+L<perlhacktips>), but an op tree could not be made read-only, or a
+read-only op tree could not be made mutable before freeing the ops.
+
 =item msg%s not implemented
 
 (F) You don't have System V message IPC on your system.
@@ -3075,13 +3139,15 @@ local() if you want to localize a package variable.
 
 (W once) Typographical errors often show up as unique variable names.
 If you had a good reason for having a unique name, then just mention it
-again somehow to suppress the message.  The C<our> declaration is
-provided for this purpose.
+again somehow to suppress the message.  The C<our> 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.
+will not trigger this warning.  Symbols beginning with an underscore and
+symbols using special identifiers (q.v. L<perldata>) are exempt from this
+warning.
 
 =item Need exactly 3 octal digits in regex; marked by <-- HERE in m/%s/
 
@@ -3951,16 +4017,12 @@ knowledgeable people to determine what the type being checked against
 was.  If C<utf8> warnings are enabled, a further message is raised,
 giving details of the malformation.
 
-=item Pattern subroutine nesting without pos change exceeded limit in regex; 
-marked by <-- HERE in m/%s/
+=item Pattern subroutine nesting without pos change exceeded limit in regex
 
 (F) You used a pattern that uses too many nested subpattern calls without
 consuming any text.  Restructure the pattern so text is consumed before
 the nesting limit is exceeded.
 
-The <-- HERE shows whereabouts in the regular expression the problem was
-discovered.
-
 =item C<-p> destination: %s
 
 (F) An error occurred during the implicit output invoked by the C<-p>
@@ -3976,12 +4038,10 @@ that a method requires a package that has not been loaded.
 =item Perl folding rules are not up-to-date for 0x%X; please use the perlbug 
 utility to report; in regex; marked by <-- HERE in m/%s/
 
-(D regexp, deprecated) You used a regular expression with
-case-insensitive matching, and there is a bug in Perl in which the
-built-in regular expression folding rules are not accurate.  This
-may lead to incorrect results.  Please report this as a bug using the
-L<perlbug> utility.  (This message is marked deprecated, so that it by
-default will be turned-on.)
+(S regexp) You used a regular expression with case-insensitive matching,
+and there is a bug in Perl in which the built-in regular expression
+folding rules are not accurate.  This may lead to incorrect results.
+Please report this as a bug using the L<perlbug> utility.
 
 =item Perl_my_%s() not available
 
@@ -3999,7 +4059,7 @@ interpreted as a decimal, with every three digits after the
 decimal point representing a part of the version number.  So 5.10
 is equivalent to v5.100.
 
-=item Perl %s required--this is only version %s, stopped
+=item Perl %s required--this is only %s, stopped
 
 (F) The module in question uses features of a version of Perl more
 recent than the currently running version.  How long has it been since
@@ -4023,7 +4083,7 @@ wrong and the version check should just be removed.
 
 =item perl: warning: Non hex character in '$ENV{PERL_HASH_SEED}', seed only partially set
 
-(W) PERL_HASH_SEED should match /^\s*(?:0x)?[0-9a-fA-F]+\s*\z/ but it
+(S) PERL_HASH_SEED should match /^\s*(?:0x)?[0-9a-fA-F]+\s*\z/ but it
 contained a non hex character.  This could mean you are not using the
 hash seed you think you are.
 
@@ -4051,7 +4111,7 @@ L<perllocale> section B<LOCALE PROBLEMS>.
 
 =item perl: warning: strange setting in '$ENV{PERL_PERTURB_KEYS}': '%s'
 
-(W) Perl was run with the environment variable PERL_PERTURB_KEYS defined
+(S) Perl was run with the environment variable PERL_PERTURB_KEYS defined
 but containing an unexpected value.  The legal values of this setting
 are as follows.
 
@@ -4059,7 +4119,8 @@ are as follows.
   --------+---------------+-----------------------------------------
   0       | NO            | Disables key traversal randomization
   1       | RANDOM        | Enables full key traversal randomization
-  2       | DETERMINISTIC | Enables repeatable key traversal randomization
+  2       | DETERMINISTIC | Enables repeatable key traversal
+          |               | randomization
 
 Both numeric and string values are accepted, but note that string values are
 case sensitive.  The default for this setting is "RANDOM" or 1.
@@ -4466,7 +4527,7 @@ supposed to be there.
 (P) A "can't happen" error, because safemalloc() should have caught it
 earlier.
 
-=item Repeated format line will never terminate (~~ and @# incompatible)
+=item Repeated format line will never terminate (~~ and @#)
 
 (F) Your format contains the ~~ repeat-until-blank sequence and a
 numeric field that will never go blank so that the repetition never
@@ -4899,6 +4960,11 @@ assignment or as a subroutine argument for example).
 (P) Perl tried to force the upgrade of an SV to a type which was actually
 inferior to its current type.
 
+=item SWASHNEW didn't return an HV ref
+
+(P) Something went wrong internally when Perl was trying to look up
+Unicode characters.
+
 =item Switch (?(condition)... contains too many branches in regex; marked by 
 <-- HERE in m/%s/
 
@@ -5095,7 +5161,7 @@ target of the change to
 
 (F) Something has attempted to use an internal API call which
 depends on Perl being compiled with the default support for randomized hash
-key traversal, but this Perl has been compiled without it. You should
+key traversal, but this Perl has been compiled without it.  You should
 report this warning to the relevant upstream party, or recompile perl
 with default options.
 
@@ -5187,10 +5253,10 @@ Backslash it.   See L<perlre>.
 
 =item Trailing white-space in a charnames alias definition is deprecated
 
-(D) You defined a character name which ended in a space character.
-Remove the trailing space(s).  Usually these names are defined in the
-C<:alias> import argument to C<use charnames>, but they could be defined
-by a translator installed into C<$^H{charnames}>.
+(D deprecated) You defined a character name which ended in a space
+character.  Remove the trailing space(s).  Usually these names are
+defined in the C<:alias> import argument to C<use charnames>, but they
+could be defined by a translator installed into C<$^H{charnames}>.
 See L<charnames/CUSTOM ALIASES>.
 
 =item Transliteration pattern not terminated
@@ -5338,6 +5404,16 @@ enough to figure out what you really meant.
 (P) When compiling a subroutine call in lvalue context, Perl failed an
 internal consistency check.  It encountered a malformed op tree.
 
+=item Unexpected exit %u
+
+(S) exit() was called or the script otherwise finished gracefully when
+C<PERL_EXIT_WARN> was set in C<PL_exit_flags>.
+
+=item Unexpected exit failure %u
+
+(S) An uncaught die() was called when C<PERL_EXIT_WARN> was set in
+C<PL_exit_flags>.
+
 =item Unexpected ')' in regex; marked by <-- HERE in m/%s/
 
 (F) You had something like this:
@@ -5456,7 +5532,7 @@ discovered.  See L<perlre>.
 (F) You specified an unknown Unicode option.  See L<perlrun> documentation
 of the C<-C> switch for the list of known options.
 
-=item Unknown Unicode option value %x
+=item Unknown Unicode option value %d
 
 (F) You specified an unknown Unicode option.  See L<perlrun> documentation
 of the C<-C> switch for the list of known options.
@@ -5875,9 +5951,9 @@ used.  (This may change in the future.)
 
 =item Use of each() on hash after insertion without resetting hash iterator results in undefined behavior
 
-(S internal) The behavior of C<each()> after insertion is undefined; it may
-skip items, or visit items more than once. Consider using C<keys()> instead
-of C<each()>.
+(S internal) The behavior of C<each()> after insertion is undefined;
+it may skip items, or visit items more than once.  Consider using
+C<keys()> instead of C<each()>.
 
 =item Use of := for an empty attribute list is not allowed
 
@@ -5953,7 +6029,7 @@ only C.  This usually means there's a better way to do it in Perl.
 generally because there's a better way to do it, and also because the
 old way has bad side effects.
 
-=item Use of -l on filehandle %s
+=item Use of -l on filehandle%s
 
 (W io) A filehandle represents an opened file, and when you opened the file
 it already went past any symlink you are presumably trying to look for.