while (my ($key, $value) = each %hash)) { if ($value =~ /\D/) { [...] } }