Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: looking for simple way to check scalar against array

by Nevtlathiel (Friar)
on May 19, 2005 at 14:54 UTC ( [id://458640]=note: print w/replies, xml ) Need Help??


in reply to looking for simple way to check scalar against array

my @array = (1,2,3..9,-12); foreach my $variable (@array) { print "$variable is in the list\n"; }

That something like what you want?

Update: Oops, looks like I didn't really understand what you wanted, everyone else's suggestions are better :)

----------
My cow-orkers were talking in punctuation the other day. What disturbed me most was that I understood it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-20 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found