in reply to writing perl function like sql IN

if (grep { $x == $_ } ( 1, 3, 7 ) { # do this }
Obviously, you would use the string comparison operators if you were locating strings.

This is also handy with the match operator ($x =~ m/foo/).

Try 'perldoc -f grep' if you want more.