in reply to RESOLVED: Slurping search-replace patterns from a file

just add the /e modifier.
$string =~ s/$search/$parts[2]/e;
Update:
As for the $1 being pulled as a literal string, more info is needed. Could be you're trying to use it like this:
s/(.{60})/$1/g which works fine..
if you need it in the same expression use a back reference \1:
perlretut: /\b(\w\w\w)\s\1\b/;
Update: Miss understood what you were trying to do, recently had to get a sub routine call in a s/// sorry. John

Replies are listed 'Best First'.
Re^2: Slurping search-replace patterns from a file
by JavaFan (Canon) on Oct 14, 2008 at 15:20 UTC
    With just one /e modifier, you keep the $1. A trivial test would have shown that:
    $ perl -wE '$r = q{bar$1}; $_ = "foo"; s/(fo)o/$r/e; say' bar$1