in reply to Replace the last letter
$variable = reverse $string; $variable =~ s/$tofind/$replace/; $variable = reverse $string; [download]