D
dan
Howdy,
The code:
use strict;
my $foo = 0;
for $foo (0,1) {
print "$foo\n";
}
print "$foo\n";
outputs
0
1
0
So $foo comes out of the loop unchanged. OK, if thats how it works, then
why complain if I write
use strict;
my $foo = 0;
for $mistake (0,1) {
print "$foo\n";
}
print "$foo\n";
which outputs
Global symbol "$mistake" requires explicit package name ...?
Since it complains, this implies that in the first case, $foo would come
out of the loop with value 1, doesn't it?
The code:
use strict;
my $foo = 0;
for $foo (0,1) {
print "$foo\n";
}
print "$foo\n";
outputs
0
1
0
So $foo comes out of the loop unchanged. OK, if thats how it works, then
why complain if I write
use strict;
my $foo = 0;
for $mistake (0,1) {
print "$foo\n";
}
print "$foo\n";
which outputs
Global symbol "$mistake" requires explicit package name ...?
Since it complains, this implies that in the first case, $foo would come
out of the loop with value 1, doesn't it?