use strict; use warnings; my $str = 'arbitrary length string.xxx'; substr($str, -1, 1) = chr(ord(substr($str, -1, 1))+1); print $str;