in reply to RESOLVED: Slurping search-replace patterns from a file
... patterns.txt contains:s/foo/bar/ s/(fo)o/bar$1/
Because your input file appears to contain perl code, I suspect you can get by with eval:
while(my $line = <FILE>) { chomp; eval "\$string =~ $line; 1" or die $@; }
-Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Slurping search-replace patterns from a file
by HKS (Acolyte) on Oct 14, 2008 at 15:52 UTC | |
by jettero (Monsignor) on Oct 14, 2008 at 16:43 UTC |