in reply to Re: substr help
in thread substr help

You could also do it with a regexp.
Which would look something like:
my $dna = 'accatgagctgtacgtagcatctgagcgcgcatgactgtgactgacgtaggcagca'; my $increment = 3; my $substr = 10; my @windows = $dna=~/(?=(.{$substr})).{$increment}/gs; print "$_\n" for @windows;