if ($answer !~ /\d+/) {I think the following code better represents your intent:
if ($answer =~ /\D/) {
You only want someone to enter a positive integer. You don't want someone entering a number with letters or other characters in it, such as '123g'. This string slips through your regex test, then generates unnecessary warnings.
In reply to Re: Guess That Number
by toolic
in thread Guess That Number
by naildownx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |