Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Check if element in One Array Exist in Other Array

by gopalr (Priest)
on Oct 13, 2005 at 06:18 UTC ( #499783=note: print w/ replies, xml ) Need Help??


in reply to Check if element in One Array Exist in Other Array

Take a look at List::Compare::Functional Module.

Update

use List::Compare::Functional qw(is_LsubsetR); $test1 = ['A','D','B']; $test2 = ['A','C','B']; $source = ['A','B','C','A','B']; $result = is_LsubsetR( [ $test1, $source ] ); $result == 1 ? print "\n\$test1 is True" : print "\n\$test1 is False"; $result = is_LsubsetR( [ $test2, $source ] ); $result == 1 ? print "\n\$test2 is True" : print "\n\$test2 is False";

OUTPUT

$test1 is False $test2 is True


Comment on Re: Check if element in One Array Exist in Other Array
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-12-20 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls