in reply to Adding gaps to a sequence
sub gapify { my $s = shift; return join '-', map(substr($s, 0, $_, ''), @_), # runs of the string $s; # the remainder of the string } [download]