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 |
In Section
Seekers of Perl Wisdom