in reply to Re: how can I speed up this perl??
in thread how can I speed up this perl??

Thanks Abigail-II, but i'm new and dont get how this.. where do I define each pair e.g. $counts == aa. ? how does this counter know what to look for?

Replies are listed 'Best First'.
Re: how can I speed up this perl??
by Abigail-II (Bishop) on Nov 24, 2003 at 11:18 UTC
    It's a hash. If you encounter "aa", it'll add 1 to its "aa" entry. If you encounter "cg", it'll add 1 to its "cg" entry, etc.

    Abigail

      so how do I access the frequency of each pair using your code?

        You access the data by supplying the hash key. so print $counts{tt}; would print the frequency of tt occurences.

        Do you know what a hash is?

        Abigail