in reply to How to count the number of chars in a string

You don't need to match the non-digits when counting digits, the regex engine will happily skip over them. So, you can shorten the line to
my $count = () = /\d/g;

If you need to count the characters in a tight loop, note that tr is faster than regex match:

my $count = tr/0-9//;

Hashes are usually used when you're interested in frequencies of the individual characters.

my %freq; ++$freq{$_} for split //;

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]