in reply to Set theory in Perl
Set::Scalar will (most probably) do what you want. Using it you can create sets of scalars (strings, numbers, etc) and perform all the usual set operations on them.
Hope this helps, -gjb-