my $a = 'abcde'; substr( $a, 2, 2 ) = 'xyz'; print( "$a\n" ); # abxyze