Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Using IF and OR, I'm sure there is a better way

by mathy (Initiate)
on Dec 16, 2005 at 16:20 UTC ( [id://517283] : note . print w/replies, xml ) Need Help??


in reply to Using IF and OR, I'm sure there is a better way

Hey Lyle,
I figured out a way using a regular expressions comparison:

$variable=1; if ($variable =~/[1,2,3]/) { print "Did it!\n"; }
I'm new in Perl, so this may be completely non-sense, but it works :)
Tell me something about this, ok?
Mathy

Replies are listed 'Best First'.
Re^2: Using IF and OR, I'm sure there is a better way
by parv (Parson) on Dec 16, 2005 at 16:33 UTC