Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Foreach loop

by pvaldes (Chaplain)
on Sep 27, 2013 at 11:03 UTC ( #1055965=note: print w/replies, xml ) Need Help??


in reply to Foreach loop

How can I check if a value "X" is in the array?

use List::MoreUtils qw{any}; my @array = (1, 2, 3, 4, 5, 6, 7, "Silvester", 8); print "I tawt I taw a puddy tat!\n" if any {"Silvester"} @array;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055965]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2017-07-22 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (338 votes). Check out past polls.