Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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;


Comment on Re: Foreach loop
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055965]
help
Chatterbox?
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: (13)
As of 2014-07-24 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (166 votes), past polls