my %newhash = # keys/values into a hash map { $_ => $hash{$_} } # a list of keys/values grep { foo($hash{$_}) # just the keys we want and bar($hash{$_}) } keys %hash; # a list of keys in %hash