in reply to Iterating over string

This gathers the same information (ie. counts character at position in the string), and runs roughly 40 times faster.

(Faster still if you don't need the tr///).

my %c; $string =~ tr[ACGT][N]c; $c{ substr $string, $_, 1 }[ $_ ]++ for 0 .. length( $string )-1;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"