Alternately (heh) use a regex.
if( $var =~ m/\A ( yes | no ) \z/x ) { print "you chose $1\n"; } else { print "BAD USER, NO DONUT!\n"; }
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Need help testing to see if a variable is one value or the other
by Fletch
in thread Need help testing to see if a variable is one value or the other
by paulehr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |