Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by gopalr (Priest)
on Mar 31, 2006 at 09:50 UTC ( #540425=note: print w/ replies, xml ) Need Help??


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

Hi tsk1979 ,

There is a module List::Compare will do that work.

use strict; use warnings; use List::Compare; my @a = qw(-true -depth=1); my @b = qw(-search -depth=1 -true -expand_all) ; my $lc = List::Compare->new( \@a, \@b ); my @a_only = $lc->get_Lonly; my @b_only = $lc->get_Ronly; print join( ', ', @a_only ), "\n"; # 1, 2 @a_only ? print "@a_only" : print "\nAll Matched";


Comment on Re: Finding wether all elements of one array are in another
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-09-18 23:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (126 votes), past polls