in reply to Re: nuances of my, and maybe local
in thread nuances of my, and maybe local

my $fred = "foo"; for (my $idx = 1; $idx <= 10; $idx++) { #Changed this line to my my $fred = "blah"; # $fred = $fred x $idx; print $fred, "\n" # foo, foofoo, foofoofoo... } print $fred, "\n"; # foo

Outputs:
./test.pl blah blahblah blahblahblah blahblahblahblah blahblahblahblahblah blahblahblahblahblahblah blahblahblahblahblahblahblah blahblahblahblahblahblahblahblah blahblahblahblahblahblahblahblahblah blahblahblahblahblahblahblahblahblahblah foo
So it looks like my will at least hide the value of the outer scope's version of $fred. More confusion, I have not read the links below yet.....

Thanks!