use strict; within loop why " my auto-increment " dont increase.
- Hi Members,
My question :- Could members please help me to understand why $b is not
incremented within the while loop below.
Just a comment :-
Originally, I always thought that in using strict, it is mandatory that I
declare all new variables with a 'my'. Correct me if I am wrong, however now
I dont think so as this will prevent us from globalising a variable within a
block, I have to thank Michael R. Wolf for this.
my $b++; # why it did not increment?
print "\$a = $a\n"; # $a = 10 as expected.
print "\$b = $b\n"; # $b returns undef, I understand this.
Do You Yahoo!?
Get your free @... address at http://mail.yahoo.com