in reply to How can I combine backreferences and regex interpolation?

You can eval it:
% cat x.pl $_ = 'foo'; $lhs = '(.)oo'; $rhs = '\1ar'; eval "s/$lhs/$rhs/"; print "$_\n"; % perl x.pl far %