Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Confusing syntax error with grep

by ysth (Canon)
on Aug 12, 2004 at 18:48 UTC ( #382427=note: print w/replies, xml ) Need Help??

in reply to Re^2: Confusing syntax error with grep
in thread Confusing syntax error with grep

Of course it would be even nicer if there was a construct in perl like:    { do_something( $_) } forall ( @alist ) where { condition( $_ ) }
You mean like: do_something( $_ ) for grep condition( $_ ), @alist; ?

Update: condition( $_ ) and do_something( $_ ) for @alist; is going to be faster because it doesn't have to loop twice.

Replies are listed 'Best First'.
Re^4: Confusing syntax error with grep
by gumpu (Friar) on Aug 12, 2004 at 19:45 UTC

    That comes pretty close yes :)

    Have Fun

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2023-02-06 08:56 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (33 votes). Check out past polls.