in reply to Set theory in Perl

I believe you should be able to find such code in the Set:: modules, such as Set::Bag, Set::Array and Set::Hash.
HTH

_________
broquaint