while (my ($key,$value) = each %foo) { } #### $count = () = $string =~ /-\d+/g;