while (my ($key,$value) = each(%no)) { if ($value =~/$search/gi) { $contains++; } }