my $num_chars = 0; <>; while ( <> ) { do {print "$num_chars\n"; $num_chars = 0; next} if /^>/; $num_chars += tr/ACGT/ACGT/; } print "$num_chars\n";