Hi japhy
Not to beat a dead horse here, but to answer your question:
I'm checking the keys in another hash against those in %keepers. If a keys exists in this other hash, but NOT in %keepers, I want to eliminate it from the hash. See this node for further explanation.
Anyways, thanks for the clarification
njcodewarrior
| [reply] [Watch: Dir/Any] [d/l] [select] |
Right. My point is, why not loop over the elements in @keepers, rather than the keys of the other hash?
my %big_hash = (...);
my @to_keep = ('abc', 'xyz');
%big_hash = map { exists($big_hash{$_}) ? ($_ => $big_hash{$_}) : () }
+ @to_keep;
# or
%big_hash = map { $_ => $big_hash{$_} } grep { exists $big_hash{$_} }
+@to_keep;
| [reply] [Watch: Dir/Any] [d/l] [select] |