Reverse change #31978
[p5sagit/p5-mst-13.2.git] / pod / perldiag.pod
index e118220..1d2650f 100644 (file)
@@ -9,7 +9,7 @@ desperation):
 
     (W) A warning (optional).
     (D) A deprecation (optional).
-    (S) A severe warning (default).
+    (S) A severe warning (enabled by default).
     (F) A fatal error (trappable).
     (P) An internal error you should never see (trappable).
     (X) A very fatal error (nontrappable).
@@ -27,7 +27,7 @@ and B<-W> switches. Warnings may be captured by setting C<$SIG{__WARN__}>
 to a reference to a routine that will be called on each warning instead
 of printing it.  See L<perlvar>.
 
-Default warnings are always enabled unless they are explicitly disabled
+Severe warnings are always enabled, unless they are explicitly disabled
 with the C<warnings> pragma or the B<-X> switch.
 
 Trappable errors may be trapped using the eval operator.  See
@@ -282,6 +282,13 @@ invalid anytime, even before the end of the current statement.  Use
 literals or global values as arguments to the "p" pack() template to
 avoid this warning.
 
+=item Attempt to reload %s aborted.
+
+(F) You tried to load a file with C<use> or C<require> that failed to
+compile once already.  Perl will not try to compile this file again
+unless you delete its entry from %INC.  See L<perlfunc/require> and
+L<perlvar/%INC>.
+
 =item Attempt to set length of freed array
 
 (W) You tried to set the length of an array which has been freed.  You
@@ -606,13 +613,13 @@ quotas or other plumbing problems.
 =item Can't declare class for non-scalar %s in "%s"
 
 (F) Currently, only scalar variables can be declared with a specific
-class qualifier in a "my" or "our" declaration.  The semantics may be
+class qualifier in a "my", "our" or "state" declaration.  The semantics may be
 extended for other types of variables in future.
 
 =item Can't declare %s in "%s"
 
-(F) Only scalar, array, and hash variables may be declared as "my" or
-"our" variables.  They must have ordinary identifiers as names.
+(F) Only scalar, array, and hash variables may be declared as "my", "our" or
+"state" variables.  They must have ordinary identifiers as names.
 
 =item Can't do inplace edit: %s is not a regular file
 
@@ -848,7 +855,7 @@ extensions.
 =item Can't localize lexical variable %s
 
 (F) You used local on a variable name that was previously declared as a
-lexical variable using "my".  This is not allowed.  If you want to
+lexical variable using "my" or "state".  This is not allowed.  If you want to
 localize a package variable of the same name, qualify it with the
 package name.
 
@@ -1133,7 +1140,7 @@ allowed.  See L<perlfunc/pack>.
 (F) Only a simple scalar variable may be used as a loop variable on a
 foreach.
 
-=item Can't use global %s in "my"
+=item Can't use global %s in "%s"
 
 (F) You tried to declare a magical variable as a lexical variable.  This
 is not allowed, because the magic can be tied to only one location
@@ -1804,10 +1811,10 @@ L<perlfunc/getsockopt>.
 
 =item Global symbol "%s" requires explicit package name
 
-(F) You've said "use strict vars", which indicates that all variables
-must either be lexically scoped (using "my"), declared beforehand using
-"our", or explicitly qualified to say which package the global variable
-is in (using "::").
+(F) You've said "use strict" or "use strict vars", which indicates 
+that all variables must either be lexically scoped (using "my" or "state"), 
+declared beforehand using "our", or explicitly qualified to say 
+which package the global variable is in (using "::").
 
 =item glob failed (%s)
 
@@ -1881,7 +1888,7 @@ of Perl are likely to eliminate these arbitrary limitations.
 
 =item Ignoring %s in character class in regex; marked by <-- HERE in m/%s/
 
-(W) Named unicode character escapes (\N{...}) may return multi-char
+(W) Named Unicode character escapes (\N{...}) may return multi-char
 or zero length sequences. 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.
@@ -1999,6 +2006,13 @@ either consume text or fail.
 The <-- HERE shows in the regular expression about where the problem was
 discovered.
 
+=item Initialization of state variables in list context currently forbidden
+
+(F) Currently the implementation of "state" only permits the initialization
+of scalar variables in scalar context. Re-write C<state ($a) = 42> as
+C<state $a = 42> to change from list to scalar context. Constructions such
+as C<state (@a) = foo()> will be supported in a future perl release.
+
 =item Insecure dependency in %s
 
 (F) You tried to do something that the tainting mechanism didn't like.
@@ -2177,13 +2191,13 @@ neither as a system call or an ioctl call (SIOCATMARK).
 
 =item $* is no longer supported
 
-(D deprecated) The special variable C<$*>, deprecated in older perls, has
+(S deprecated, syntax) The special variable C<$*>, deprecated in older perls, has
 been removed as of 5.9.0 and is no longer supported. You should use the
 C<//m> and C<//s> regexp modifiers instead.
 
 =item $# is no longer supported
 
-(D deprecated) The special variable C<$#>, deprecated in older perls, has
+(S deprecated, syntax) The special variable C<$#>, deprecated in older perls, has
 been removed as of 5.9.3 and is no longer supported. You should use the
 printf/sprintf functions instead.
 
@@ -2493,7 +2507,7 @@ See L<perlfunc/pack>.
 (F) Lexically scoped subroutines are not yet implemented.  Don't try
 that yet.
 
-=item "my" variable %s can't be in a package
+=item "%s" variable %s can't be in a package
 
 (F) Lexically scoped variables aren't in a package, so it doesn't make
 sense to try to declare one with a package qualifier on the front.  Use
@@ -2680,7 +2694,7 @@ package has restricted the set of allowed keys using the L<fields> pragma.
 
 =item No such class %s
 
-(F) You provided a class qualifier in a "my" or "our" declaration, but
+(F) You provided a class qualifier in a "my", "our" or "state" declaration, but
 this class doesn't exist at this point in your program.
 
 =item No such pipe open
@@ -3206,7 +3220,7 @@ when you meant
 
     my ($foo, $bar) = @_;
 
-Remember that "my", "our", and "local" bind tighter than comma.
+Remember that "my", "our", "local" and "state" bind tighter than comma.
 
 =item C<-p> destination: %s
 
@@ -3556,6 +3570,13 @@ Doing so has no effect.
 (W internal) The internal sv_replace() function was handed a new SV with
 a reference count of other than 1.
 
+=item Reference to invalid group 0
+
+(F) You used C<\g0> or similar in a regular expression. You may refer to
+capturing parentheses only with strictly positive integers (normal
+backreferences) or with stricly negative integers (relative
+backreferences), but using 0 does not make sense.
+
 =item Reference to nonexistent group in regex; marked by <-- HERE in m/%s/
 
 (F) You used something like C<\7> in your regular expression, but there are
@@ -4403,11 +4424,11 @@ reserved word.  It's best to put such a word in quotes, or capitalize it
 somehow, or insert an underbar into it.  You might also declare it as a
 subroutine.
 
-=item Unrecognized character %s
+=item Unrecognized character %s in column %d
 
 (F) The Perl parser has no idea what to do with the specified character
-in your Perl script (or eval).  Perhaps you tried to run a compressed
-script, a binary program, or a directory as a Perl program.
+in your Perl script (or eval) at the specified column.  Perhaps you tried 
+to run a compressed script, a binary program, or a directory as a Perl program.
 
 =item Unrecognized escape \\%c in character class passed through in regex; marked by <-- HERE in m/%s/
 
@@ -4862,7 +4883,7 @@ known at compile time.  See L<perlre>.
 
 =item "%s" variable %s masks earlier declaration in same %s
 
-(W misc) A "my" or "our" variable has been redeclared in the current
+(W misc) A "my", "our" or "state" variable has been redeclared in the current
 scope or statement, effectively eliminating all access to the previous
 instance.  This is almost always a typographical error.  Note that the
 earlier variable will still exist until the end of the scope or until
@@ -5017,4 +5038,8 @@ Something Very Wrong.
 
 =back
 
+=head1 SEE ALSO
+
+L<warnings>, L<perllexwarn>.
+
 =cut