in reply to printing values within a given range
withif(('$checkvalue' gt '$value1') && ('$checkvalue' le '$value2')) { print "$checkvalue $value1 $value2\n"; }
gt and le are string-wise comparisons. > and <= are numeric comparisons.if(($checkvalue > $value1) && ($checkvalue <= $value2)) { print "$checkvalue $value1 $value2\n"; }
Update: As VSarkiss (below) and Aviator (in /msg) have correctly pointed out, the bigger issue wasn't that the OP was using the string-wise comparisons (though that was still a problem), but that the OP was comparing the variable names, not that variable values - due to the single-quotes.
The Perfect is the Enemy of the Good.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: printing values within a given range
by VSarkiss (Monsignor) on May 03, 2005 at 14:20 UTC |