locked_user sundialsvc4 has asked for the wisdom of the Perl Monks concerning the following question:
Wow. I just encountered my first bona-fide bug in Perl. (“ v5.10.0 built for aix-64all”)
I encountered the following message and could not make it go away:
Bareword "state" not allowed while "strict subs" in use at alljobs.pl line 47. alljobs.pl had compilation errors.
But in the line cited by the message, state was obviously not a bareword:
$state = 1;
Finally, somewhat in desperation now, I enclosed the line with statements to suppress the error:
no strict 'subs';$state = 1; use strict 'subs';
And this time when I checked the syntax, I got a different message:
Unquoted string "state" may clash with future reserved word at alljobs +.pl line 63.
And, voilá! A bareword occurrence of the variable state did exist...
state = 5;
... but on line 63, not 47.
Okay, sure... it’s a very small insect. The syntax error that Perl had caught did, in fact, exist. But it did not occur at the location cited in the message. (The message seems to have cited the first line, other than the variable-declaration itself, where the offending variable was used.)
So... the take-away for all this is... “just be aware of it.”
Replies are listed 'Best First'. | |
---|---|
Re: Interesting: a genuine Perl-bug
by JavaFan (Canon) on Sep 22, 2010 at 13:16 UTC | |
Re: Interesting: a genuine Perl-bug
by bobr (Monk) on Sep 22, 2010 at 14:13 UTC | |
Re: Interesting: a genuine Perl-bug
by locked_user sundialsvc4 (Abbot) on Sep 22, 2010 at 13:31 UTC | |
by toolic (Bishop) on Sep 22, 2010 at 14:05 UTC | |
by tye (Sage) on Sep 22, 2010 at 14:00 UTC | |
Re: Interesting: a genuine Perl-bug
by locked_user sundialsvc4 (Abbot) on Sep 22, 2010 at 15:06 UTC | |
Re: Interesting: a genuine Perl-bug
by locked_user sundialsvc4 (Abbot) on Sep 22, 2010 at 19:21 UTC | |
by liverpole (Monsignor) on Sep 23, 2010 at 00:21 UTC | |
by Anonymous Monk on Sep 22, 2010 at 19:57 UTC |