Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Difference between two arrays - is there a better way?

by BrowserUk (Pope)
on Aug 09, 2011 at 09:06 UTC ( #919425=note: print w/replies, xml ) Need Help??

in reply to Difference between two arrays - is there a better way?

is there another clever way

Another way for sure. Whether it is "clever"?

@list1 = (1, 2, 3, 4, 5); @list2 = (2, 3, 4);; @diff{ @list2 }= ();; print grep !exists($diff{$_}), @list1;; 1 5

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2019-02-21 02:15 GMT
Find Nodes?
    Voting Booth?
    I use postfix dereferencing ...

    Results (108 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!