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'
In reply to Re: Contiguous characters BLAST
by AnomalousMonk
in thread Contiguous characters BLAST
by etheral
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |