... 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
In reply to Re: Slurping search-replace patterns from a file
by jettero
in thread RESOLVED: Slurping search-replace patterns from a file
by HKS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |