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

Re^2: Subtracting Lists

by blazar (Canon)
on Jun 02, 2008 at 17:14 UTC ( #689718=note: print w/ replies, xml ) Need Help??


in reply to Re: Subtracting Lists
in thread Subtracting Lists

I personally believe that

@y = map { condition($_) ? $_ : () } @x;

is generally spelt

@y = grep { condition($_) } @x;

Of course, you have the condition reversed, but then a ! would do, and I doubt it would impose a considerable penalty in terms of efficience.

--
If you can't understand the incipit, then please check the IPB Campaign.


Comment on Re^2: Subtracting Lists
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-07-04 11:13 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 (59 votes), past polls