Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: comparing lists and getting an exemtion report

by Riales (Hermit)
on Apr 20, 2012 at 18:39 UTC ( #966233=note: print w/ replies, xml ) Need Help??


in reply to comparing lists and getting an exemtion report

How big are these lists? If they're not incredibly large, something like this should work:

# Assuming @list_a and @list_b my %b; $b{$_} = 1 foreach (@list_b); my @list_c; foreach (@list_a) { push @list_c, $_ unless $b{$_}; }


Comment on Re: comparing lists and getting an exemtion report
Download Code
Re^2: comparing lists and getting an exemtion report
by brx (Pilgrim) on Apr 20, 2012 at 19:43 UTC
    # Assuming @list_a and @list_b my %b; $b{$_} = 1 foreach (@list_b); my @list_c = grep { not $b{$_} } @list_a;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-08-30 02:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls