$Acount = $line =~ tr/A/A/; #### $chars{$_}++ for split //, $line; #### $chars[ord $_]++ for split //, $line;