Or take advantage of the fact that foreach aliases the counter variable to the actual element of the list with the following:for my $i (0..$#array) { $array[$i] =~ s/x//g; }
That can also be written asforeach (@array) { s/x//g; }
s/x//g foreach @array;
Update: Due to distractions, I incorrectly read the OP's question.
In reply to Re: Removing chars from a word from an array
by ikegami
in thread Removing chars from a word from an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |