$replace = '$1 thirdword'; ($varsub = $string) =~ s/$search/$replace/;