go ahead... be a heretic | |
PerlMonks |
Re^2: Using hashes for set operations...by LanX (Saint) |
on May 23, 2011 at 08:51 UTC ( [id://906264]=note: print w/replies, xml ) | Need Help?? |
Hmm interesting! I was sure that using De Morgan's laws would just relocate the problem and not solve it. (you're now only deleting hash-slices) But this relocation makes sense ... now it works for all cases where "undef" isn't allowed as part of an initial set. (undef deletes empty strings). But you shouldn't use print to inspect data structures:
prints
But while you found a mathematical solution, needing so many operations for an intersection is in practice a little disappointing ... Thanks anyway! :)
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|