#!perl -w use strict; # perl polya.pl pccx1.dna # This could miss a poly a tail that was caught between spaces my $poly_a_tail_search = qr/a{2,}ta{3,}/io; my $count = 0; while ( <> ) { while ( /$poly_a_tail_search/g ) { ++$count; } if ( eof ) { print "File: ", $ARGV, "\tNumber of poly a tails: ", $count, "\n"; $count = 0; } } exit(0);