Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How to find out if X is an element in an array?

by guha (Priest)
on Nov 25, 2010 at 17:18 UTC ( #873689=note: print w/replies, xml ) Need Help??


in reply to How to find out if X is an element in an array?

#!perl use strict; use warnings; use List::MoreUtils qw{ any }; my @array = qw{ A B C D E X }; if (any { $_ eq 'X'} @array) { print 'YES'; } else { print 'NO'; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-01-16 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (49 votes). Check out past polls.

    Notices?