my $string = "abababa"; $string = reverse $string; $string =~ s/b/x/; $string = reverse $string; print $string,$/;