There are several ways. Fastest is probably to put the 1000+ values in a hash (as the keys, let their value be 1 if you don't care otherwise. Then you just need to check if exists($myhash{$variable})
Another way available since version 5.10, I believe, is if your 1000+ values are in an array you can do if (@myarray ~~ $variable) { #do something }
In reply to Re: How to check if a variable's value is equal to a member of a list of values
by CountOrlok
in thread How to check if a variable's value is equal to a member of a list of values
by cls33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |