in reply to writing perl function like sql IN
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.
|
|---|