in reply to Removing chars from a word from an array
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 Section
Seekers of Perl Wisdom