local $_ = $string; my $total; for my $letter (qw(A C G T)) { my $count =()= /$letter/g; print "$letter: $count\n"; $total += $count; } my $other = length($_) - $total; print "Other: $other\n";