Obviously, you would use the string comparison operators if you were locating strings.if (grep { $x == $_ } ( 1, 3, 7 ) { # do this }
This is also handy with the match operator ($x =~ m/foo/).
Try 'perldoc -f grep' if you want more.
In reply to Re: writing perl function like sql IN
by Anonymous Monk
in thread writing perl function like sql IN
by JAMBOID
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |