Perl Lists - if $test in [ x, y, z] then - TechRepublic
General discussion
February 13, 2001 at 05:46 AM
dsarvai

Perl Lists – if $test in [ x, y, z] then

by dsarvai . Updated 25 years, 4 months ago

I remember doing something like the above in C, but cannot find the answer while using perl.

I would like to take an assigned variable, and compare it to a list:

If $s_port in [80, 8080, 9999] then $www = True.

Anyhelp would be appreciated.
Thanks,
David Sarvai

This discussion is locked

All Comments