The problem is probably located a few lines earlier. You could chomp $number before performing the tests. Then check for an empty input, e.g. like:
die "Enter is not valid" unless length $number;
In reply to Re: die on carriage return
by Perlbotics
in thread die on carriage return
by muizelaar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |