Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How do I pick anything that is in array A that is NOT in array B

by Anonymous Monk
on Jun 30, 2000 at 12:20 UTC ( [id://20562]=note: print w/replies, xml ) Need Help??


in reply to How do I pick anything that is in array A that is NOT in array B

The lingo for your desired operation is the difference of two arrays. This has already been answerd in How can I find the union/difference/intersection of two arrays?. Here's another solution which doesn't use a set hash:
@a_minus_b = grep { my $a = $_; not grep { $a eq $_ } @b } @a;
  • Comment on Re: How do I pick anything that is in array A that is NOT in array B
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-18 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found