in reply to Find and Replace from File List
my($pattern) = 0; while (<INPUT>) { if ($_ =~ s/$searchPattern1/$replacePattern1/g) { $pattern = 1; } elsif ($_ =~ s/$searchPattern2/$replacePattern2/g) { $pattern = 2; } elsif ($_ =~ s/$searchPattern3/$replacePattern3/g) { $pattern = 3; } print OUTPUT $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find and Replace from File List
by PyrexKidd (Monk) on May 28, 2010 at 15:48 UTC |