$ perl -E ' > $seq = q{NNACGTNNNACGTNACGTNN}; > say for grep length, split m{N+}, $seq;' ACGT ACGT ACGT $