Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://499783]
help
Chatterbox?
[LanX]: before digging into deep debugging ... I have a strange UTF8 problem, probably it rings a bell:
[LanX]: two utf8 strings from different sources are base64 encoded, but after joining both the umlauts in teh second get deleted
[Corion]: LanX: You can't just join two base64 strings together
[LanX]: (not a high priority bug because I can use some HTML entities in the second string)
[Corion]: base64 is padded to a multiple of 4 chars (or something)

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-01-16 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (150 votes). Check out past polls.