The expression (40||47||76) "short-circuits" and evaluates to 40. Scalar $n is then only compared to 40.
Edit: the solution is as toolic suggests, though I tend to use the low-precedence or operator by default (rather than the high precedence one, ||), as it more often does what I expect.
In reply to Re: my 'if' condition doesn't work, why?
by philipbailey
in thread my 'if' condition doesn't work, why?
by perltux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |