in reply to Contiguous characters BLAST

The unpack approach is probably fastest, but here's a regex way that doesn't require shortening the output array:

>perl -wMstrict -le "my $len = 4; my $seq = 'qwertyuiop' ;; my @contigs = $seq =~ m{ (?= (.{$len})) }xmsg; printf qq{'$_' } for @contigs; " 'qwer' 'wert' 'erty' 'rtyu' 'tyui' 'yuio' 'uiop'