Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 lurking in the Monastery: (19)
As of 2015-07-06 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls