Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Finding wether all elements of one array are in another

by unobe (Scribe)
on Apr 02, 2006 at 05:16 UTC ( #540706=note: print w/replies, xml ) Need Help??


in reply to Finding wether all elements of one array are in another

Eigenstates, baby! ;-)
use Quantum::Superpositions; @a = qw(-true -depth=1); @b = qw(-search -depth=1 -true -expand_all...); @c = qw(-true -depth=1 -height); print "right" unless eigenstates(any(@a) ne all(@b)); print "wrong" unless eigenstates(any(@c) ne all(@b));
Output:
right

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://540706]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2016-09-26 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (483 votes). Check out past polls.