in reply to Adding formatting to a string
my $string = "ABCDEFGH"; $string = sprintf("%.4s-%s", $string,substr($string,4,4)); [download]