>>794がベストだろ。
念のために書き直すと
my $str = "aaabbbccc";
my $count = ( $str =~ tr/a/a/ );
print $count;

だが>>788のようなウンコちゃんは目で数えやがれ