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

Re^3: How do I write subs that take bare blocks as args?

by Aristotle (Chancellor)
on Jun 28, 2002 at 16:03 UTC ( #178047=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: How do I write subs that take bare blocks as args?
in thread How do I write subs that take bare blocks as args?

Why so complicated? :)

if(not grep { $_->price > 1000 } @product_list) { # do stuff }
Update:
my @p = (0,2,4,5,2,5,7,7); print "1: none\n" if not grep { $_ > 1000 } @p; push @p, 1002; print "2: none\n" if not grep { $_ > 1000 } @p; =output 1: none
____________
Makeshifts last the longest.


Comment on Re^3: How do I write subs that take bare blocks as args?
Select or Download Code
Re: Re^3: How do I write subs that take bare blocks as args?
by Anonymous Monk on Jun 28, 2002 at 16:23 UTC
    Why so complicated? :)

    And your idea of uncomplicating things is to make them not work as desired?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2014-07-31 15:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (249 votes), past polls