in reply to Re: substrings that consist of repeating characters
in thread substrings that consist of repeating characters

A slight simplification can be gained by using the 'nsort_by' function from List::UtilsBy (or its XS equivalent). You can also use the special variable '$,' rather than 'join' to control the print.
use strict; use warnings; use List::UtilsBy::XS qw(nsort_by); my $string = "AAATTTAGTTCTTAAGGCTGACATCGGTTTACGTCAGCGTTACCCCCCAAGTTATT +GGGGACTTT"; my @matches; push @matches, $& while ($string=~m/([AGCT])\1+/g); local $, = "\n"; print nsort_by {length} @matches ;
Bill