Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by swampyankee (Parson)
on Dec 15, 2005 at 03:47 UTC ( [id://516846] : note . print w/replies, xml ) Need Help??


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

If your condition is going to be predictably in a numerical range like that, this may work.

if($variable >= $lower_limit && $variable <= $upper_limit) { miraculous_stuff; }

If your requirement is to do something when $variable is an integer, vs something else when it isn't, or when $variable is being tested against values in an array, this probably would not be appropriate, but if it's a regular as what I read at 10:46pm EST 14 Dec 2005, my suggestion may be appropriate.