$lhs = '(.)oo'; $rhs = '\1ar'; s/$lhs/$rhs/; # I want to turn foo into far