in reply to The return value of m//

++$count while $a =~ /\d+/g;
or $count = $a =~ s/\d+\K//g;

By the way, DON'T use $a as a variable! It is used for sort.