in reply to Re^4: Using eval to s/// with a pattern supplied on the command-line
in thread Using eval to s/// with a pattern supplied on the command-line
You find the underlying array being modified. If the thing being looped over can't be modified you can't change the looping variable. You need to make an explicit copy if you want to do that.my @word = qw(one two three four five); for ( @word ) { $_ = uc( $_ ); } print "$_\n" for @word;
Cheers - L~R
|
|---|