The problem is how to define equity once you start slinging around tied or overloaded objects. By equal value, by equal reference, or by entirely different semantics? It's a question with very individual replies depending on the situation, and there can't be a universal solution. As for the undef, which is actually a common case, you are right, I had forgotten about that, even though
I've fixed it before.
my @new = do{
my (%seen, $seen_undef);
grep defined ? !$seen{$_}++ : !$seen_undef++, @a, @b, @c, @d;
};
Makeshifts last the longest.