$ cat foo.pl my $state = 0; print "state = $state\n"; $state = 1; print "state = $state\n"; $state = 4; print "state = $state\n"; state = 5; print "state = $state\n"; $ $ perl -Mstrict foo.pl Can't modify constant item in scalar assignment at foo.pl line 7, near + "5;" Bareword "state" not allowed while "strict subs" in use at foo.pl line + 7. Execution of foo.pl aborted due to compilation errors. $ $ perl -v This is perl, v5.10.0 built for x86_64-linux Copyright 1987-2007, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. $
I also tried Perl versions 5.8.8 and 5.12.0.
In reply to Re^2: Interesting: a genuine Perl-bug
by toolic
in thread Interesting: a genuine Perl-bug
by locked_user sundialsvc4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |