TMTOWTDI
#!/usr/bin/perl -w use strict; my %allowed_reply= ( yes => 1, no => 1, ); my $var = "yes"; if ( $allowed_reply{$var} ) { print "You choose $var\n"; }else{ print "you chose something other then yes or no\n" }
In reply to Re: Need help testing to see if a variable is one value or the other
by Skeeve
in thread Need help testing to see if a variable is one value or the other
by paulehr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |