in reply to How can I combine backreferences and regex interpolation?
% cat x.pl $_ = 'foo'; $lhs = '(.)oo'; $rhs = '\1ar'; eval "s/$lhs/$rhs/"; print "$_\n"; % perl x.pl far % [download]