in reply to Re: Consise way to filter out keys with undef values from a hash slice?
in thread Consise way to filter out keys with undef values from a hash slice?
Otherwise (ab)using hashes for set operations like intersections would be trivial.
Though off-topic here: Is there a common idiom for an intersection of two hash-sets? The first thing that comes to my mind is something like:
%a_b = map {exists $b{$_} ? ($_ => $b{$_}) : ()} keys %a;
Greetings,
-jo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Consise way to filter out keys with undef values from a hash slice?
by LanX (Saint) on Jun 02, 2020 at 22:54 UTC |