Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2016-12-04 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (61 votes). Check out past polls.