Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 ( #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? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2022-01-19 15:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (55 votes). Check out past polls.

    Notices?