foreach (@array) { my $i = $_; # $i is a copy. ... } #### foreach (@array) { local $_ = $_; # $_ is a copy. ... }