home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / MacPerl 5.1.3 / Mac_Perl_513_src / perl5.002 / lib / diagnostics.pm < prev    next >
Encoding:
Perl POD Document  |  1997-01-19  |  89.7 KB  |  2,752 lines  |  [TEXT/MPS ]

  1. #!/usr/local/bin/perl
  2. eval 'exec perl -S $0  ${1+"$@"}'
  3.     if 0;
  4.  
  5. use Config;
  6. if ($^O eq 'VMS') {
  7.    $diagnostics::PODFILE = VMS::Filespec::unixify($Config{'privlib'}) .
  8.                            '/pod/perldiag.pod';
  9. }
  10. else { $diagnostics::PODFILE= $Config{privlib} . "/pod/perldiag.pod"; }
  11.  
  12. package diagnostics;
  13. require 5.001;
  14. use English;
  15. use Carp;
  16.  
  17. =head1 NAME
  18.  
  19. diagnostics - Perl compiler pragma to force verbose warning diagnostics
  20.  
  21. splain - standalone program to do the same thing
  22.  
  23. =head1 SYNOPSIS
  24.  
  25. As a pragma:
  26.  
  27.     use diagnostics;
  28.     use diagnostics -verbose;
  29.  
  30.     enable  diagnostics;
  31.     disable diagnostics;
  32.  
  33. Aa a program:
  34.  
  35.     perl program 2>diag.out
  36.     splain [-v] [-p] diag.out
  37.  
  38.  
  39. =head1 DESCRIPTION
  40.  
  41. =head2 The C<diagnostics> Pragma
  42.  
  43. This module extends the terse diagnostics normally emitted by both the
  44. perl compiler and the perl interpeter, augmenting them wtih the more
  45. explicative and endearing descriptions found in L<perldiag>.  Like the
  46. other pragmata, it affects to compilation phase of your program rather
  47. than merely the execution phase.
  48.  
  49. To use in your program as a pragma, merely invoke
  50.  
  51.     use diagnostics;
  52.  
  53. at the start (or near the start) of your program.  (Note 
  54. that this I<does> enable perl's B<-w> flag.)  Your whole
  55. compilation will then be subject(ed :-) to the enhanced diagnostics.
  56. These still go out B<STDERR>.
  57.  
  58. Due to the interaction between runtime and compiletime issues,
  59. and because it's probably not a very good idea anyway,
  60. you may not use C<no diagnostics> to turn them off at compiletime.
  61. However, you may control there behaviour at runtime using the 
  62. disable() and enable() methods to turn them off and on respectively.
  63.  
  64. The B<-verbose> flag first prints out the L<perldiag> introduction before
  65. any other diagnostics.  The $diagnostics::PRETTY can generate nicer escape
  66. sequences for pgers.
  67.  
  68. =head2 The I<splain> Program
  69.  
  70. While apparently a whole nuther program, I<splain> is actually nothing
  71. more than a link to the (executable) F<diagnostics.pm> module, as well as
  72. a link to the F<diagnostics.pod> documentation.  The B<-v> flag is like
  73. the C<use diagnostics -verbose> directive.
  74. The B<-p> flag is like the
  75. $diagnostics::PRETTY variable.  Since you're post-processing with 
  76. I<splain>, there's no sense in being able to enable() or disable() processing.
  77.  
  78. Output from I<splain> is directed to B<STDOUT>, unlike the pragma.
  79.  
  80. =head1 EXAMPLES
  81.  
  82. The following file is certain to trigger a few errors at both
  83. runtime and compiletime:
  84.  
  85.     use diagnostics;
  86.     print NOWHERE "nothing\n";
  87.     print STDERR "\n\tThis message should be unadorned.\n";
  88.     warn "\tThis is a user warning";
  89.     print "\nDIAGNOSTIC TESTER: Please enter a <CR> here: ";
  90.     my $a, $b = scalar <STDIN>;
  91.     print "\n";
  92.     print $x/$y;
  93.  
  94. If you prefer to run your program first and look at its problem
  95. afterwards, do this:
  96.  
  97.     perl -w test.pl 2>test.out
  98.     ./splain < test.out
  99.  
  100. Note that this is not in general possible in shells of more dubious heritage, 
  101. as the theorectical 
  102.  
  103.     (perl -w test.pl >/dev/tty) >& test.out
  104.     ./splain < test.out
  105.  
  106. Because you just moved the existing B<stdout> to somewhere else.
  107.  
  108. If you don't want to modify your source code, but still have on-the-fly
  109. warnings, do this:
  110.  
  111.     exec 3>&1; perl -w test.pl 2>&1 1>&3 3>&- | splain 1>&2 3>&- 
  112.  
  113. Nifty, eh?
  114.  
  115. If you want to control warnings on the fly, do something like this.
  116. Make sure you do the C<use> first, or you won't be able to get
  117. at the enable() or disable() methods.
  118.  
  119.     use diagnostics; # checks entire compilation phase 
  120.     print "\ntime for 1st bogus diags: SQUAWKINGS\n";
  121.     print BOGUS1 'nada';
  122.     print "done with 1st bogus\n";
  123.  
  124.     disable diagnostics; # only turns off runtime warnings
  125.     print "\ntime for 2nd bogus: (squelched)\n";
  126.     print BOGUS2 'nada';
  127.     print "done with 2nd bogus\n";
  128.  
  129.     enable diagnostics; # turns back on runtime warnings
  130.     print "\ntime for 3rd bogus: SQUAWKINGS\n";
  131.     print BOGUS3 'nada';
  132.     print "done with 3rd bogus\n";
  133.  
  134.     disable diagnostics;
  135.     print "\ntime for 4th bogus: (squelched)\n";
  136.     print BOGUS4 'nada';
  137.     print "done with 4th bogus\n";
  138.  
  139. =head1 INTERNALS
  140.  
  141. Diagnostic messages derive from the F<perldiag.pod> file when available at
  142. runtime.  Otherwise, they may be embedded in the file itself when the
  143. splain package is built.   See the F<Makefile> for details.
  144.  
  145. If an extant $SIG{__WARN__} handler is discovered, it will continue
  146. to be honored, but only after the diagnostic::splainthis() function 
  147. (the module's $SIG{__WARN__} interceptor) has had its way with your
  148. warnings.
  149.  
  150. There is a $diagnostics::DEBUG variable you may set if you're desperately
  151. curious what sorts of things are being intercepted.
  152.  
  153.     BEGIN { $diagnostics::DEBUG = 1 } 
  154.  
  155.  
  156. =head1 BUGS
  157.  
  158. Not being able to say "no diagnostics" is annoying, but may not be
  159. insurmountable.
  160.  
  161. The C<-pretty> directive is called too late to affect matters.
  162. You have to to this instead, and I<before> you load the module.
  163.  
  164.     BEGIN { $diagnostics::PRETTY = 1 } 
  165.  
  166. I could start up faster by delaying compilation until it should be
  167. needed, but this gets a "panic: top_level"
  168. when using the pragma form in 5.001e.  
  169.  
  170. While it's true that this documentation is somewhat subserious, if you use
  171. a program named I<splain>, you should expect a bit of whimsy.
  172.  
  173. =head1 AUTHOR
  174.  
  175. Tom Christiansen F<E<lt>tchrist@mox.perl.comE<gt>>, 25 June 1995.
  176.  
  177. =cut
  178.  
  179. $DEBUG ||= 0;
  180. my $WHOAMI = ref bless [];  # nobody's business, prolly not even mine
  181.  
  182. $OUTPUT_AUTOFLUSH = 1;
  183.  
  184. local $_;
  185.  
  186. CONFIG: {
  187.     $opt_p = $opt_d = $opt_v = $opt_f = '';
  188.     %HTML_2_Troff = %HTML_2_Latin_1 = %HTML_2_ASCII_7 = ();  
  189.     %exact_duplicate = ();
  190.  
  191.     unless (caller) { 
  192.     $standalone++;
  193.     require Getopt::Std;
  194.     Getopt::Std::getopts('pdvf:') || die "Usage: $0 [-v] [-p] [-f splainpod]";
  195.     $PODFILE = $opt_f if $opt_f;
  196.     $DEBUG = 2 if $opt_d;
  197.     $VERBOSE = $opt_v;
  198.     $PRETTY = $opt_p;
  199.     } 
  200.     
  201.     if (open(POD_DIAG, $PODFILE)) {
  202.     warn "Happy happy podfile from real $PODFILE\n" if $DEBUG;
  203.     last CONFIG;
  204.     } 
  205.  
  206.     if (caller) {
  207.     INCPATH: {
  208.         if ($^O eq 'MacOS') {
  209.             for $file ( (map { /:$/ ? "$_$WHOAMI.pm" : "$_:$WHOAMI.pm" } @INC), $0) {
  210.             warn "Checking $file\n" if $DEBUG;
  211.             if (open(POD_DIAG, $file)) {
  212.                 while (<POD_DIAG>) {
  213.                 next unless /^__END__\s*# wish diag dbase were more accessible/;
  214.                 print STDERR "podfile is $file\n" if $DEBUG;
  215.                 last INCPATH;
  216.             }
  217.             }
  218.         }
  219.         } else {
  220.             for $file ( (map { "$_/$WHOAMI.pm" } @INC), $0) {
  221.             warn "Checking $file\n" if $DEBUG;
  222.             if (open(POD_DIAG, $file)) {
  223.                 while (<POD_DIAG>) {
  224.                 next unless /^__END__\s*# wish diag dbase were more accessible/;
  225.                 print STDERR "podfile is $file\n" if $DEBUG;
  226.                 last INCPATH;
  227.             }
  228.             }
  229.         }
  230.         }
  231.     }
  232.     } else { 
  233.     print STDERR "podfile is <DATA>\n" if $DEBUG;
  234.     *POD_DIAG = *main::DATA;
  235.     }
  236. }
  237. if (eof(POD_DIAG)) { 
  238.     die "couldn't find diagnostic data in $PODFILE @INC $0";
  239. }
  240.  
  241.  
  242. %HTML_2_Troff = (
  243.     'amp'    =>    '&',    #   ampersand
  244.     'lt'    =>    '<',    #   left chevron, less-than
  245.     'gt'    =>    '>',    #   right chevron, greater-than
  246.     'quot'    =>    '"',    #   double quote
  247.  
  248.     "Aacute"    =>    "A\\*'",    #   capital A, acute accent
  249.     # etc
  250.  
  251. );
  252.  
  253. %HTML_2_Latin_1 = (
  254.     'amp'    =>    '&',    #   ampersand
  255.     'lt'    =>    '<',    #   left chevron, less-than
  256.     'gt'    =>    '>',    #   right chevron, greater-than
  257.     'quot'    =>    '"',    #   double quote
  258.  
  259.     "Aacute"    =>    "\xC1"    #   capital A, acute accent
  260.  
  261.     # etc
  262. );
  263.  
  264. %HTML_2_ASCII_7 = (
  265.     'amp'    =>    '&',    #   ampersand
  266.     'lt'    =>    '<',    #   left chevron, less-than
  267.     'gt'    =>    '>',    #   right chevron, greater-than
  268.     'quot'    =>    '"',    #   double quote
  269.  
  270.     "Aacute"    =>    "A"    #   capital A, acute accent
  271.     # etc
  272. );
  273.  
  274. *HTML_Escapes = do {
  275.     if ($standalone) {
  276.     $PRETTY ? \%HTML_2_Latin_1 : \%HTML_2_ASCII_7; 
  277.     } else {
  278.     \%HTML_2_Latin_1; 
  279.     }
  280. }; 
  281.  
  282. *THITHER = $standalone ? *STDOUT : *STDERR;
  283.  
  284. $transmo = <<EOFUNC;
  285. sub transmo {
  286.     local \$^W = 0;  # recursive warnings we do NOT need!
  287.     study;
  288. EOFUNC
  289.  
  290. ### sub finish_compilation {  # 5.001e panic: top_level for embedded version
  291.     print STDERR "FINISHING COMPILATION for $_\n" if $DEBUG;
  292.     ### local 
  293.     $RS = '';
  294.     local $_;
  295.     while (<POD_DIAG>) {
  296.     #s/(.*)\n//;
  297.     #$header = $1;
  298.  
  299.     unescape();
  300.     if ($PRETTY) {
  301.         sub noop   { return $_[0] }  # spensive for a noop
  302.         sub bold   { my $str =$_[0];  $str =~ s/(.)/$1\b$1/g; return $str; } 
  303.         sub italic { my $str = $_[0]; $str =~ s/(.)/_\b$1/g;  return $str; } 
  304.         s/[BC]<(.*?)>/bold($1)/ges;
  305.         s/[LIF]<(.*?)>/italic($1)/ges;
  306.     } else {
  307.         s/[BC]<(.*?)>/$1/gs;
  308.         s/[LIF]<(.*?)>/$1/gs;
  309.     } 
  310.     unless (/^=/) {
  311.         if (defined $header) { 
  312.         if ( $header eq 'DESCRIPTION' && 
  313.             (   /Optional warnings are enabled/ 
  314.              || /Some of these messages are generic./
  315.             ) )
  316.         {
  317.             next;
  318.         } 
  319.         s/^/    /gm;
  320.         $msg{$header} .= $_;
  321.         }
  322.         next;
  323.     } 
  324.     unless ( s/=item (.*)\s*\Z//) {
  325.  
  326.         if ( s/=head1\sDESCRIPTION//) {
  327.         $msg{$header = 'DESCRIPTION'} = '';
  328.         }
  329.         next;
  330.     }
  331.     $header = $1;
  332.  
  333.     if ($header =~ /%[sd]/) {
  334.         $rhs = $lhs = $header;
  335.         #if ($lhs =~ s/(.*?)%d(?!%d)(.*)/\Q$1\E\\d+\Q$2\E\$/g)  {
  336.         if ($lhs =~ s/(.*?)%d(?!%d)(.*)/\Q$1\E\\d+\Q$2\E/g)  {
  337.         $lhs =~ s/\\%s/.*?/g;
  338.         } else {
  339.         # if i had lookbehind negations, i wouldn't have to do this \377 noise
  340.         $lhs =~ s/(.*?)%s/\Q$1\E.*?\377/g;
  341.         #$lhs =~ s/\377([^\377]*)$/\Q$1\E\$/;
  342.         $lhs =~ s/\377([^\377]*)$/\Q$1\E/;
  343.         $lhs =~ s/\377//g;
  344.         } 
  345.         $transmo .= "    s{^$lhs}\n     {\Q$rhs\E}\n\t&& return 1;\n";
  346.     } else {
  347.         $transmo .= "    m{^\Q$header\E} && return 1;\n";
  348.     } 
  349.  
  350.     print STDERR "Already saw $header" if $msg{$header};
  351.  
  352.     $msg{$header} = '';
  353.     } 
  354.  
  355.  
  356.     close POD_DIAG unless *main::DATA eq *POD_DIAG;
  357.  
  358.     die "No diagnostics?" unless %msg;
  359.  
  360.     $transmo .= "    return 0;\n}\n";
  361.     print STDERR $transmo if $DEBUG;
  362.     eval $transmo;
  363.     die $@ if $@;
  364.     $RS = "\n";
  365. ### }
  366.  
  367. if ($standalone) {
  368.     if (!@ARGV and -t STDIN) { print STDERR "$0: Reading from STDIN\n" } 
  369.     while ($error = <>) {
  370.     splainthis($error) || print THITHER $error;
  371.     } 
  372.     exit;
  373. } else { 
  374.     $old_w = 0; $oldwarn = ''; $olddie = '';
  375. }
  376.  
  377. sub import {
  378.     shift;
  379.     $old_w = $^W;
  380.     $^W = 1; # yup, clobbered the global variable; tough, if you
  381.          # want diags, you want diags.
  382.     return if $SIG{__WARN__} eq \&warn_trap;
  383.  
  384.     for (@_) {
  385.  
  386.     /^-d(ebug)?$/            && do {
  387.                     $DEBUG++;
  388.                     next;
  389.                    };
  390.  
  391.     /^-v(erbose)?$/     && do {
  392.                     $VERBOSE++;
  393.                     next;
  394.                    };
  395.  
  396.     /^-p(retty)?$/         && do {
  397.                     print STDERR "$0: I'm afraid it's too late for prettiness.\n";
  398.                     $PRETTY++;
  399.                     next;
  400.                    };
  401.  
  402.     warn "Unknown flag: $_";
  403.     } 
  404.  
  405.     $oldwarn = $SIG{__WARN__};
  406.     $olddie = $SIG{__DIE__};
  407.     $SIG{__WARN__} = \&warn_trap;
  408.     $SIG{__DIE__} = \&death_trap;
  409.  
  410. sub enable { &import }
  411.  
  412. sub disable {
  413.     shift;
  414.     $^W = $old_w;
  415.     return unless $SIG{__WARN__} eq \&warn_trap;
  416.     $SIG{__WARN__} = $oldwarn;
  417.     $SIG{__DIE__} = $olddie;
  418.  
  419. sub warn_trap {
  420.     my $warning = $_[0];
  421.     if (caller eq $WHOAMI or !splainthis($warning)) {
  422.     print STDERR $warning;
  423.     } 
  424.     &$oldwarn if defined $oldwarn and $oldwarn and $oldwarn ne \&warn_trap;
  425. };
  426.  
  427. sub death_trap {
  428.     my $exception = $_[0];
  429.     splainthis($exception);
  430.     if (caller eq $WHOAMI) { print STDERR "INTERNAL EXCEPTION: $exception"; } 
  431.     &$olddie if defined $olddie and $olddie and $olddie ne \&death_trap;
  432.     $SIG{__DIE__} = $SIG{__WARN__} = '';
  433.     local($Carp::CarpLevel) = 1;
  434.     confess "Uncaught exception from user code:\n\t$exception";
  435.     # up we go; where we stop, nobody knows, but i think we die now
  436.     # but i'm deeply afraid of the &$olddie guy reraising and us getting
  437.     # into an indirect recursion loop
  438. };
  439.  
  440. sub splainthis {
  441.     local $_ = shift;
  442.     ### &finish_compilation unless %msg;
  443.     s/\.?\n+$//;
  444.     my $orig = $_;
  445.     # return unless defined;
  446.     if ($exact_duplicate{$_}++) {
  447.     return 1;
  448.     } 
  449.     if ($^O eq 'MacOS') {
  450.         s/^# //gm;
  451.        s/.?\s*\nFile \'(.*?)\'; Line (\d+)/ at $1 line $2/mi;
  452.     }
  453.     s/, <.*?> (?:line|chunk).*$//;
  454.     $real = s/(.*?) at .*? (?:line|chunk) \d+.*/$1/;
  455.     s/^\((.*)\)$/$1/;
  456.     return 0 unless &transmo;
  457.     $orig = shorten($orig);
  458.     if ($old_diag{$_}) {
  459.     autodescribe();
  460.     if ($^O eq 'MacOS') {
  461.         print THITHER "$orig # (#$old_diag{$_})\n";
  462.     } else {
  463.         print THITHER "$orig (#$old_diag{$_})\n";
  464.     }
  465.     $wantspace = 1;
  466.     } else {
  467.     autodescribe();
  468.     $old_diag{$_} = ++$count;
  469.     print THITHER "\n" if $wantspace;
  470.     $wantspace = 0;
  471.     if ($^O eq 'MacOS') {
  472.         print THITHER "$orig # (#$old_diag{$_})\n";
  473.     } else {
  474.         print THITHER "$orig (#$old_diag{$_})\n";
  475.     }
  476.     if ($msg{$_}) {
  477.         print THITHER $msg{$_};
  478.     } else {
  479.         if (0 and $standalone) { 
  480.         print THITHER "    **** Error #$old_diag{$_} ",
  481.             ($real ? "is" : "appears to be"),
  482.             " an unknown diagnostic message.\n\n";
  483.         }
  484.         return 0;
  485.     } 
  486.     }
  487.     return 1;
  488.  
  489. sub autodescribe {
  490.     if ($VERBOSE and not $count) {
  491.     print THITHER &{$PRETTY ? \&bold : \&noop}("DESCRIPTION OF DIAGNOSTICS"),
  492.         "\n$msg{DESCRIPTION}\n";
  493.     } 
  494.  
  495. sub unescape { 
  496.     s {
  497.             E<  
  498.             ( [A-Za-z]+ )       
  499.             >   
  500.     } { 
  501.          do {   
  502.              exists $HTML_Escapes{$1}
  503.                 ? do { $HTML_Escapes{$1} }
  504.                 : do {
  505.                     warn "Unknown escape: $& in $_";
  506.                     "E<$1>";
  507.                 } 
  508.          } 
  509.     }egx;
  510. }
  511.  
  512. sub shorten {
  513.     my $line = $_[0];
  514.     if (length $line > 79) {
  515.     my $space_place = rindex($line, ' ', 79);
  516.     if ($space_place != -1) {
  517.         substr($line, $space_place, 1) = "\n\t";
  518.     } 
  519.     } 
  520.     return $line;
  521.  
  522.  
  523. # have to do this: RS isn't set until run time, but we're executing at compile time
  524. $RS = "\n";
  525.  
  526. 1 unless $standalone;  # or it'll complain about itself
  527. __END__ # wish diag dbase were more accessible
  528. =head1 NAME
  529.  
  530. perldiag - various Perl diagnostics
  531.  
  532. =head1 DESCRIPTION
  533.  
  534. These messages are classified as follows (listed in increasing order of
  535. desperation):
  536.  
  537.     (W) A warning (optional).
  538.     (D) A deprecation (optional).
  539.     (S) A severe warning (mandatory).
  540.     (F) A fatal error (trappable).
  541.     (P) An internal error you should never see (trappable).
  542.     (X) A very fatal error (non-trappable).
  543.     (A) An alien error message (not generated by Perl).
  544.  
  545. Optional warnings are enabled by using the B<-w> switch.  Warnings may
  546. be captured by setting C<$^Q> to a reference to a routine that will be
  547. called on each warning instead of printing it.  See L<perlvar>.
  548. Trappable errors may be trapped using the eval operator.  See
  549. L<perlfunc/eval>.
  550.  
  551. Some of these messages are generic.  Spots that vary are denoted with a %s,
  552. just as in a printf format.  Note that some message start with a %s!
  553. The symbols C<"%-?@> sort before the letters, while C<[> and C<\> sort after.
  554.  
  555. =over 4
  556.  
  557. =item "my" variable %s can't be in a package
  558.  
  559. (F) Lexically scoped variables aren't in a package, so it doesn't make sense
  560. to try to declare one with a package qualifier on the front.  Use local()
  561. if you want to localize a package variable.
  562.  
  563. =item "no" not allowed in expression
  564.  
  565. (F) The "no" keyword is recognized and executed at compile time, and returns
  566. no useful value.  See L<perlmod>.
  567.  
  568. =item "use" not allowed in expression
  569.  
  570. (F) The "use" keyword is recognized and executed at compile time, and returns
  571. no useful value.  See L<perlmod>.
  572.  
  573. =item % may only be used in unpack
  574.  
  575. (F) You can't pack a string by supplying a checksum, since the
  576. checksumming process loses information, and you can't go the other
  577. way.  See L<perlfunc/unpack>.
  578.  
  579. =item %s (...) interpreted as function
  580.  
  581. (W) You've run afoul of the rule that says that any list operator followed
  582. by parentheses turns into a function, with all the list operators arguments 
  583. found inside the parens.  See L<perlop/Terms and List Operators (Leftward)>.
  584.  
  585. =item %s argument is not a HASH element
  586.  
  587. (F) The argument to delete() or exists() must be a hash element, such as
  588.  
  589.     $foo{$bar}
  590.     $ref->[12]->{"susie"}
  591.  
  592. =item %s did not return a true value
  593.  
  594. (F) A required (or used) file must return a true value to indicate that
  595. it compiled correctly and ran its initialization code correctly.  It's
  596. traditional to end such a file with a "1;", though any true value would
  597. do.  See L<perlfunc/require>.
  598.  
  599. =item %s found where operator expected
  600.  
  601. (S) The Perl lexer knows whether to expect a term or an operator.  If it
  602. sees what it knows to be a term when it was expecting to see an operator,
  603. it gives you this warning.  Usually it indicates that an operator or
  604. delimiter was omitted, such as a semicolon.
  605.  
  606. =item %s had compilation errors.
  607.  
  608. (F) The final summary message when a C<perl -c> fails.
  609.  
  610. =item %s has too many errors.
  611.  
  612. (F) The parser has given up trying to parse the program after 10 errors.
  613. Further error messages would likely be uninformative.
  614.  
  615. =item %s matches null string many times
  616.  
  617. (W) The pattern you've specified would be an infinite loop if the
  618. regular expression engine didn't specifically check for that.  See L<perlre>.
  619.  
  620. =item %s never introduced
  621.  
  622. (S) The symbol in question was declared but somehow went out of scope
  623. before it could possibly have been used.
  624.  
  625. =item %s syntax OK
  626.  
  627. (F) The final summary message when a C<perl -c> succeeds.
  628.  
  629. =item %s: Command not found.
  630.  
  631. (A) You've accidentally run your script through B<csh> instead
  632. of Perl.  Check the <#!> line, or manually feed your script
  633. into Perl yourself.
  634.  
  635. =item %s: Expression syntax.
  636.  
  637. (A) You've accidentally run your script through B<csh> instead
  638. of Perl.  Check the <#!> line, or manually feed your script
  639. into Perl yourself.
  640.  
  641. =item %s: Undefined variable.
  642.  
  643. (A) You've accidentally run your script through B<csh> instead
  644. of Perl.  Check the <#!> line, or manually feed your script
  645. into Perl yourself.
  646.  
  647. =item %s: not found
  648.  
  649. (A) You've accidentally run your script through the Bourne shell 
  650. instead of Perl.  Check the <#!> line, or manually feed your script
  651. into Perl yourself.
  652.  
  653. =item B<-P> not allowed for setuid/setgid script
  654.  
  655. (F) The script would have to be opened by the C preprocessor by name,
  656. which provides a race condition that breaks security.
  657.  
  658. =item C<-T> and C<-B> not implemented on filehandles
  659.  
  660. (F) Perl can't peek at the stdio buffer of filehandles when it doesn't
  661. know about your kind of stdio.  You'll have to use a filename instead.
  662.  
  663. =item 500 Server error
  664.  
  665. See Server error.
  666.  
  667. =item ?+* follows nothing in regexp
  668.  
  669. (F) You started a regular expression with a quantifier.  Backslash it
  670. if you meant it literally.   See L<perlre>.
  671.  
  672. =item @ outside of string
  673.  
  674. (F) You had a pack template that specified an absolution position outside
  675. the string being unpacked.  See L<perlfunc/pack>.
  676.  
  677. =item accept() on closed fd
  678.  
  679. (W) You tried to do an accept on a closed socket.  Did you forget to check
  680. the return value of your socket() call?  See L<perlfunc/accept>.
  681.  
  682. =item Allocation too large: %lx
  683.  
  684. (F) You can't allocate more than 64K on an MSDOS machine.
  685.  
  686. =item Arg too short for msgsnd
  687.  
  688. (F) msgsnd() requires a string at least as long as sizeof(long).
  689.  
  690. =item Ambiguous use of %s resolved as %s
  691.  
  692. (W)(S) You said something that may not be interpreted the way
  693. you thought.  Normally it's pretty easy to disambiguate it by supplying
  694. a missing quote, operator, paren pair or declaration.
  695.  
  696. =item Args must match #! line
  697.  
  698. (F) The setuid emulator requires that the arguments Perl was invoked
  699. with match the arguments specified on the #! line.
  700.  
  701. =item Argument "%s" isn't numeric
  702.  
  703. (W) The indicated string was fed as an argument to an operator that
  704. expected a numeric value instead.  If you're fortunate the message
  705. will identify which operator was so unfortunate.
  706.  
  707. =item Array @%s missing the @ in argument %d of %s()
  708.  
  709. (D) Really old Perl let you omit the @ on array names in some spots.  This
  710. is now heavily deprecated.
  711.  
  712. =item assertion botched: %s
  713.  
  714. (P) The malloc package that comes with Perl had an internal failure.
  715.  
  716. =item Assertion failed: file "%s"
  717.  
  718. (P) A general assertion failed.  The file in question must be examined.
  719.  
  720. =item Assignment to both a list and a scalar
  721.  
  722. (F) If you assign to a conditional operator, the 2nd and 3rd arguments
  723. must either both be scalars or both be lists.  Otherwise Perl won't
  724. know which context to supply to the right side.
  725.  
  726. =item Attempt to free non-arena SV: 0x%lx
  727.  
  728. (P) All SV objects are supposed to be allocated from arenas that will
  729. be garbage collected on exit.  An SV was discovered to be outside any
  730. of those arenas.
  731.  
  732. =item Attempt to free temp prematurely
  733.  
  734. (W) Mortalized values are supposed to be freed by the free_tmps()
  735. routine.  This indicates that something else is freeing the SV before
  736. the free_tmps() routine gets a chance, which means that the free_tmps()
  737. routine will be freeing an unreferenced scalar when it does try to free
  738. it.
  739.  
  740. =item Attempt to free unreferenced glob pointers
  741.  
  742. (P) The reference counts got screwed up on symbol aliases.
  743.  
  744. =item Attempt to free unreferenced scalar
  745.  
  746. (W) Perl went to decrement the reference count of a scalar to see if it
  747. would go to 0, and discovered that it had already gone to 0 earlier,
  748. and should have been freed, and in fact, probably was freed.  This
  749. could indicate that SvREFCNT_dec() was called too many times, or that
  750. SvREFCNT_inc() was called too few times, or that the SV was mortalized
  751. when it shouldn't have been, or that memory has been corrupted.
  752.  
  753. =item Bad arg length for %s, is %d, should be %d
  754.  
  755. (F) You passed a buffer of the wrong size to one of msgctl(), semctl() or
  756. shmctl().  In C parlance, the correct sized are, respectively,
  757. S<sizeof(struct msqid_ds *)>, S<sizeof(struct semid_ds *)> and
  758. S<sizeof(struct shmid_ds *)>.
  759.  
  760. =item Bad associative array
  761.  
  762. (P) One of the internal hash routines was passed a null HV pointer.
  763.  
  764. =item Bad filehandle: %s
  765.  
  766. (F) A symbol was passed to something wanting a filehandle, but the symbol
  767. has no filehandle associated with it.  Perhaps you didn't do an open(), or
  768. did it in another package.
  769.  
  770. =item Bad free() ignored
  771.  
  772. (S) An internal routine called free() on something that had never been
  773. malloc()ed in the first place.
  774.  
  775. =item Bad name after %s::
  776.  
  777. (F) You started to name a symbol by using a package prefix, and then didn't
  778. finish the symbol.  In particular, you can't interpolate outside of quotes,
  779. so
  780.  
  781.     $var = 'myvar';
  782.     $sym = mypack::$var;
  783.  
  784. is not the same as
  785.  
  786.     $var = 'myvar';
  787.     $sym = "mypack::$var";
  788.  
  789. =item Bad symbol for array
  790.  
  791. (P) An internal request asked to add an array entry to something that
  792. wasn't a symbol table entry.
  793.  
  794. =item Bad symbol for filehandle
  795.  
  796. (P) An internal request asked to add a filehandle entry to something that
  797. wasn't a symbol table entry.
  798.  
  799. =item Bad symbol for hash
  800.  
  801. (P) An internal request asked to add a hash entry to something that
  802. wasn't a symbol table entry.
  803.  
  804. =item Badly places ()'s
  805.  
  806. (A) You've accidentally run your script through B<csh> instead
  807. of Perl.  Check the <#!> line, or manually feed your script
  808. into Perl yourself.
  809.  
  810. =item BEGIN failed--compilation aborted
  811.  
  812. (F) An untrapped exception was raised while executing a BEGIN subroutine.
  813. Compilation stops immediately and the interpreter is exited.
  814.  
  815. =item bind() on closed fd
  816.  
  817. (W) You tried to do a bind on a closed socket.  Did you forget to check
  818. the return value of your socket() call?  See L<perlfunc/bind>.
  819.  
  820. =item Bizarre copy of %s in %s
  821.  
  822. (P) Perl detected an attempt to copy an internal value that is not copiable.
  823.  
  824. =item Callback called exit
  825.  
  826. (F) A subroutine invoked from an external package via perl_call_sv()
  827. exited by calling exit.
  828.  
  829. =item Can't "last" outside a block
  830.  
  831. (F) A "last" statement was executed to break out of the current block,
  832. except that there's this itty bitty problem called there isn't a
  833. current block.  Note that an "if" or "else" block doesn't count as a
  834. "loopish" block.  You can usually double the curlies to get the same
  835. effect though, since the inner curlies will be considered a block
  836. that loops once.  See L<perlfunc/last>.
  837.  
  838. =item Can't "next" outside a block
  839.  
  840. (F) A "next" statement was executed to reiterate the current block, but
  841. there isn't a current block.  Note that an "if" or "else" block doesn't
  842. count as a "loopish" block.  You can usually double the curlies to get
  843. the same effect though, since the inner curlies will be considered a block
  844. that loops once.  See L<perlfunc/last>.
  845.  
  846. =item Can't "redo" outside a block
  847.  
  848. (F) A "redo" statement was executed to restart the current block, but
  849. there isn't a current block.  Note that an "if" or "else" block doesn't
  850. count as a "loopish" block.  You can usually double the curlies to get
  851. the same effect though, since the inner curlies will be considered a block
  852. that loops once.  See L<perlfunc/last>.
  853.  
  854. =item Can't bless non-reference value
  855.  
  856. (F) Only hard references may be blessed.  This is how Perl "enforces"
  857. encapsulation of objects.  See L<perlobj>.
  858.  
  859. =item Can't break at that line
  860.  
  861. (S) A warning intended for while running within the debugger, indicating
  862. the line number specified wasn't the location of a statement that could
  863. be stopped at.
  864.  
  865. =item Can't call method "%s" in empty package "%s"
  866.  
  867. (F) You called a method correctly, and it correctly indicated a package
  868. functioning as a class, but that package doesn't have ANYTHING defined
  869. in it, let alone methods.  See L<perlobj>.
  870.  
  871. =item Can't call method "%s" on unblessed reference
  872.  
  873. (F) A method call must know what package it's supposed to run in.  It
  874. ordinarily finds this out from the object reference you supply, but
  875. you didn't supply an object reference in this case.  A reference isn't
  876. an object reference until it has been blessed.  See L<perlobj>.
  877.  
  878. =item Can't call method "%s" without a package or object reference
  879.  
  880. (F) You used the syntax of a method call, but the slot filled by the
  881. object reference or package name contains an expression that returns
  882. neither an object reference nor a package name.  (Perhaps it's null?)
  883. Something like this will reproduce the error:
  884.  
  885.     $BADREF = undef;
  886.     process $BADREF 1,2,3;
  887.     $BADREF->process(1,2,3);
  888.  
  889. =item Can't chdir to %s
  890.  
  891. (F) You called C<perl -x/foo/bar>, but C</foo/bar> is not a directory
  892. that you can chdir to, possibly because it doesn't exist.
  893.  
  894. =item Can't coerce %s to integer in %s
  895.  
  896. (F) Certain types of SVs, in particular real symbol table entries
  897. (type GLOB), can't be forced to stop being what they are.  So you can't
  898. say things like:
  899.  
  900.     *foo += 1;
  901.  
  902. You CAN say
  903.  
  904.     $foo = *foo;
  905.     $foo += 1;
  906.  
  907. but then $foo no longer contains a glob.
  908.  
  909. =item Can't coerce %s to number in %s
  910.  
  911. (F) Certain types of SVs, in particular real symbol table entries
  912. (type GLOB), can't be forced to stop being what they are.
  913.  
  914. =item Can't coerce %s to string in %s
  915.  
  916. (F) Certain types of SVs, in particular real symbol table entries
  917. (type GLOB), can't be forced to stop being what they are.
  918.  
  919. =item Can't create pipe mailbox
  920.  
  921. (P) An error peculiar to VMS.  The process is suffering from exhausted quotas
  922. or other plumbing problems.
  923.  
  924. =item Can't declare %s in my
  925.  
  926. (F) Only scalar, array and hash variables may be declared as lexical variables.
  927. They must have ordinary identifiers as names.
  928.  
  929. =item Can't do inplace edit on %s: %s
  930.  
  931. (S) The creation of the new file failed for the indicated reason.
  932.  
  933. =item Can't do inplace edit without backup
  934.  
  935. (F) You're on a system such as MSDOS that gets confused if you try reading
  936. from a deleted (but still opened) file.  You have to say B<-i>C<.bak>, or some
  937. such.
  938.  
  939. =item Can't do inplace edit: %s > 14 characters
  940.  
  941. (S) There isn't enough room in the filename to make a backup name for the file.
  942.  
  943. =item Can't do inplace edit: %s is not a regular file
  944.  
  945. (S) You tried to use the B<-i> switch on a special file, such as a file in
  946. /dev, or a FIFO.  The file was ignored.
  947.  
  948. =item Can't do setegid!
  949.  
  950. (P) The setegid() call failed for some reason in the setuid emulator
  951. of suidperl.
  952.  
  953. =item Can't do seteuid!
  954.  
  955. (P) The setuid emulator of suidperl failed for some reason.
  956.  
  957. =item Can't do setuid
  958.  
  959. (F) This typically means that ordinary perl tried to exec suidperl to
  960. do setuid emulation, but couldn't exec it.  It looks for a name of the
  961. form sperl5.000 in the same directory that the perl executable resides
  962. under the name perl5.000, typically /usr/local/bin on Unix machines.
  963. If the file is there, check the execute permissions.  If it isn't, ask
  964. your sysadmin why he and/or she removed it.
  965.  
  966. =item Can't do waitpid with flags
  967.  
  968. (F) This machine doesn't have either waitpid() or wait4(), so only waitpid()
  969. without flags is emulated.
  970.  
  971. =item Can't do {n,m} with n > m
  972.  
  973. (F) Minima must be less than or equal to maxima.  If you really want
  974. your regexp to match something 0 times, just put {0}.  See L<perlre>.
  975.  
  976. =item Can't emulate -%s on #! line
  977.  
  978. (F) The #! line specifies a switch that doesn't make sense at this point.
  979. For example, it'd be kind of silly to put a B<-x> on the #! line.
  980.  
  981. =item Can't exec "%s": %s
  982.  
  983. (W) An system(), exec() or piped open call could not execute the named
  984. program for the indicated reason.  Typical reasons include: the permissions
  985. were wrong on the file, the file wasn't found in C<$ENV{PATH}>, the
  986. executable in question was compiled for another architecture, or the
  987. #! line in a script points to an interpreter that can't be run for
  988. similar reasons.  (Or maybe your system doesn't support #! at all.)
  989.  
  990. =item Can't exec %s
  991.  
  992. (F) Perl was trying to execute the indicated program for you because that's
  993. what the #! line said.  If that's not what you wanted, you may need to
  994. mention "perl" on the #! line somewhere.
  995.  
  996. =item Can't execute %s
  997.  
  998. (F) You used the B<-S> switch, but the script to execute could not be found
  999. in the PATH, or at least not with the correct permissions.
  1000.  
  1001. =item Can't find label %s
  1002.  
  1003. (F) You said to goto a label that isn't mentioned anywhere that it's possible
  1004. for us to go to.  See L<perlfunc/goto>.
  1005.  
  1006. =item Can't find string terminator %s anywhere before EOF
  1007.  
  1008. (F) Perl strings can stretch over multiple lines.  This message means that
  1009. the closing delimiter was omitted.  Since bracketed quotes count nesting
  1010. levels, the following is missing its final parenthesis:
  1011.  
  1012.     print q(The character '(' starts a side comment.)
  1013.  
  1014. =item Can't fork
  1015.  
  1016. (F) A fatal error occurred while trying to fork while opening a pipeline.
  1017.  
  1018. =item Can't get filespec - stale stat buffer?
  1019.  
  1020. (S) A warning peculiar to VMS.  This arises because of the difference between
  1021. access checks under VMS and under the Unix model Perl assumes.  Under VMS,
  1022. access checks are done by filename, rather than by bits in the stat buffer, so
  1023. that ACLs and other protections can be taken into account.  Unfortunately, Perl
  1024. assumes that the stat buffer contains all the necessary information, and passes
  1025. it, instead of the filespec, to the access checking routine.  It will try to
  1026. retrieve the filespec using the device name and FID present in the stat buffer,
  1027. but this works only if you haven't made a subsequent call to the CRTL stat()
  1028. routine, since the device name is overwritten with each call.  If this warning
  1029. appears, the name lookup failed, and the access checking routine gave up and
  1030. returned FALSE, just to be conservative.  (Note: The access checking routine
  1031. knows about the Perl C<stat> operator and file tests, so you shouldn't ever
  1032. see this warning in response to a Perl command; it arises only if some internal
  1033. code takes stat buffers lightly.)
  1034.  
  1035. =item Can't get pipe mailbox device name
  1036.  
  1037. (P) An error peculiar to VMS.  After creating a mailbox to act as a pipe, Perl
  1038. can't retrieve its name for later use.
  1039.  
  1040. =item Can't get SYSGEN parameter value for MAXBUF
  1041.  
  1042. (P) An error peculiar to VMS.  Perl asked $GETSYI how big you want your
  1043. mailbox buffers to be, and didn't get an answer.
  1044.  
  1045. =item Can't goto subroutine outside a subroutine
  1046.  
  1047. (F) The deeply magical "goto subroutine" call can only replace one subroutine
  1048. call for another.  It can't manufacture one out of whole cloth.  In general
  1049. you should only be calling it out of an AUTOLOAD routine anyway.  See
  1050. L<perlfunc/goto>.
  1051.  
  1052. =item Can't localize a reference
  1053.  
  1054. (F) You said something like C<local $$ref>, which is not allowed because
  1055. the compiler can't determine whether $ref will end up pointing to anything
  1056. with a symbol table entry, and a symbol table entry is necessary to
  1057. do a local.
  1058.  
  1059. =item Can't localize lexical variable %s
  1060.  
  1061. (F) You used local on a variable name that was previous declared as a
  1062. lexical variable using "my".  This is not allowed.  If you want to
  1063. localize a package variable of the same name, qualify it with the
  1064. package name.
  1065.  
  1066. =item Can't locate %s in @INC
  1067.  
  1068. (F) You said to do (or require, or use) a file that couldn't be found
  1069. in any of the libraries mentioned in @INC.  Perhaps you need to set
  1070. the PERL5LIB environment variable to say where the extra library is,
  1071. or maybe the script needs to add the library name to @INC.  Or maybe
  1072. you just misspelled the name of the file.  See L<perlfunc/require>.
  1073.  
  1074. =item Can't locate object method "%s" via package "%s"
  1075.  
  1076. (F) You called a method correctly, and it correctly indicated a package
  1077. functioning as a class, but that package doesn't define that particular
  1078. method, nor does any of it's base classes.  See L<perlobj>.
  1079.  
  1080. =item Can't locate package %s for @%s::ISA
  1081.  
  1082. (W) The @ISA array contained the name of another package that doesn't seem
  1083. to exist.
  1084.  
  1085. =item Can't mktemp()
  1086.  
  1087. (F) The mktemp() routine failed for some reason while trying to process
  1088. a B<-e> switch.  Maybe your /tmp partition is full, or clobbered.
  1089.  
  1090. =item Can't modify %s in %s
  1091.  
  1092. (F) You aren't allowed to assign to the item indicated, or otherwise try to
  1093. change it, such as with an autoincrement.
  1094.  
  1095. =item Can't modify non-existent substring
  1096.  
  1097. (P) The internal routine that does assignment to a substr() was handed
  1098. a NULL.
  1099.  
  1100. =item Can't msgrcv to readonly var
  1101.  
  1102. (F) The target of a msgrcv must be modifiable in order to be used as a receive
  1103. buffer.
  1104.  
  1105. =item Can't open %s: %s
  1106.  
  1107. (S) An inplace edit couldn't open the original file for the indicated reason.
  1108. Usually this is because you don't have read permission for the file.
  1109.  
  1110. =item Can't open bidirectional pipe
  1111.  
  1112. (W) You tried to say C<open(CMD, "|cmd|")>, which is not supported.  You can
  1113. try any of several modules in the Perl library to do this, such as
  1114. "open2.pl".  Alternately, direct the pipe's output to a file using ">",
  1115. and then read it in under a different file handle.
  1116.  
  1117. =item Can't open error file %s as stderr
  1118.  
  1119. (F) An error peculiar to VMS.  Perl does its own command line redirection, and
  1120. couldn't open the file specified after '2>' or '2>>' on the command line for
  1121. writing.
  1122.  
  1123. =item Can't open input file %s as stdin
  1124.  
  1125. (F) An error peculiar to VMS.  Perl does its own command line redirection, and
  1126. couldn't open the file specified after '<' on the command line for reading.
  1127.  
  1128. =item Can't open output file %s as stdout
  1129.  
  1130. (F) An error peculiar to VMS.  Perl does its own command line redirection, and
  1131. couldn't open the file specified after '>' or '>>' on the command line for
  1132. writing.
  1133.  
  1134. =item Can't open output pipe (name: %s)
  1135.  
  1136. (P) An error peculiar to VMS.  Perl does its own command line redirection, and
  1137. couldn't open the pipe into which to send data destined for stdout.
  1138.  
  1139. =item Can't open perl script "%s": %s
  1140.  
  1141. (F) The script you specified can't be opened for the indicated reason.
  1142.  
  1143. =item Can't rename %s to %s: %s, skipping file
  1144.  
  1145. (S) The rename done by the B<-i> switch failed for some reason, probably because
  1146. you don't have write permission to the directory.
  1147.  
  1148. =item Can't reopen input pipe (name: %s) in binary mode
  1149.  
  1150. (P) An error peculiar to VMS.  Perl thought stdin was a pipe, and tried to
  1151. reopen it to accept binary data.  Alas, it failed.
  1152.  
  1153. =item Can't reswap uid and euid
  1154.  
  1155. (P) The setreuid() call failed for some reason in the setuid emulator
  1156. of suidperl.
  1157.  
  1158. =item Can't return outside a subroutine
  1159.  
  1160. (F) The return statement was executed in mainline code, that is, where
  1161. there was no subroutine call to return out of.  See L<perlsub>.
  1162.  
  1163. =item Can't stat script "%s"
  1164.  
  1165. (P) For some reason you can't fstat() the script even though you have
  1166. it open already.  Bizarre.
  1167.  
  1168. =item Can't swap uid and euid
  1169.  
  1170. (P) The setreuid() call failed for some reason in the setuid emulator
  1171. of suidperl.
  1172.  
  1173. =item Can't take log of %g
  1174.  
  1175. (F) Logarithms are only defined on positive real numbers.
  1176.  
  1177. =item Can't take sqrt of %g
  1178.  
  1179. (F) For ordinary real numbers, you can't take the square root of a
  1180. negative number.  There's a Complex package available for Perl, though,
  1181. if you really want to do that.
  1182.  
  1183. =item Can't undef active subroutine
  1184.  
  1185. (F) You can't undefine a routine that's currently running.  You can,
  1186. however, redefine it while it's running, and you can even undef the
  1187. redefined subroutine while the old routine is running.  Go figure.
  1188.  
  1189. =item Can't unshift
  1190.  
  1191. (F) You tried to unshift an "unreal" array that can't be unshifted, such
  1192. as the main Perl stack.
  1193.  
  1194. =item Can't upgrade that kind of scalar
  1195.  
  1196. (P) The internal sv_upgrade routine adds "members" to an SV, making
  1197. it into a more specialized kind of SV.  The top several SV types are
  1198. so specialized, however, that they cannot be interconverted.  This
  1199. message indicates that such a conversion was attempted.
  1200.  
  1201. =item Can't upgrade to undef
  1202.  
  1203. (P) The undefined SV is the bottom of the totem pole, in the scheme
  1204. of upgradability.  Upgrading to undef indicates an error in the
  1205. code calling sv_upgrade.
  1206.  
  1207. =item Can't use "my %s" in sort comparison
  1208.  
  1209. (F) The global variables $a and $b are reserved for sort comparisons.
  1210. You mentioned $a or $b in the same line as the <=> or cmp operator,
  1211. and the variable had earlier been declared as a lexical variable.
  1212. Either qualify the sort variable with the package name, or rename the
  1213. lexical variable.
  1214.  
  1215. =item Can't use %s for loop variable
  1216.  
  1217. (F) Only a simple scalar variable may be used as a loop variable on a foreach.
  1218.  
  1219. =item Can't use %s ref as %s ref
  1220.  
  1221. (F) You've mixed up your reference types.  You have to dereference a
  1222. reference of the type needed.  You can use the ref() function to
  1223. test the type of the reference, if need be.
  1224.  
  1225. =item Can't use \1 to mean $1 in expression
  1226.  
  1227. (W) In an ordinary expression, backslash is a unary operator that creates
  1228. a reference to its argument.  The use of backslash to indicate a backreference
  1229. to a matched substring is only valid as part of a regular expression pattern.
  1230. Trying to do this in ordinary Perl code produces a value that prints
  1231. out looking like SCALAR(0xdecaf).  Use the $1 form instead.
  1232.  
  1233. =item Can't use string ("%s") as %s ref while "strict refs" in use
  1234.  
  1235. (F) Only hard references are allowed by "strict refs".  Symbolic references
  1236. are disallowed.  See L<perlref>.
  1237.  
  1238. =item Can't use an undefined value as %s reference
  1239.  
  1240. (F) A value used as either a hard reference or a symbolic reference must
  1241. be a defined value.  This helps to de-lurk some insidious errors.
  1242.  
  1243. =item Can't use delimiter brackets within expression
  1244.  
  1245. (F) The ${name} construct is for disambiguating identifiers in strings, not
  1246. in ordinary code.
  1247.  
  1248. =item Can't use global %s in "my"
  1249.  
  1250. (F) You tried to declare a magical variable as a lexical variable.  This is
  1251. not allowed, because the magic can only be tied to one location (namely
  1252. the global variable) and it would be incredibly confusing to have
  1253. variables in your program that looked like magical variables but
  1254. weren't.
  1255.  
  1256. =item Can't use subscript on %s
  1257.  
  1258. (F) The compiler tried to interpret a bracketed expression as a
  1259. subscript.  But to the left of the brackets was an expression that
  1260. didn't look like an array reference, or anything else subscriptable.
  1261.  
  1262. =item Can't write to temp file for B<-e>: %s
  1263.  
  1264. (F) The write routine failed for some reason while trying to process
  1265. a B<-e> switch.  Maybe your /tmp partition is full, or clobbered.
  1266.  
  1267. =item Can't x= to readonly value
  1268.  
  1269. (F) You tried to repeat a constant value (often the undefined value) with
  1270. an assignment operator, which implies modifying the value itself.
  1271. Perhaps you need to copy the value to a temporary, and repeat that.
  1272.  
  1273. =item Cannot open temporary file
  1274.  
  1275. (F) The create routine failed for some reaon while trying to process
  1276. a B<-e> switch.  Maybe your /tmp partition is full, or clobbered.
  1277.  
  1278. =item chmod: mode argument is missing initial 0
  1279.  
  1280. (W) A novice will sometimes say
  1281.  
  1282.     chmod 777, $filename
  1283.  
  1284. not realizing that 777 will be interpreted as a decimal number, equivalent
  1285. to 01411.  Octal constants are introduced with a leading 0 in Perl, as in C.
  1286.  
  1287. =item Close on unopened file <%s>
  1288.  
  1289. (W) You tried to close a filehandle that was never opened.
  1290.  
  1291. =item connect() on closed fd
  1292.  
  1293. (W) You tried to do a connect on a closed socket.  Did you forget to check
  1294. the return value of your socket() call?  See L<perlfunc/connect>.
  1295.  
  1296. =item Corrupt malloc ptr 0x%lx at 0x%lx
  1297.  
  1298. (P) The malloc package that comes with Perl had an internal failure.
  1299.  
  1300. =item corrupted regexp pointers
  1301.  
  1302. (P) The regular expression engine got confused by what the regular
  1303. expression compiler gave it.
  1304.  
  1305. =item corrupted regexp program
  1306.  
  1307. (P) The regular expression engine got passed a regexp program without
  1308. a valid magic number.
  1309.  
  1310. =item Deep recursion on subroutine "%s"
  1311.  
  1312. (W) This subroutine has called itself (directly or indirectly) 100
  1313. times than it has returned.  This probably indicates an infinite
  1314. recursion, unless you're writing strange benchmark programs, in which
  1315. case it indicates something else.
  1316.  
  1317. =item Did you mean &%s instead?
  1318.  
  1319. (W) You probably referred to an imported subroutine &FOO as $FOO or some such.
  1320.  
  1321. =item Did you mean $ or @ instead of %?
  1322.  
  1323. (W) You probably said %hash{$key} when you meant $hash{$key} or @hash{@keys}.
  1324. On the other hand, maybe you just meant %hash and got carried away.
  1325.  
  1326. =item Do you need to predeclare %s?
  1327.  
  1328. (S) This is an educated guess made in conjunction with the message "%s
  1329. found where operator expected".  It often means a subroutine or module
  1330. name is being referenced that hasn't been declared yet.  This may be
  1331. because of ordering problems in your file, or because of a missing
  1332. "sub", "package", "require", or "use" statement.  If you're
  1333. referencing something that isn't defined yet, you don't actually have
  1334. to define the subroutine or package before the current location.  You
  1335. can use an empty "sub foo;" or "package FOO;" to enter a "forward"
  1336. declaration.
  1337.  
  1338. =item Don't know how to handle magic of type '%s'
  1339.  
  1340. (P) The internal handling of magical variables has been cursed.
  1341.  
  1342. =item do_study: out of memory
  1343.  
  1344. (P) This should have been caught by safemalloc() instead.
  1345.  
  1346. =item Duplicate free() ignored
  1347.  
  1348. (S) An internal routine called free() on something that had already
  1349. been freed.
  1350.  
  1351. =item elseif should be elsif
  1352.  
  1353. (S) There is no keyword "elseif" in Perl because Larry thinks it's
  1354. ugly.  Your code will be interpreted as an attempt to call a method
  1355. named "elseif" for the class returned by the following block.  This is
  1356. unlikely to be what you want.
  1357.  
  1358. =item END failed--cleanup aborted
  1359.  
  1360. (F) An untrapped exception was raised while executing an END subroutine.
  1361. The interpreter is immediately exited.
  1362.  
  1363. =item Error converting file specification %s
  1364.  
  1365. (F) An error peculiar to VMS.  Since Perl may have to deal with file
  1366. specifications in either VMS or Unix syntax, it converts them to a
  1367. single form when it must operate on them directly.  Either you've
  1368. passed an invalid file specification to Perl, or you've found a
  1369. case the conversion routines don't handle.  Drat.
  1370.  
  1371. =item Execution of %s aborted due to compilation errors.
  1372.  
  1373. (F) The final summary message when a Perl compilation fails.
  1374.  
  1375. =item Exiting eval via %s
  1376.  
  1377. (W) You are exiting an eval by unconventional means, such as a
  1378. a goto, or a loop control statement.
  1379.  
  1380. =item Exiting subroutine via %s
  1381.  
  1382. (W) You are exiting a subroutine by unconventional means, such as a
  1383. a goto, or a loop control statement.
  1384.  
  1385. =item Exiting substitution via %s
  1386.  
  1387. (W) You are exiting a substitution by unconventional means, such as a
  1388. a return, a goto, or a loop control statement.
  1389.  
  1390. =item Fatal VMS error at %s, line %d
  1391.  
  1392. (P) An error peculiar to VMS.  Something untoward happened in a VMS system
  1393. service or RTL routine; Perl's exit status should provide more details.  The
  1394. filename in "at %s" and the line number in "line %d" tell you which section of
  1395. the Perl source code is distressed.
  1396.  
  1397. =item fcntl is not implemented
  1398.  
  1399. (F) Your machine apparently doesn't implement fcntl().  What is this, a
  1400. PDP-11 or something?
  1401.  
  1402. =item Filehandle %s never opened
  1403.  
  1404. (W) An I/O operation was attempted on a filehandle that was never initialized.
  1405. You need to do an open() or a socket() call, or call a constructor from
  1406. the FileHandle package.
  1407.  
  1408. =item Filehandle %s opened only for input
  1409.  
  1410. (W) You tried to write on a read-only filehandle.  If you
  1411. intended it to be a read-write filehandle, you needed to open it with
  1412. "+<" or "+>" or "+>>" instead of with "<" or nothing.  If you only
  1413. intended to write the file, use ">" or ">>".  See L<perlfunc/open>.
  1414.  
  1415. =item Filehandle only opened for input
  1416.  
  1417. (W) You tried to write on a read-only filehandle.  If you
  1418. intended it to be a read-write filehandle, you needed to open it with
  1419. "+<" or "+>" or "+>>" instead of with "<" or nothing.  If you only
  1420. intended to write the file, use ">" or ">>".  See L<perlfunc/open>.
  1421.  
  1422. =item Final $ should be \$ or $name
  1423.  
  1424. (F) You must now decide whether the final $ in a string was meant to be
  1425. a literal dollar sign, or was meant to introduce a variable name
  1426. that happens to be missing.  So you have to put either the backslash or
  1427. the name.
  1428.  
  1429. =item Final @ should be \@ or @name
  1430.  
  1431. (F) You must now decide whether the final @ in a string was meant to be
  1432. a literal "at" sign, or was meant to introduce a variable name
  1433. that happens to be missing.  So you have to put either the backslash or
  1434. the name.
  1435.  
  1436. =item Format %s redefined
  1437.  
  1438. (W) You redefined a format.  To suppress this warning, say
  1439.  
  1440.     {
  1441.     local $^W = 0;
  1442.     eval "format NAME =...";
  1443.     }
  1444.  
  1445. =item Format not terminated
  1446.  
  1447. (F) A format must be terminated by a line with a solitary dot.  Perl got
  1448. to the end of your file without finding such a line.
  1449.  
  1450. =item Found = in conditional, should be ==
  1451.  
  1452. (W) You said
  1453.  
  1454.     if ($foo = 123)
  1455.  
  1456. when you meant
  1457.  
  1458.     if ($foo == 123)
  1459.  
  1460. (or something like that).
  1461.  
  1462. =item gdbm store returned %d, errno %d, key "%s"
  1463.  
  1464. (S) A warning from the GDBM_File extension that a store failed.
  1465.  
  1466. =item gethostent not implemented
  1467.  
  1468. (F) Your C library apparently doesn't implement gethostent(), probably
  1469. because if it did, it'd feel morally obligated to return every hostname
  1470. on the Internet.
  1471.  
  1472. =item get{sock,peer}name() on closed fd
  1473.  
  1474. (W) You tried to get a socket or peer socket name on a closed socket.
  1475. Did you forget to check the return value of your socket() call?
  1476.  
  1477. =item getpwnam returned invalid UIC %#o for user "%s"
  1478.  
  1479. (S) A warning peculiar to VMS.  The call to C<sys$getuai> underlying the
  1480. C<getpwnam> operator returned an invalid UIC.
  1481.  
  1482.  
  1483. =item Glob not terminated
  1484.  
  1485. (F) The lexer saw a left angle bracket in a place where it was expecting
  1486. a term, so it's looking for the corresponding right angle bracket, and not
  1487. finding it.  Chances are you left some needed parentheses out earlier in
  1488. the line, and you really meant a "less than".
  1489.  
  1490. =item Global symbol "%s" requires explicit package name
  1491.  
  1492. (F) You've said "use strict vars", which indicates that all variables must
  1493. either be lexically scoped (using "my"), or explicitly qualified to
  1494. say which package the global variable is in (using "::").
  1495.  
  1496. =item goto must have label
  1497.  
  1498. (F) Unlike with "next" or "last", you're not allowed to goto an
  1499. unspecified destination.  See L<perlfunc/goto>.
  1500.  
  1501. =item Had to create %s unexpectedly
  1502.  
  1503. (S) A routine asked for a symbol from a symbol table that ought to have
  1504. existed already, but for some reason it didn't, and had to be created on
  1505. an emergency basis to prevent a core dump.
  1506.  
  1507. =item Hash %%s missing the % in argument %d of %s()
  1508.  
  1509. (D) Really old Perl let you omit the % on hash names in some spots.  This
  1510. is now heavily deprecated.
  1511.  
  1512. =item Identifier "%s::%s" used only once: possible typo
  1513.  
  1514. (W) Typographical errors often show up as unique identifiers.  If you
  1515. had a good reason for having a unique identifier, then just mention it
  1516. again somehow to suppress the message.
  1517.  
  1518. =item Illegal division by zero
  1519.  
  1520. (F) You tried to divide a number by 0.  Either something was wrong in your
  1521. logic, or you need to put a conditional in to guard against meaningless input.
  1522.  
  1523. =item Illegal modulus zero
  1524.  
  1525. (F) You tried to divide a number by 0 to get the remainder.  Most numbers
  1526. don't take to this kindly.
  1527.  
  1528. =item Illegal octal digit
  1529.  
  1530. (F) You used an 8 or 9 in a octal number.
  1531.  
  1532. =item Illegal octal digit ignored
  1533.  
  1534. (W) You may have tried to use an 8 or 9 in a octal number.  Interpretation
  1535. of the octal number stopped before the 8 or 9.
  1536.  
  1537. =item Insecure dependency in %s
  1538.  
  1539. (F) You tried to do something that the tainting mechanism didn't like. 
  1540. The tainting mechanism is turned on when you're running setuid or setgid,
  1541. or when you specify B<-T> to turn it on explicitly.  The tainting mechanism
  1542. labels all data that's derived directly or indirectly from the user,
  1543. who is considered to be unworthy of your trust.  If any such data is
  1544. used in a "dangerous" operation, you get this error.  See L<perlsec>
  1545. for more information.
  1546.  
  1547. =item Insecure directory in %s
  1548.  
  1549. (F) You can't use system(), exec(), or a piped open in a setuid or setgid
  1550. script if $ENV{PATH} contains a directory that is writable by the world.
  1551. See L<perlsec>.
  1552.  
  1553. =item Insecure PATH
  1554.  
  1555. (F) You can't use system(), exec(), or a piped open in a setuid or
  1556. setgid script if $ENV{PATH} is derived from data supplied (or
  1557. potentially supplied) by the user.  The script must set the path to a
  1558. known value, using trustworthy data.  See L<perlsec>.
  1559.  
  1560. =item Internal inconsistency in tracking vforks
  1561.  
  1562. (S) A warning peculiar to VMS.  Perl keeps track of the number
  1563. of times you've called C<fork> and C<exec>, in order to determine
  1564. whether the current call to C<exec> should be affect the current
  1565. script or a subprocess (see L<perlvms/exec>).  Somehow, this count
  1566. has become scrambled, so Perl is making a guess and treating
  1567. this C<exec> as a request to terminate the Perl script
  1568. and execute the specified command.
  1569.  
  1570. =item internal disaster in regexp
  1571.  
  1572. (P) Something went badly wrong in the regular expression parser.
  1573.  
  1574. =item internal urp in regexp at /%s/
  1575.  
  1576. (P) Something went badly awry in the regular expression parser.
  1577.  
  1578. =item invalid [] range in regexp
  1579.  
  1580. (F) The range specified in a character class had a minimum character
  1581. greater than the maximum character.  See L<perlre>.
  1582.  
  1583. =item ioctl is not implemented
  1584.  
  1585. (F) Your machine apparently doesn't implement ioctl(), which is pretty
  1586. strange for a machine that supports C.
  1587.  
  1588. =item junk on end of regexp
  1589.  
  1590. (P) The regular expression parser is confused.
  1591.  
  1592. =item Label not found for "last %s"
  1593.  
  1594. (F) You named a loop to break out of, but you're not currently in a
  1595. loop of that name, not even if you count where you were called from.
  1596. See L<perlfunc/last>.
  1597.  
  1598. =item Label not found for "next %s"
  1599.  
  1600. (F) You named a loop to continue, but you're not currently in a loop of
  1601. that name, not even if you count where you were called from.  See
  1602. L<perlfunc/last>.
  1603.  
  1604. =item Label not found for "redo %s"
  1605.  
  1606. (F) You named a loop to restart, but you're not currently in a loop of
  1607. that name, not even if you count where you were called from.  See
  1608. L<perlfunc/last>.
  1609.  
  1610. =item listen() on closed fd
  1611.  
  1612. (W) You tried to do a listen on a closed socket.  Did you forget to check
  1613. the return value of your socket() call?  See L<perlfunc/listen>.
  1614.  
  1615. =item Literal @%s now requires backslash
  1616.  
  1617. (F) It used to be that Perl would try to guess whether you wanted an
  1618. array interpolated or a literal @.  It did this when the string was
  1619. first used at runtime.  Now strings are parsed at compile time, and
  1620. ambiguous instances of @ must be disambiguated, either by putting a
  1621. backslash to indicate a literal, or by declaring (or using) the array
  1622. within the program before the string (lexically).  (Someday it will simply
  1623. assume that an unbackslashed @ interpolates an array.)
  1624.  
  1625. =item Method for operation %s not found in package %s during blessing
  1626.  
  1627. (F) An attempt was made to specify an entry in an overloading table that
  1628. doesn't somehow point to a valid method.  See L<perlovl>.
  1629.  
  1630. =item Might be a runaway multi-line %s string starting on line %d
  1631.  
  1632. (S) An advisory indicating that the previous error may have been caused
  1633. by a missing delimiter on a string or pattern, because it eventually
  1634. ended earlier on the current line.
  1635.  
  1636. =item Misplaced _ in number
  1637.  
  1638. (W) An underline in a decimal constant wasn't on a 3-digit boundary.
  1639.  
  1640. =item Missing $ on loop variable
  1641.  
  1642. (F) Apparently you've been programming in csh too much.  Variables are always
  1643. mentioned with the $ in Perl, unlike in the shells, where it can vary from 
  1644. one line to the next.
  1645.  
  1646. =item Missing comma after first argument to %s function
  1647.  
  1648. (F) While certain functions allow you to specify a filehandle or an
  1649. "indirect object" before the argument list, this ain't one of them.
  1650.  
  1651. =item Missing operator before %s?
  1652.  
  1653. (S) This is an educated guess made in conjunction with the message "%s
  1654. found where operator expected".  Often the missing operator is a comma.
  1655.  
  1656. =item Missing right bracket
  1657.  
  1658. (F) The lexer counted more opening curly brackets (braces) than closing ones.
  1659. As a general rule, you'll find it's missing near the place you were last
  1660. editing.
  1661.  
  1662. =item Missing semicolon on previous line?
  1663.  
  1664. (S) This is an educated guess made in conjunction with the message "%s
  1665. found where operator expected".  Don't automatically put a semicolon on
  1666. the previous line just because you saw this message.
  1667.  
  1668. =item Modification of a read-only value attempted
  1669.  
  1670. (F) You tried, directly or indirectly, to change the value of a
  1671. constant.  You didn't, of course, try "2 = 1", since the compiler
  1672. catches that.  But an easy way to do the same thing is:
  1673.  
  1674.     sub mod { $_[0] = 1 }
  1675.     mod(2);
  1676.  
  1677. Another way is to assign to a substr() that's off the end of the string.
  1678.  
  1679. =item Modification of non-creatable array value attempted, subscript %d
  1680.  
  1681. (F) You tried to make an array value spring into existence, and the
  1682. subscript was probably negative, even counting from end of the array
  1683. backwards.
  1684.  
  1685. =item Modification of non-creatable hash value attempted, subscript "%s"
  1686.  
  1687. (F) You tried to make a hash value spring into existence, and it couldn't
  1688. be created for some peculiar reason.
  1689.  
  1690. =item Module name must be constant
  1691.  
  1692. (F) Only a bare module name is allowed as the first argument to a "use".
  1693.  
  1694. =item msg%s not implemented
  1695.  
  1696. (F) You don't have System V message IPC on your system.
  1697.  
  1698. =item Multidimensional syntax %s not supported
  1699.  
  1700. (W) Multidimensional arrays aren't written like $foo[1,2,3].  They're written
  1701. like $foo[1][2][3], as in C.
  1702.  
  1703. =item Negative length
  1704.  
  1705. (F) You tried to do a read/write/send/recv operation with a buffer length
  1706. that is less than 0.  This is difficult to imagine.
  1707.  
  1708. =item nested *?+ in regexp
  1709.  
  1710. (F) You can't quantify a quantifier without intervening parens.  So
  1711. things like ** or +* or ?* are illegal.
  1712.  
  1713. Note, however, that the minimal matching quantifiers, *?, +? and ?? appear
  1714. to be nested quantifiers, but aren't.  See L<perlre>.
  1715.  
  1716. =item No #! line
  1717.  
  1718. (F) The setuid emulator requires that scripts have a well-formed #! line
  1719. even on machines that don't support the #! construct.
  1720.  
  1721. =item No %s allowed while running setuid
  1722.  
  1723. (F) Certain operations are deemed to be too insecure for a setuid or setgid
  1724. script to even be allowed to attempt.  Generally speaking there will be
  1725. another way to do what you want that is, if not secure, at least securable.
  1726. See L<perlsec>.
  1727.  
  1728. =item No B<-e> allowed in setuid scripts
  1729.  
  1730. (F) A setuid script can't be specified by the user.
  1731.  
  1732. =item No comma allowed after %s
  1733.  
  1734. (F) A list operator that has a filehandle or "indirect object" is not
  1735. allowed to have a comma between that and the following arguments.
  1736. Otherwise it'd be just another one of the arguments.
  1737.  
  1738. =item No command into which to pipe on command line
  1739.  
  1740. (F) An error peculiar to VMS.  Perl handles its own command line redirection,
  1741. and found a '|' at the end of the command line, so it doesn't know whither you
  1742. want to pipe the output from this command.
  1743.  
  1744. =item No DB::DB routine defined
  1745.  
  1746. (F) The currently executing code was compiled with the B<-d> switch,
  1747. but for some reason the perl5db.pl file (or some facsimile thereof)
  1748. didn't define a routine to be called at the beginning of each
  1749. statement.  Which is odd, because the file should have been required
  1750. automatically, and should have blown up the require if it didn't parse
  1751. right.
  1752.  
  1753. =item No dbm on this machine
  1754.  
  1755. (P) This is counted as an internal error, because every machine should
  1756. supply dbm nowadays, since Perl comes with SDBM.  See L<SDBM_File>.
  1757.  
  1758. =item No DBsub routine
  1759.  
  1760. (F) The currently executing code was compiled with the B<-d> switch,
  1761. but for some reason the perl5db.pl file (or some facsimile thereof)
  1762. didn't define a DB::sub routine to be called at the beginning of each
  1763. ordinary subroutine call.
  1764.  
  1765. =item No error file after 2> or 2>> on command line
  1766.  
  1767. (F) An error peculiar to VMS.  Perl handles its own command line redirection,
  1768. and found a '2>' or a '2>>' on the command line, but can't find the name of the
  1769. file to which to write data destined for stderr.
  1770.  
  1771. =item No input file after < on command line
  1772.  
  1773. (F) An error peculiar to VMS.  Perl handles its own command line redirection,
  1774. and found a '<' on the command line, but can't find the name of the file from
  1775. which to read data for stdin.
  1776.  
  1777. =item No output file after > on command line
  1778.  
  1779. (F) An error peculiar to VMS.  Perl handles its own command line redirection,
  1780. and found a lone '>' at the end of the command line, so it doesn't know whither
  1781. you wanted to redirect stdout.
  1782.  
  1783. =item No output file after > or >> on command line
  1784.  
  1785. (F) An error peculiar to VMS.  Perl handles its own command line redirection,
  1786. and found a '>' or a '>>' on the command line, but can't find the name of the
  1787. file to which to write data destined for stdout.
  1788.  
  1789. =item No Perl script found in input
  1790.  
  1791. (F) You called C<perl -x>, but no line was found in the file beginning
  1792. with #! and containing the word "perl".
  1793.  
  1794. =item No setregid available
  1795.  
  1796. (F) Configure didn't find anything resembling the setregid() call for
  1797. your system.
  1798.  
  1799. =item No setreuid available
  1800.  
  1801. (F) Configure didn't find anything resembling the setreuid() call for
  1802. your system.
  1803.  
  1804. =item No space allowed after B<-I>
  1805.  
  1806. (F) The argument to B<-I> must follow the B<-I> immediately with no
  1807. intervening space.
  1808.  
  1809. =item No such pipe open
  1810.  
  1811. (P) An error peculiar to VMS.  The internal routine my_pclose() tried to
  1812. close a pipe which hadn't been opened.  This should have been caught earlier as
  1813. an attempt to close an unopened filehandle.
  1814.  
  1815. =item No such signal: SIG%s
  1816.  
  1817. (W) You specified a signal name as a subscript to %SIG that was not recognized.
  1818. Say C<kill -l> in your shell to see the valid signal names on your system.
  1819.  
  1820. =item Not a CODE reference
  1821.  
  1822. (F) Perl was trying to evaluate a reference to a code value (that is, a
  1823. subroutine), but found a reference to something else instead.  You can
  1824. use the ref() function to find out what kind of ref it really was.
  1825. See also L<perlref>.
  1826.  
  1827. =item Not a format reference
  1828.  
  1829. (F) I'm not sure how you managed to generate a reference to an anonymous
  1830. format, but this indicates you did, and that it didn't exist.
  1831.  
  1832. =item Not a GLOB reference
  1833.  
  1834. (F) Perl was trying to evaluate a reference to a "type glob" (that is,
  1835. a symbol table entry that looks like C<*foo>), but found a reference to
  1836. something else instead.  You can use the ref() function to find out
  1837. what kind of ref it really was.  See L<perlref>.
  1838.  
  1839. =item Not a HASH reference
  1840.  
  1841. (F) Perl was trying to evaluate a reference to a hash value, but
  1842. found a reference to something else instead.  You can use the ref()
  1843. function to find out what kind of ref it really was.  See L<perlref>.
  1844.  
  1845. =item Not a perl script
  1846.  
  1847. (F) The setuid emulator requires that scripts have a well-formed #! line
  1848. even on machines that don't support the #! construct.  The line must
  1849. mention perl.
  1850.  
  1851. =item Not a SCALAR reference
  1852.  
  1853. (F) Perl was trying to evaluate a reference to a scalar value, but
  1854. found a reference to something else instead.  You can use the ref()
  1855. function to find out what kind of ref it really was.  See L<perlref>.
  1856.  
  1857. =item Not a subroutine reference
  1858.  
  1859. (F) Perl was trying to evaluate a reference to a code value (that is, a
  1860. subroutine), but found a reference to something else instead.  You can
  1861. use the ref() function to find out what kind of ref it really was.
  1862. See also L<perlref>.
  1863.  
  1864. =item Not a subroutine reference in %OVERLOAD
  1865.  
  1866. (F) An attempt was made to specify an entry in an overloading table that
  1867. doesn't somehow point to a valid subroutine.  See L<perlovl>.
  1868.  
  1869. =item Not an ARRAY reference
  1870.  
  1871. (F) Perl was trying to evaluate a reference to an array value, but
  1872. found a reference to something else instead.  You can use the ref()
  1873. function to find out what kind of ref it really was.  See L<perlref>.
  1874.  
  1875. =item Not enough arguments for %s
  1876.  
  1877. (F) The function requires more arguments than you specified.
  1878.  
  1879. =item Not enough format arguments
  1880.  
  1881. (W) A format specified more picture fields than the next line supplied.
  1882. See L<perlform>.
  1883.  
  1884. =item Null filename used
  1885.  
  1886. (F) You can't require the null filename, especially since on many machines
  1887. that means the current directory!  See L<perlfunc/require>.
  1888.  
  1889. =item NULL OP IN RUN
  1890.  
  1891. (P) Some internal routine called run() with a null opcode pointer.
  1892.  
  1893. =item Null realloc
  1894.  
  1895. (P) An attempt was made to realloc NULL.
  1896.  
  1897. =item NULL regexp argument
  1898.  
  1899. (P) The internal pattern matching routines blew it bigtime.
  1900.  
  1901. =item NULL regexp parameter
  1902.  
  1903. (P) The internal pattern matching routines are out of their gourd.
  1904.  
  1905. =item Odd number of elements in hash list
  1906.  
  1907. (S) You specified an odd number of elements to a hash list, which is odd,
  1908. since hash lists come in key/value pairs.
  1909.  
  1910. =item oops: oopsAV
  1911.  
  1912. (S) An internal warning that the grammar is screwed up.
  1913.  
  1914. =item oops: oopsHV
  1915.  
  1916. (S) An internal warning that the grammar is screwed up.
  1917.  
  1918. =item Operation `%s' %s: no method found,
  1919.  
  1920. (F) An attempt was made to use an entry in an overloading table that
  1921. somehow no longer points to a valid method.  See L<perlovl>.
  1922.  
  1923. =item Operator or semicolon missing before %s
  1924.  
  1925. (S) You used a variable or subroutine call where the parser was
  1926. expecting an operator.  The parser has assumed you really meant
  1927. to use an operator, but this is highly likely to be incorrect.
  1928. For example, if you say "*foo *foo" it will be interpreted as
  1929. if you said "*foo * 'foo'".
  1930.  
  1931. =item Out of memory for yacc stack
  1932.  
  1933. (F) The yacc parser wanted to grow its stack so it could continue parsing,
  1934. but realloc() wouldn't give it more memory, virtual or otherwise.
  1935.  
  1936. =item Out of memory!
  1937.  
  1938. (X) The malloc() function returned 0, indicating there was insufficient
  1939. remaining memory (or virtual memory) to satisfy the request.
  1940.  
  1941. =item page overflow
  1942.  
  1943. (W) A single call to write() produced more lines than can fit on a page.
  1944. See L<perlform>.
  1945.  
  1946. =item panic: ck_grep
  1947.  
  1948. (P) Failed an internal consistency check trying to compile a grep.
  1949.  
  1950. =item panic: ck_split
  1951.  
  1952. (P) Failed an internal consistency check trying to compile a split.
  1953.  
  1954. =item panic: corrupt saved stack index
  1955.  
  1956. (P) The savestack was requested to restore more localized values than there
  1957. are in the savestack.
  1958.  
  1959. =item panic: die %s
  1960.  
  1961. (P) We popped the context stack to an eval context, and then discovered
  1962. it wasn't an eval context.
  1963.  
  1964. =item panic: do_match
  1965.  
  1966. (P) The internal pp_match() routine was called with invalid operational data.
  1967.  
  1968. =item panic: do_split
  1969.  
  1970. (P) Something terrible went wrong in setting up for the split.
  1971.  
  1972. =item panic: do_subst
  1973.  
  1974. (P) The internal pp_subst() routine was called with invalid operational data.
  1975.  
  1976. =item panic: do_trans
  1977.  
  1978. (P) The internal do_trans() routine was called with invalid operational data.
  1979.  
  1980. =item panic: goto
  1981.  
  1982. (P) We popped the context stack to a context with the specified label,
  1983. and then discovered it wasn't a context we know how to do a goto in.
  1984.  
  1985. =item panic: INTERPCASEMOD
  1986.  
  1987. (P) The lexer got into a bad state at a case modifier.
  1988.  
  1989. =item panic: INTERPCONCAT
  1990.  
  1991. (P) The lexer got into a bad state parsing a string with brackets.
  1992.  
  1993. =item panic: last
  1994.  
  1995. (P) We popped the context stack to a block context, and then discovered
  1996. it wasn't a block context.
  1997.  
  1998. =item panic: leave_scope clearsv
  1999.  
  2000. (P) A writable lexical variable became readonly somehow within the scope.
  2001.  
  2002. =item panic: leave_scope inconsistency
  2003.  
  2004. (P) The savestack probably got out of sync.  At least, there was an
  2005. invalid enum on the top of it.
  2006.  
  2007. =item panic: malloc
  2008.  
  2009. (P) Something requested a negative number of bytes of malloc.
  2010.  
  2011. =item panic: mapstart
  2012.  
  2013. (P) The compiler is screwed up with respect to the map() function.
  2014.  
  2015. =item panic: null array
  2016.  
  2017. (P) One of the internal array routines was passed a null AV pointer.
  2018.  
  2019. =item panic: pad_alloc
  2020.  
  2021. (P) The compiler got confused about which scratch pad it was allocating
  2022. and freeing temporaries and lexicals from.
  2023.  
  2024. =item panic: pad_free curpad
  2025.  
  2026. (P) The compiler got confused about which scratch pad it was allocating
  2027. and freeing temporaries and lexicals from.
  2028.  
  2029. =item panic: pad_free po
  2030.  
  2031. (P) An invalid scratch pad offset was detected internally.
  2032.  
  2033. =item panic: pad_reset curpad
  2034.  
  2035. (P) The compiler got confused about which scratch pad it was allocating
  2036. and freeing temporaries and lexicals from.
  2037.  
  2038. =item panic: pad_sv po
  2039.  
  2040. (P) An invalid scratch pad offset was detected internally.
  2041.  
  2042. =item panic: pad_swipe curpad
  2043.  
  2044. (P) The compiler got confused about which scratch pad it was allocating
  2045. and freeing temporaries and lexicals from.
  2046.  
  2047. =item panic: pad_swipe po
  2048.  
  2049. (P) An invalid scratch pad offset was detected internally.
  2050.  
  2051. =item panic: pp_iter
  2052.  
  2053. (P) The foreach iterator got called in a non-loop context frame.
  2054.  
  2055. =item panic: realloc
  2056.  
  2057. (P) Something requested a negative number of bytes of realloc.
  2058.  
  2059. =item panic: restartop
  2060.  
  2061. (P) Some internal routine requested a goto (or something like it), and
  2062. didn't supply the destination.
  2063.  
  2064. =item panic: return
  2065.  
  2066. (P) We popped the context stack to a subroutine or eval context, and
  2067. then discovered it wasn't a subroutine or eval context.
  2068.  
  2069. =item panic: scan_num
  2070.  
  2071. (P) scan_num() got called on something that wasn't a number.
  2072.  
  2073. =item panic: sv_insert
  2074.  
  2075. (P) The sv_insert() routine was told to remove more string than there
  2076. was string.
  2077.  
  2078. =item panic: top_env
  2079.  
  2080. (P) The compiler attempted to do a goto, or something weird like that.
  2081.  
  2082. =item panic: yylex
  2083.  
  2084. (P) The lexer got into a bad state while processing a case modifier.
  2085.  
  2086. =item Parens missing around "%s" list
  2087.  
  2088. (W) You said something like
  2089.  
  2090.     my $foo, $bar = @_;
  2091.  
  2092. when you meant
  2093.  
  2094.     my ($foo, $bar) = @_;
  2095.  
  2096. Remember that "my" and "local" bind closer than comma.
  2097.  
  2098. =item Perl %3.3f required--this is only version %s, stopped
  2099.  
  2100. (F) The module in question uses features of a version of Perl more recent
  2101. than the currently running version.  How long has it been since you upgraded,
  2102. anyway?  See L<perlfunc/require>.
  2103.  
  2104. =item Permission denied
  2105.  
  2106. (F) The setuid emulator in suidperl decided you were up to no good.
  2107.  
  2108. =item pid %d not a child
  2109.  
  2110. (W) A warning peculiar to VMS.  Waitpid() was asked to wait for a process which
  2111. isn't a subprocess of the current process.  While this is fine from VMS'
  2112. perspective, it's probably not what you intended.
  2113.  
  2114. =item POSIX getpgrp can't take an argument
  2115.  
  2116. (F) Your C compiler uses POSIX getpgrp(), which takes no argument, unlike
  2117. the BSD version, which takes a pid.
  2118.  
  2119. =item Possible memory corruption: %s overflowed 3rd argument
  2120.  
  2121. (F) An ioctl() or fcntl() returned more than Perl was bargaining for.
  2122. Perl guesses a reasonable buffer size, but puts a sentinel byte at the
  2123. end of the buffer just in case.  This sentinel byte got clobbered, and
  2124. Perl assumes that memory is now corrupted.  See L<perlfunc/ioctl>.
  2125.  
  2126. =item Precedence problem: open %s should be open(%s)
  2127.  
  2128. (S) The old irregular construct
  2129.  
  2130.     open FOO || die;
  2131.  
  2132. is now misinterpreted as
  2133.  
  2134.     open(FOO || die);
  2135.  
  2136. because of the strict regularization of Perl 5's grammar into unary and
  2137. list operators.  (The old open was a little of both.) You must put
  2138. parens around the filehandle, or use the new "or" operator instead of "||".
  2139.  
  2140. =item print on closed filehandle %s
  2141.  
  2142. (W) The filehandle you're printing on got itself closed sometime before now.
  2143. Check your logic flow.
  2144.  
  2145. =item printf on closed filehandle %s
  2146.  
  2147. (W) The filehandle you're writing to got itself closed somfilehandle you're sending to got itself closed sometime before now.
  2148. Check your logic flow.
  2149.  
  2150. =item Sequence (?#... not terminated
  2151.  
  2152. (F) A regular expression comment must be terminated by a closing
  2153. parenthesis.  Embedded parens aren't allowed.  See L<perlre>.
  2154.  
  2155. =item Sequence (?%s...) not implemented
  2156.  
  2157. (F) A proposed regular expression extension has the character reserved
  2158. but has not yet been written.  See L<perlre>.
  2159.  
  2160. =item Sequence (?%s...) not recognized
  2161.  
  2162. (F) You used a regular expression extension that doesn't make sense.
  2163. See L<perlre>.
  2164.  
  2165. =item Server error
  2166.  
  2167. Also known as "500 Server error".  This is a CGI error, not a Perl
  2168. error.  You need to make sure your script is executable, is accessible
  2169. by the user CGI is running the script under (which is probably not
  2170. the user account you tested it under), does not rely on any environment
  2171. variables (like PATH) from the user it isn't running under, and isn't
  2172. in a location where the CGI server can't find it, basically, more or less.
  2173.  
  2174. =item setegid() not implemented
  2175.  
  2176. (F) You tried to assign to $), and your operating system doesn't support
  2177. the setegid() system call (or equivalent), or at least Configure didn't
  2178. think so.
  2179.  
  2180. =item seteuid() not implemented
  2181.  
  2182. (F) You tried to assign to $>, and your operating system doesn't support
  2183. the seteuid() system call (or equivalent), or at least Configure didn't
  2184. think so.
  2185.  
  2186. =item setrgid() not implemented
  2187.  
  2188. (F) You tried to assign to $(, and your operating system doesn't support
  2189. the setrgid() system call (or equivalent), or at least Configure didn't
  2190. think so.
  2191.  
  2192. =item setruid() not implemented
  2193.  
  2194. (F) You tried to assign to $<, and your operating system doesn't support
  2195. the setruid() system call (or equivalent), or at least Configure didn't
  2196. think so.
  2197.  
  2198. =item Setuid/gid script is writable by world
  2199.  
  2200. (F) The setuid emulator won't run a script that is writable by the world,
  2201. because the world might have written on it already.
  2202.  
  2203. =item shm%s not implemented
  2204.  
  2205. (F) You don't have System V shared memory IPC on your system.
  2206.  
  2207. =item shutdown() on closed fd
  2208.  
  2209. (W) You tried to do a shutdown on a closed socket.  Seems a bit superfluous.
  2210.  
  2211. =item SIG%s handler "%s" not defined.
  2212.  
  2213. (W) The signal handler named in %SIG doesn't, in fact, exist.  Perhaps you
  2214. put it into the wrong package?
  2215.  
  2216. =item sort is now a reserved word
  2217.  
  2218. (F) An ancient error message that almost nobody ever runs into anymore.
  2219. But before sort was a keyword, people sometimes used it as a filehandle.
  2220.  
  2221. =item Sort subroutine didn't return a numeric value
  2222.  
  2223. (F) A sort comparison routine must return a number.  You probably blew
  2224. it by not using C<E<lt>=E<gt>> or C<cmp>, or by not using them correctly.
  2225. See L<perlfunc/sort>.
  2226.  
  2227. =item Sort subroutine didn't return single value
  2228.  
  2229. (F) A sort comparison subroutine may not return a list value with more
  2230. or less than one element.  See L<perlfunc/sort>.
  2231.  
  2232. =item Split loop
  2233.  
  2234. (P) The split was looping infinitely.  (Obviously, a split shouldn't iterate
  2235. more times than there are characters of input, which is what happened.)
  2236. See L<perlfunc/split>.
  2237.  
  2238. =item Stat on unopened file <%s>
  2239.  
  2240. (W) You tried to use the stat() function (or an equivalent file test)
  2241. on a filehandle that was either never opened or has been closed since.
  2242.  
  2243. =item Statement unlikely to be reached
  2244.  
  2245. (W) You did an exec() with some statement after it other than a die().
  2246. This is almost always an error, because exec() never returns unless
  2247. there was a failure.  You probably wanted to use system() instead,
  2248. which does return.  To suppress this warning, put the exec() in a block
  2249. by itself.
  2250.  
  2251. =item Subroutine %s redefined
  2252.  
  2253. (W) You redefined a subroutine.  To suppress this warning, say
  2254.  
  2255.     {
  2256.     local $^W = 0;
  2257.     eval "sub name { ... }";
  2258.     }
  2259.  
  2260. =item Substitution loop
  2261.  
  2262. (P) The substitution was looping infinitely.  (Obviously, a
  2263. substitution shouldn't iterate more times than there are characters of
  2264. input, which is what happened.) See the discussion of substitution in
  2265. L<perlop/"Quote and Quotelike Operators">.
  2266.  
  2267. =item Substitution pattern not terminated
  2268.  
  2269. (F) The lexer couldn't find the interior delimiter of a s/// or s{}{}
  2270. construct.  Remember that bracketing delimiters count nesting level.
  2271.  
  2272. =item Substitution replacement not terminated
  2273.  
  2274. (F) The lexer couldn't find the final delimiter of a s/// or s{}{}
  2275. construct.  Remember that bracketing delimiters count nesting level.
  2276.  
  2277. =item substr outside of string
  2278.  
  2279. (W) You tried to reference a substr() that pointed outside of a string.
  2280. That is, the absolute value of the offset was larger than the length of
  2281. the string.  See L<perlfunc/substr>.
  2282.  
  2283. =item suidperl is no longer needed since...
  2284.  
  2285. (F) Your Perl was compiled with B<-D>SETUID_SCRIPTS_ARE_SECURE_NOW, but a
  2286. version of the setuid emulator somehow got run anyway.
  2287.  
  2288. =item syntax error
  2289.  
  2290. (F) Probably means you had a syntax error.  Common reasons include:
  2291.  
  2292.     A keyword is misspelled.
  2293.     A semicolon is missing.
  2294.     A comma is missing.
  2295.     An opening or closing parenthesis is missing.
  2296.     An opening or closing brace is missing.
  2297.     A closing quote is missing.
  2298.  
  2299. Often there will be another error message associated with the syntax
  2300. error giving more information.  (Sometimes it helps to turn on B<-w>.)
  2301. The error message itself often tells you where it was in the line when
  2302. it decided to give up.  Sometimes the actual error is several tokens
  2303. before this, since Perl is good at understanding random input.
  2304. Occasionally the line number may be misleading, and once in a blue moon
  2305. the only way to figure out what's triggering the error is to call
  2306. C<perl -c> repeatedly, chopping away half the program each time to see
  2307. if the error went away.  Sort of the cybernetic version of S<20 questions>.
  2308.  
  2309. =item syntax error at line %d: `%s' unexpected
  2310.  
  2311. (A) You've accidentally run your script through the Bourne shell 
  2312. instead of Perl.  Check the <#!> line, or manually feed your script
  2313. into Perl yourself.
  2314.  
  2315. =item System V IPC is not implemented on this machine
  2316.  
  2317. (F) You tried to do something with a function beginning with "sem", "shm"
  2318. or "msg".  See L<perlfunc/semctl>, for example.
  2319.  
  2320. =item Syswrite on closed filehandle
  2321.  
  2322. (W) The filehandle you're writing to got itself closed sometime before now.
  2323. Check your logic flow.
  2324.  
  2325. =item tell() on unopened file
  2326.  
  2327. (W) You tried to use the tell() function on a filehandle that was either
  2328. never opened or has been closed since.
  2329.  
  2330. =item Test on unopened file <%s>
  2331.  
  2332. (W) You tried to invoke a file test operator on a filehandle that isn't
  2333. open.  Check your logic.  See also L<perlfunc/-X>.
  2334.  
  2335. =item That use of $[ is unsupported
  2336.  
  2337. (F) Assignment to $[ is now strictly circumscribed, and interpreted as
  2338. a compiler directive.  You may only say one of
  2339.  
  2340.     $[ = 0;
  2341.     $[ = 1;
  2342.     ...
  2343.     local $[ = 0;
  2344.     local $[ = 1;
  2345.     ...
  2346.  
  2347. This is to prevent the problem of one module changing the array base
  2348. out from under another module inadvertently.  See L<perlvar/$[>.
  2349.  
  2350. =item The %s function is unimplemented
  2351.  
  2352. The function indicated isn't implemented on this architecture, according
  2353. to the probings of Configure.
  2354.  
  2355. =item The crypt() function is unimplemented due to excessive paranoia.
  2356.  
  2357. (F) Configure couldn't find the crypt() function on your machine,
  2358. probably because your vendor didn't supply it, probably because they
  2359. think the U.S. Govermnment thinks it's a secret, or at least that they
  2360. will continue to pretend that it is.  And if you quote me on that, I
  2361. will deny it.
  2362.  
  2363. =item The stat preceding C<-l _> wasn't an lstat
  2364.  
  2365. (F) It makes no sense to test the current stat buffer for symbolic linkhood
  2366. if the last stat that wrote to the stat buffer already went past
  2367. the symlink to get to the real file.  Use an actual filename instead.
  2368.  
  2369. =item times not implemented
  2370.  
  2371. (F) Your version of the C library apparently doesn't do times().  I suspect
  2372. you're not running on Unix.
  2373.  
  2374. =item Too few args to syscall
  2375.  
  2376. (F) There has to be at least one argument to syscall() to specify the
  2377. system call to call, silly dilly.
  2378.  
  2379. =item Too many ('s
  2380.  
  2381. =item Too many )'s
  2382.  
  2383. (A) You've accidentally run your script through B<csh> instead
  2384. of Perl.  Check the <#!> line, or manually feed your script
  2385. into Perl yourself.
  2386.  
  2387. =item Too many args to syscall
  2388.  
  2389. (F) Perl only supports a maximum of 14 args to syscall().
  2390.  
  2391. =item Too many arguments for %s
  2392.  
  2393. (F) The function requires fewer arguments than you specified.
  2394.  
  2395. =item trailing \ in regexp
  2396.  
  2397. (F) The regular expression ends with an unbackslashed backslash.  Backslash
  2398. it.   See L<perlre>.
  2399.  
  2400. =item Translation pattern not terminated
  2401.  
  2402. (F) The lexer couldn't find the interior delimiter of a tr/// or tr[][]
  2403. construct.
  2404.  
  2405. =item Translation replacement not terminated
  2406.  
  2407. (F) The lexer couldn't find the final delimiter of a tr/// or tr[][]
  2408. construct.
  2409.  
  2410. =item truncate not implemented
  2411.  
  2412. (F) Your machine doesn't implement a file truncation mechanism that
  2413. Configure knows about.
  2414.  
  2415. =item Type of arg %d to %s must be %s (not %s)
  2416.  
  2417. (F) This function requires the argument in that position to be of a
  2418. certain type.  Arrays must be @NAME or @{EXPR}.  Hashes must be
  2419. %NAME or %{EXPR}.  No implicit dereferencing is allowed--use the
  2420. {EXPR} forms as an explicit dereference.  See L<perlref>.
  2421.  
  2422. =item umask: argument is missing initial 0
  2423.  
  2424. (W) A umask of 222 is incorrect.  It should be 0222, since octal literals
  2425. always start with 0 in Perl, as in C.
  2426.  
  2427. =item Unable to create sub named "%s"
  2428.  
  2429. (F) You attempted to create or access a subroutine with an illegal name.
  2430.  
  2431. =item Unbalanced context: %d more PUSHes than POPs
  2432.  
  2433. (W) The exit code detected an internal inconsistency in how many execution
  2434. contexts were entered and left.
  2435.  
  2436. =item Unbalanced saves: %d more saves than restores
  2437.  
  2438. (W) The exit code detected an internal inconsistency in how many
  2439. values were temporarily localized.
  2440.  
  2441. =item Unbalanced scopes: %d more ENTERs than LEAVEs
  2442.  
  2443. (W) The exit code detected an internal inconsistency in how many blocks
  2444. were entered and left.
  2445.  
  2446. =item Unbalanced tmps: %d more allocs than frees
  2447.  
  2448. (W) The exit code detected an internal inconsistency in how many mortal
  2449. scalars were allocated and freed.
  2450.  
  2451. =item Undefined format "%s" called
  2452.  
  2453. (F) The format indicated doesn't seem to exist.  Perhaps it's really in
  2454. another package?  See L<perlform>.
  2455.  
  2456. =item Undefined sort subroutine "%s" called
  2457.  
  2458. (F) The sort comparison routine specified doesn't seem to exist.  Perhaps
  2459. it's in a different package?  See L<perlfunc/sort>.
  2460.  
  2461. =item Undefined subroutine &%s called
  2462.  
  2463. (F) The subroutine indicated hasn't been defined, or if it was, it
  2464. has since been undefined.
  2465.  
  2466. =item Undefined subroutine called
  2467.  
  2468. (F) The anonymous subroutine you're trying to call hasn't been defined,
  2469. or if it was, it has since been undefined.
  2470.  
  2471. =item Undefined subroutine in sort
  2472.  
  2473. (F) The sort comparison routine specified is declared but doesn't seem to
  2474. have been defined yet.  See L<perlfunc/sort>.
  2475.  
  2476. =item Undefined top format "%s" called
  2477.  
  2478. (F) The format indicated doesn't seem to exist.  Perhaps it's really in
  2479. another package?  See L<perlform>.
  2480.  
  2481. =item unexec of %s into %s failed!
  2482.  
  2483. (F) The unexec() routine failed for some reason.  See your local FSF
  2484. representative, who probably put it there in the first place.
  2485.  
  2486. =item Unknown BYTEORDER
  2487.  
  2488. (F) There are no byteswapping functions for a machine with this byte order.
  2489.  
  2490. =item unmatched () in regexp
  2491.  
  2492. (F) Unbackslashed parentheses must always be balanced in regular
  2493. expressions.  If you're a vi user, the % key is valuable for finding
  2494. the matching paren.  See L<perlre>.
  2495.  
  2496. =item Unmatched right bracket
  2497.  
  2498. (F) The lexer counted more closing curly brackets (braces) than opening
  2499. ones, so you're probably missing an opening bracket.  As a general
  2500. rule, you'll find the missing one (so to speak) near the place you were
  2501. last editing.
  2502.  
  2503. =item unmatched [] in regexp
  2504.  
  2505. (F) The brackets around a character class must match.  If you wish to
  2506. include a closing bracket in a character class, backslash it or put it first.
  2507. See L<perlre>.
  2508.  
  2509. =item Unquoted string "%s" may clash with future reserved word
  2510.  
  2511. (W) You used a bare word that might someday be claimed as a reserved word.
  2512. It's best to put such a word in quotes, or capitalize it somehow, or insert
  2513. an underbar into it.  You might also declare it as a subroutine.
  2514.  
  2515. =item Unrecognized character \%03o ignored
  2516.  
  2517. (S) A garbage character was found in the input, and ignored, in case it's
  2518. a weird control character on an EBCDIC machine, or some such.
  2519.  
  2520. =item Unrecognized signal name "%s"
  2521.  
  2522. (F) You specified a signal name to the kill() function that was not recognized.
  2523. Say C<kill -l> in your shell to see the valid signal names on your system.
  2524.  
  2525. =item Unrecognized switch: -%s
  2526.  
  2527. (F) You specified an illegal option to Perl.  Don't do that.
  2528. (If you think you didn't do that, check the #! line to see if it's
  2529. supplying the bad switch on your behalf.)
  2530.  
  2531. =item Unsuccessful %s on filename containing newline
  2532.  
  2533. (W) A file operation was attempted on a filename, and that operation
  2534. failed, PROBABLY because the filename contained a newline, PROBABLY
  2535. because you forgot to chop() or chomp() it off.  See L<perlfunc/chop>.
  2536.  
  2537. =item Unsupported directory function "%s" called
  2538.  
  2539. (F) Your machine doesn't support opendir() and readdir().
  2540.  
  2541. =item Unsupported function %s
  2542.  
  2543. (F) This machines doesn't implement the indicated function, apparently.
  2544. At least, Configure doesn't think so.
  2545.  
  2546. =item Unsupported socket function "%s" called
  2547.  
  2548. (F) Your machine doesn't support the Berkeley socket mechanism, or at
  2549. least that's what Configure thought.
  2550.  
  2551. =item Unterminated <> operator
  2552.  
  2553. (F) The lexer saw a left angle bracket in a place where it was expecting
  2554. a term, so it's looking for the corresponding right angle bracket, and not
  2555. finding it.  Chances are you left some needed parentheses out earlier in
  2556. the line, and you really meant a "less than".
  2557.  
  2558. =item Use of $# is deprecated
  2559.  
  2560. (D) This was an ill-advised attempt to emulate a poorly defined awk feature.
  2561. Use an explicit printf() or sprintf() instead.
  2562.  
  2563. =item Use of $* is deprecated
  2564.  
  2565. (D) This variable magically turned on multiline pattern matching, both for
  2566. you and for any luckless subroutine that you happen to call.  You should
  2567. use the new C<//m> and C<//s> modifiers now to do that without the dangerous
  2568. action-at-a-distance effects of C<$*>.
  2569.  
  2570. =item Use of %s in printf format not supported
  2571.  
  2572. (F) You attempted to use a feature of printf that is accessible only
  2573. from C.  This usually means there's a better way to do it in Perl.
  2574.  
  2575. =item Use of %s is deprecated
  2576.  
  2577. (D) The construct indicated is no longer recommended for use, generally
  2578. because there's a better way to do it, and also because the old way has
  2579. bad side effects.
  2580.  
  2581. =item Use of bare << to mean <<"" is deprecated
  2582.  
  2583. (D) You are now encouraged to use the explicitly quoted form if you
  2584. wish to use a blank line as the terminator of the here-document.
  2585.  
  2586. =item Use of implicit split to @_ is deprecated
  2587.  
  2588. (D) It makes a lot of work for the compiler when you clobber a
  2589. subroutine's argument list, so it's better if you assign the results of
  2590. a split() explicitly to an array (or list).
  2591.  
  2592. =item Use of uninitialized value
  2593.  
  2594. (W) An undefined value was used as if it were already defined.  It was
  2595. interpreted as a "" or a 0, but maybe it was a mistake.  To suppress this
  2596. warning assign an initial value to your variables.
  2597.  
  2598. =item Useless use of %s in void context
  2599.  
  2600. (W) You did something without a side effect in a context that does nothing
  2601. with the return value, such as a statement that doesn't return a value
  2602. from a block, or the left side of a scalar comma operator.  Very often
  2603. this points not to stupidity on your part, but a failure of Perl to parse
  2604. your program the way you thought it would.  For example, you'd get this
  2605. if you mixed up your C precedence with Python precedence and said
  2606.  
  2607.     $one, $two = 1, 2;
  2608.  
  2609. when you meant to say
  2610.  
  2611.     ($one, $two) = (1, 2);
  2612.  
  2613. Another common error is to use ordinary parentheses to construct a list
  2614. reference when you should be using square or curly brackets, for
  2615. example, if you say
  2616.  
  2617.     $array = (1,2);
  2618.  
  2619. when you should have said
  2620.  
  2621.     $array = [1,2];
  2622.  
  2623. The square brackets explicitly turn a list value into a scalar value,
  2624. while parentheses do not.  So when a parenthesized list is evaluated in
  2625. a scalar context, the comma is treated like C's comma operator, which
  2626. throws away the left argument, which is not what you want.  See
  2627. L<perlref> for more on this.
  2628.  
  2629. =item Variable "%s" is not exported
  2630.  
  2631. (F) While "use strict" in effect, you referred to a global variable
  2632. that you apparently thought was imported from another module, because
  2633. something else of the same name (usually a subroutine) is exported
  2634. by that module.  It usually means you put the wrong funny character
  2635. on the front of your variable.
  2636.  
  2637. =item Variable syntax.
  2638.  
  2639. (A) You've accidentally run your script through B<csh> instead
  2640. of Perl.  Check the <#!> line, or manually feed your script
  2641. into Perl yourself.
  2642.  
  2643. =item Warning: unable to close filehandle %s properly.
  2644.  
  2645. (S) The implicit close() done by an open() got an error indication on the 
  2646. close(0.  This usually indicates your filesystem ran out of disk space.
  2647.  
  2648. =item Warning: Use of "%s" without parens is ambiguous
  2649.  
  2650. (S) You wrote a unary operator followed by something that looks like a
  2651. binary operator that could also have been interpreted as a term or
  2652. unary operator.  For instance, if you know that the rand function
  2653. has a default argument of 1.0, and you write
  2654.  
  2655.     rand + 5;
  2656.  
  2657. you may THINK you wrote the same thing as
  2658.  
  2659.     rand() + 5;
  2660.  
  2661. but in actual fact, you got
  2662.  
  2663.     rand(+5);
  2664.  
  2665. So put in parens to say what you really mean.
  2666.  
  2667. =item Write on closed filehandle
  2668.  
  2669. (W) The filehandle you're writing to got itself closed sometime before now.
  2670. Check your logic flow.
  2671.  
  2672. =item X outside of string
  2673.  
  2674. (F) You had a pack template that specified a relative position before
  2675. the beginning of the string being unpacked.  See L<perlfunc/pack>.
  2676.  
  2677. =item x outside of string
  2678.  
  2679. (F) You had a pack template that specified a relative position after
  2680. the end of the string being unpacked.  See L<perlfunc/pack>.
  2681.  
  2682. =item Xsub "%s" called in sort
  2683.  
  2684. (F) The use of an external subroutine as a sort comparison is not yet supported.
  2685.  
  2686. =item Xsub called in sort
  2687.  
  2688. (F) The use of an external subroutine as a sort comparison is not yet supported.
  2689.  
  2690. =item You can't use C<-l> on a filehandle
  2691.  
  2692. (F) A filehandle represents an opened file, and when you opened the file it
  2693. already went past any symlink you are presumably trying to look for.
  2694. Use a filename instead.
  2695.  
  2696. =item YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!
  2697.  
  2698. (F) And you probably never will, since you probably don't have the
  2699. sources to your kernel, and your vendor probably doesn't give a rip
  2700. about what you want.  Your best bet is to use the wrapsuid script in
  2701. the eg directory to put a setuid C wrapper around your script.
  2702.  
  2703. =item You need to quote "%s"
  2704.  
  2705. (W) You assigned a bareword as a signal handler name.  Unfortunately, you
  2706. already have a subroutine of that name declared, which means that Perl 5
  2707. will try to call the subroutine when the assignment is executed, which is
  2708. probably not what you want.  (If it IS what you want, put an & in front.)
  2709.  
  2710. =item [gs]etsockopt() on closed fd
  2711.  
  2712. (W) You tried to get or set a socket option on a closed socket.
  2713. Did you forget to check the return value of your socket() call?
  2714. See L<perlfunc/getsockopt>.
  2715.  
  2716. =item \1 better written as $1
  2717.  
  2718. (W) Outside of patterns, backreferences live on as variables.  The use
  2719. of backslashes is grandfathered on the righthand side of a
  2720. substitution, but stylistically it's better to use the variable form
  2721. because other Perl programmers will expect it, and it works better
  2722. if there are more than 9 backreferences.
  2723.  
  2724. =item '|' and '<' may not both be specified on command line
  2725.  
  2726. (F) An error peculiar to VMS.  Perl does its own command line redirection, and
  2727. found that STDIN was a pipe, and that you also tried to redirect STDIN using
  2728. '<'.  Only one STDIN stream to a customer, please.
  2729.  
  2730. =item '|' and '>' may not both be specified on command line
  2731.  
  2732. (F) An error peculiar to VMS.  Perl does its own command line redirection, and
  2733. thinks you tried to redirect stdout both to a file and into a pipe to another
  2734. command.  You need to choose one or the other, though nothing's stopping you
  2735. from piping into a program or Perl script which 'splits' output into two
  2736. streams, such as
  2737.  
  2738.     open(OUT,">$ARGV[0]") or die "Can't write to $ARGV[0]: $!";
  2739.     while (<STDIN>) {
  2740.         print;
  2741.         print OUT;
  2742.     }
  2743.     close OUT;
  2744.  
  2745. =back
  2746.  
  2747.