it depends on what you're going to do after knowing if it's equal to or not , This may help
my @array = qw/1 2 3 4/; my $matched; foreach (@array){ if($variable == $_){ $matched = $_;} }
it's not the best way but it may be helpful i think
In reply to Re: Using IF and OR, I'm sure there is a better way
by ahmad
in thread Using IF and OR, I'm sure there is a better way
by cosmicperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |