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
In reply to Re^5: Using eval to s/// with a pattern supplied on the command-line
by Limbic~Region
in thread Using eval to s/// with a pattern supplied on the command-line
by ChrisS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |