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:
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
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Range Operator in If Statement
by Marshall (Canon) on Jan 04, 2012 at 21:34 UTC | |
Re^3: Range Operator in If Statement
by LanX (Saint) on Jan 05, 2012 at 01:56 UTC | |
Re^3: Range Operator in If Statement
by ambrus (Abbot) on Jan 05, 2012 at 11:43 UTC |
In Section
Seekers of Perl Wisdom