in reply to Re^2: Search & Replace in an Array
in thread Search & Replace in an Array
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Search & Replace in an Array
by AnomalousMonk (Archbishop) on Jan 27, 2010 at 17:35 UTC |