Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Best way to remove elem of for loop

by hdb (Monsignor)
on Apr 24, 2014 at 14:41 UTC ( [id://1083615]=note: print w/replies, xml ) Need Help??


in reply to Best way to remove elem of for loop

Have a look at grep:

@ar = grep { -d $_ } @ar;

Replies are listed 'Best First'.
Re^2: Best way to remove elem of for loop
by Preceptor (Deacon) on Apr 24, 2014 at 14:45 UTC

    Hmm, that's good. I had made the link between 'map' and 'grep' being similar, but it hadn't sunk in that you can apply an EXPR to grep, as well as a pattern.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2025-11-10 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (66 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.