in reply to Re: How can I get correct result in counting 3-letter words?
in thread How can I get correct result in counting 3-letter words?

That does not complile (missing $ sigil).

did you mean the second line to read

++$counts{uc($_)} for $a =~ /[TCAG]{3}/sg;
With that, I get the counts the OP expects.

             All great truths begin as blasphemies.
                   ― George Bernard Shaw, writer, Nobel laureate (1856-1950)