This prints:use strict; use warnings; while (<DATA>) { chomp; my ($pat, $repl) = (split '/') [1, 2]; my $s = "foo"; $s =~ s/$pat/qq{"$repl"}/ee; say $s; } __DATA__ s/foo/bar/ s/(fo)o/bar$1/
bar barfo
In reply to Re: Slurping search-replace patterns from a file
by JavaFan
in thread RESOLVED: Slurping search-replace patterns from a file
by HKS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |