1 2 3 4 5 6
$string='GAAGANNNNNNNNNNACGCATACTACCGGTGCCCAGCTGCCATNNNNNNNGAGAGAGATCNNNNNNGAGANNNNNNNATTCTCTNNNNCTCAGATCCNNNNNNNNNNNNNNNNNNNNNGAGA'; (@ns) = $string =~ /N+/g; print 'Länge der Ns',"\n"; for (sort @ns) { print length($_),"\n"; }
2013-03-07T14:02:24 ingobullaHallo,
ich habe Strings der Art
GAAGANNNNNNNNNNACGCATACTACCGGTGCCCAGCTGCCATNNNNNNNNNNNNNNNNNNNNNATTCTTCT
und möchte herausfinden, wie lang jeweils die längste Kette von N's ist.
perl -E'use List::Util qw(max); say max(map length, "GAAGANNNNNNNNNNACGCATACTACCGGTGCCCAGCTGCCATNNNNNNNNNNNNNNNNNNNNNATTCTTCT" =~ m/(N+)/g)'