my @crl = grep { /^$c*/ } @lfq; my @res = grep { !/^$c*/ } @lfq; push @crl, @res;