in reply to Reii: Should we Localize $_ ?
in thread Should we Localize $_ ?
sub doit { my @array = qw(1 2 3 4); # this doesn't damage outer @array: $_ = 'xyz' foreach (@array); } my @array = qw(a b c d); print join("|", @array), "\n"; foreach (@array) { my $f = doit('abcd'); } print join("|", @array), "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Reii: Should we Localize $_ ?
by dragonchild (Archbishop) on Jun 13, 2001 at 23:52 UTC | |
|
Reiv: Should we Localize $_ ?
by John M. Dlugosz (Monsignor) on Jun 13, 2001 at 23:56 UTC |