Add test for grep() and wantarray
[p5sagit/p5-mst-13.2.git] / pod / perldiag.pod
index 0f204a8..ec300c8 100644 (file)
@@ -96,11 +96,11 @@ sees what it knows to be a term when it was expecting to see an operator,
 it gives you this warning.  Usually it indicates that an operator or
 delimiter was omitted, such as a semicolon.
 
-=item %s had compilation errors.
+=item %s had compilation errors
 
 (F) The final summary message when a C<perl -c> fails.
 
-=item %s has too many errors.
+=item %s has too many errors
 
 (F) The parser has given up trying to parse the program after 10 errors.
 Further error messages would likely be uninformative.
@@ -119,19 +119,19 @@ before it could possibly have been used.
 
 (F) The final summary message when a C<perl -c> succeeds.
 
-=item %s: Command not found.
+=item %s: Command not found
 
 (A) You've accidentally run your script through B<csh> instead
 of Perl.  Check the E<lt>#!E<gt> line, or manually feed your script
 into Perl yourself.
 
-=item %s: Expression syntax.
+=item %s: Expression syntax
 
 (A) You've accidentally run your script through B<csh> instead
 of Perl.  Check the E<lt>#!E<gt> line, or manually feed your script
 into Perl yourself.
 
-=item %s: Undefined variable.
+=item %s: Undefined variable
 
 (A) You've accidentally run your script through B<csh> instead
 of Perl.  Check the E<lt>#!E<gt> line, or manually feed your script
@@ -195,7 +195,7 @@ a missing quote, operator, parenthesis pair or declaration.
 (F) The setuid emulator requires that the arguments Perl was invoked
 with match the arguments specified on the #! line.
 
-=item Argument "%s" isn't numeric
+=item Argument "%s" isn't numeric%s
 
 (W) The indicated string was fed as an argument to an operator that
 expected a numeric value instead.  If you're fortunate the message
@@ -342,30 +342,37 @@ the return value of your socket() call?  See L<perlfunc/bind>.
 (F) A subroutine invoked from an external package via perl_call_sv()
 exited by calling exit.
 
+=item Can't "goto" outside a block
+
+(F) A "goto" statement was executed to jump out of what might look
+like a block, except that it isn't a proper block.  This usually
+occurs if you tried to jump out of a sort() block or subroutine, which
+is a no-no.  See L<perlfunc/goto>.
+
 =item Can't "last" outside a block
 
 (F) A "last" statement was executed to break out of the current block,
 except that there's this itty bitty problem called there isn't a
 current block.  Note that an "if" or "else" block doesn't count as a
-"loopish" block.  You can usually double the curlies to get the same
-effect though, because the inner curlies will be considered a block
-that loops once.  See L<perlfunc/last>.
+"loopish" block, as doesn't a block given to sort().  You can usually double
+the curlies to get the same effect though, because the inner curlies
+will be considered a block that loops once.  See L<perlfunc/last>.
 
 =item Can't "next" outside a block
 
 (F) A "next" statement was executed to reiterate the current block, but
 there isn't a current block.  Note that an "if" or "else" block doesn't
-count as a "loopish" block.  You can usually double the curlies to get
-the same effect though, because the inner curlies will be considered a block
-that loops once.  See L<perlfunc/last>.
+count as a "loopish" block, as doesn't a block given to sort().  You can
+usually double the curlies to get the same effect though, because the inner
+curlies will be considered a block that loops once.  See L<perlfunc/last>.
 
 =item Can't "redo" outside a block
 
 (F) A "redo" statement was executed to restart the current block, but
 there isn't a current block.  Note that an "if" or "else" block doesn't
-count as a "loopish" block.  You can usually double the curlies to get
-the same effect though, because the inner curlies will be considered a block
-that loops once.  See L<perlfunc/last>.
+count as a "loopish" block, as doesn't a block given to sort().  You can
+usually double the curlies to get the same effect though, because the inner
+curlies will be considered a block that loops once.  See L<perlfunc/last>.
 
 =item Can't bless non-reference value
 
@@ -913,7 +920,7 @@ single form when it must operate on them directly.  Either you've
 passed an invalid file specification to Perl, or you've found a
 case the conversion routines don't handle.  Drat.
 
-=item Execution of %s aborted due to compilation errors.
+=item Execution of %s aborted due to compilation errors
 
 (F) The final summary message when a Perl compilation fails.
 
@@ -922,6 +929,12 @@ case the conversion routines don't handle.  Drat.
 (W) You are exiting an eval by unconventional means, such as
 a goto, or a loop control statement.
 
+=item Exiting pseudo-block via %s
+
+(W) You are exiting a rather special block construct (like a sort block or
+subroutine) by unconventional means, such as a goto, or a loop control
+statement.  See L<perlfunc/sort>.
+
 =item Exiting subroutine via %s
 
 (W) You are exiting a subroutine by unconventional means, such as
@@ -1065,6 +1078,13 @@ appear in %ENV.  This may be a benign occurrence, as some software packages
 might directly modify logical name tables and introduce non-standard names,
 or it may indicate that a logical name table has been corrupted.
 
+=item Illegal character %s (carriage return)
+
+(F) A carriage return character was found in the input.  This is an
+error, and not a warning, because carriage return characters can break
+here documents (e.g. C<print E<lt>E<lt>EOF;>).  Note that Perl always
+opens scripts in text mode, so this error should only occur in C<eval>.
+
 =item Illegal division by zero
 
 (F) You tried to divide a number by 0.  Either something was wrong in your
@@ -1304,6 +1324,18 @@ See L<perlsec>.
 allowed to have a comma between that and the following arguments.
 Otherwise it'd be just another one of the arguments.
 
+One possible cause for this is that you expected to have imported a
+constant to your name space with B<use> or B<import> while no such
+importing took place, it may for example be that your operating system
+does not support that particular constant. Hopefully you did use an
+explicit import list for the constants you expect to see, please see
+L<perlfunc/use> and L<perlfunc/import>. While an explicit import list
+would probably have caught this error earlier it naturally does not
+remedy the fact that your operating system still does not support that
+constant. Maybe you have a typo in the constants of the symbol import
+list of B<use> or B<import> or in the constant name at the line where
+this error was triggered?
+
 =item No command into which to pipe on command line
 
 (F) An error peculiar to VMS.  Perl handles its own command line redirection,
@@ -1986,7 +2018,7 @@ because the world might have written on it already.
 
 (W) You tried to do a shutdown on a closed socket.  Seems a bit superfluous.
 
-=item SIG%s handler "%s" not defined.
+=item SIG%s handler "%s" not defined
 
 (W) The signal handler named in %SIG doesn't, in fact, exist.  Perhaps you
 put it into the wrong package?
@@ -2064,7 +2096,7 @@ construct.  Remember that bracketing delimiters count nesting level.
 That is, the absolute value of the offset was larger than the length of
 the string.  See L<perlfunc/substr>.
 
-=item suidperl is no longer needed since...
+=item suidperl is no longer needed since %s
 
 (F) Your Perl was compiled with B<-D>SETUID_SCRIPTS_ARE_SECURE_NOW, but a
 version of the setuid emulator somehow got run anyway.
@@ -2136,7 +2168,7 @@ out from under another module inadvertently.  See L<perlvar/$[>.
 The function indicated isn't implemented on this architecture, according
 to the probings of Configure.
 
-=item The crypt() function is unimplemented due to excessive paranoia.
+=item The crypt() function is unimplemented due to excessive paranoia
 
 (F) Configure couldn't find the crypt() function on your machine,
 probably because your vendor didn't supply it, probably because they
@@ -2160,6 +2192,19 @@ you're not running on Unix.
 (F) There has to be at least one argument to syscall() to specify the
 system call to call, silly dilly.
 
+=item Too late for "B<-T>" option (try putting it first)
+
+(X) The #! line in a Perl script contains the B<-T> option, but Perl
+was not invoked with B<-T> in its argument list.  Due to the way Perl
+handles tainting, by the time Perl discovers a B<-T> in a script, it's
+too late to properly taint everything from the environment.  So Perl
+gives up.
+
+This error can usually be fixed by editing the "#!" line so that the
+B<-T> option is in the Perl program's first argument.  (Many operating
+systems that implement the "#!" feature only pick up one argument from
+it, so Perl has to get the rest on its own.)
+
 =item Too many ('s
 
 =item Too many )'s
@@ -2475,7 +2520,7 @@ reference variables in outer subroutines are called or referenced,
 they are automatically re-bound to the current values of such
 variables.
 
-=item Variable syntax.
+=item Variable syntax
 
 (A) You've accidentally run your script through B<csh> instead
 of Perl.  Check the E<lt>#!E<gt> line, or manually feed your script
@@ -2486,7 +2531,7 @@ into Perl yourself.
 (W) You passed warn() an empty string (the equivalent of C<warn "">) or
 you called it with no args and C<$_> was empty.
 
-=item Warning: unable to close filehandle %s properly.
+=item Warning: unable to close filehandle %s properly
 
 (S) The implicit close() done by an open() got an error indication on the
 close().  This usually indicates your file system ran out of disk space.