Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Need help testing to see if a variable is one value or the other

by moritz (Cardinal)
on Jan 30, 2008 at 21:16 UTC ( [id://665219]=note: print w/replies, xml ) Need Help??


in reply to Need help testing to see if a variable is one value or the other

if ($var eq "yes" or $var eq "no"){ ... } will do the job.

The way you write it is planned for Perl 6:

if $var eq any <yes no> { ... }

Replies are listed 'Best First'.
Re^2: Need help testing to see if a variable is one value or the other
by paulehr (Sexton) on Jan 30, 2008 at 21:32 UTC

    thanks guys!

    I knew this was probably going to be something easy. I do not know why I was having a hard time with it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found