in reply to Re: die on carriage return
in thread die on carriage return

Or even:
die "Enter is not valid" unless $number;
Since an empty string is false.

Update: Thanks to Perlbotics for pointing that this would mark 0 as invalid. Doh!

Replies are listed 'Best First'.
Re^3: die on carriage return
by ikegami (Patriarch) on Dec 31, 2008 at 11:34 UTC
    I thought zero was a number.
Re^3: die on carriage return
by muizelaar (Sexton) on Dec 31, 2008 at 13:18 UTC
    Hello Thanks that works quite well now, quite simple really :)