Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: writing perl function like sql IN

by Anonymous Monk
on Aug 31, 2004 at 21:37 UTC ( [id://387330]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://387330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-19 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found