Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: how to select which words have Y and W

by johngg (Canon)
on Dec 26, 2013 at 12:13 UTC ( [id://1068425]=note: print w/replies, xml ) Need Help??


in reply to Re: how to select which words have Y and W
in thread how to select which words have Y and W

Of course it's possible, just place a conditional in the grep.

$ perl -Mstrict -Mwarnings -E ' my @array = ( 12, -85, 36, -10, 75, -38 ); say qq{@array}; my @notNegatives = grep { $_ >= 0 } @array; say qq{@notNegatives};' 12 -85 36 -10 75 -38 12 36 75 $

I hope this is helpful.

Cheers,

JohnGG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2024-04-18 16:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found