Hi, Try this
@array=qw/2 3 7 5 34/; $no=13; if(grep {$_ == $no} @array) { print "Condition true"; } else { print "Condition false"; }
Here I have a array @array, which contains the list of allowed values. $no should be the number you want to check.
In reply to Re: checking an array of numbers for a particular value
by rsriram
in thread checking an array of numbers for a particular value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |