in reply to how to count matches

You can also count all the letters this way:
#!/usr/bin/perl -w use strict; my $string = q<ABCDABDIDAOFOOFAA>; my %count; for (split(//, $string)){$count{$_}++;} print(q<Matches >, $count{A}, "\n");
This way you can choose which letter's count you wish to view ;)