If you can't use the character set [1-5] in the regex, at least use the actual constants for comparison rather then a different bunch:
if ($b =~ /^\d$/ and $b >= 1 and $b <= 5) { ... }
In reply to Re^2: Quicker way to do this IF statement 1-5
by GrandFather
in thread Quicker way to do this IF statement 1-5
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |