Restructure your if statement as I showed.
Also, consider reading warnings as it shows how to suppress warnings. But in my opinion, it's much better to structure your code such that it recognizes bad input without raising warnings by, in your example, checking first whether something looks like a number before going on and checking whether it's larger than 22.
In reply to Re^3: Suppressing Warning/Error messages
by Corion
in thread Suppressing Warning/Error messages
by intoperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |