in reply to Re: Simple question about foreach and my.
in thread Simple question about foreach and my.
In older Perl's I write like this:
which keeps the loop variable private. (At the cost of opening yourself up to wiping out your array if you call something that walks over $_ unexpectedly.)foreach (@array) { my $var = $_; # ... }
|
|---|