while or for loop will work fine but u need to use substitute command for substituting the pattern.
my $length = scalar @arr; for (my $i =0; $i <= $length; $i++){ $arr[$i] =~ s/<pattern>/<pattern to be changed to>/g; } print "@arr";
In reply to Re^3: Search & Replace in an Array
by snape
in thread Search & Replace in an Array
by Saved
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |