in reply to writing perl function like sql IN

Quantum::Superpositions might give the most readable way to do this:
use Quantum::Superpositions; if ( $x == any(1,3,7) ) { ... }
A hash is better than an array or quickly checking of whether an item is included. If you can keep the set of candidates around as a hash with candidates as keys instead of an array of candidates, you can check whether a key is one of the candidates with exists.

blokhead