http://www.perlmonks.org?node_id=1025295


in reply to How to check if a variable's value is equal to a member of a list of values

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 }