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 ( [id://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";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-16 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found