http://www.perlmonks.org?node_id=946291


in reply to Re: Range Operator in If Statement
in thread Range Operator in If Statement

Hey perlbotics, thanks for you QUICK reply...

Ohh ok I thought I could use the range operator for this type of thing, but guess not.

I wanted to use that because it seemed like it was the "shorthand" way of doing it.
Wanted a short way because I needed a whole bunch of those statements and I didn't want to have a ton of these statements:
if ($ref >= 1 && $ref <= 8) { ...... } if ($ref >= 9 && $ref <= 16) { ...... } if ($ref >= 17 && $ref <= 24) { ...... } if ($ref >= 25 && $ref <= 32) { ...... } #....more checks

But if that's what you recommend then I'll just use my original way I had like above and like you had...

Thanks again for the reply,
Matt