my $length =()= $foo =~ /[0-9]/g; print "$foo has $length digit(s)";