Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: comparing lists and getting an exemtion report

by Kenosis (Priest)
on Apr 20, 2012 at 19:56 UTC ( #966248=note: print w/replies, xml ) Need Help??


in reply to comparing lists and getting an exemtion report

Although not as nicely readable as Riales's solution, here's another option:

map{$setB{$_}++}@listB; @listC = grep{!$setB{$_}}@listA;

Hope this helps!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://966248]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2017-11-21 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (296 votes). Check out past polls.

    Notices?