Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by jozxyqk (Initiate)
on Jan 31, 2008 at 15:46 UTC ( #665373=note: print w/replies, xml ) Need Help??


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

In Perl 5.10 you could use "given": (This is a guess from the documentation; I haven't actually played with 5.10 myself)
use feature qw(say switch); given($var) { when (['yes','no']) { say "You chose $var"; } default { say "you chose something other than yes or no"; } }
  • Comment on Re: Need help testing to see if a variable is one value or the other
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2022-01-20 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (56 votes). Check out past polls.

    Notices?