in reply to Set Operators

Take a look at quantum-superpositions on cpan.

----
Zak
Pluralitas non est ponenda sine neccesitate - mysql's philosphy

Replies are listed 'Best First'.
Re: Re: Set Operators
by Bird (Pilgrim) on Oct 25, 2002 at 14:08 UTC

    Just because I like Quantum::Superpositions, I thought I'd provide an example.

    use Quantum::Superpositions; my @set = (1, 2, 3, 4, 5); print "3 is a member!\n" if 3 == any(@set); print "8 is a member!\n" if 8 == any(@set);

    Admittedly, this isn't the fastest solution (see the responses above for those), but it maps well to how I like to think about set operations. Sacrificing speed for clarity. :)

    -Bird