Port nucleotide counting to perl5