my %count_of; if (/([ACDEFGHIKLMNPQRSTVWY])/) { $count_of{$1}++ } #### print RESULT join ' ', $id, map $count_of{$_}/$tt, qw/A C D E F G H I K L M N P Q R S T V W Y/; print "\n";