use strict; sub in (@) { my $x = shift; $_ == $x and return 1 for @_; 0 } my $x = 10; if(in $x => 1 , 3, 7) { print "Found\n"; } else { print "Not found\n" }
In reply to Re: writing perl function like sql IN
by Arunbear
in thread writing perl function like sql IN
by JAMBOID
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |