[Israel.pm] Is there an operator like IN in perl

Berler Chanan chananb at centerity.com
Wed Mar 4 05:12:48 PST 2009


Hi All,

I wonder why/or should I ask "if" there is an operator IN in perl.
For example:

my @arr = (1,2,3,4,5);
if (1 in @arr)
{
    # do something
}

The idea came to me when using SQL statement: select …. where element in (1,2,3,4,5)
PS: the use of foreach and check is tooooooooo long for me ☺

Thanks
Chanan




More information about the Perl mailing list