Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by aarons (Initiate)
on Nov 18, 2010 at 10:44 UTC ( [id://872191]=note: print w/replies, xml ) Need Help??


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

succinctly:
print grep { $_ eq $value } @list_of_values ? "present\n" : "absent\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://872191]
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: (5)
As of 2024-04-24 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found