in reply to die on carriage return

die "The number is not valid\n" if $number =~ /\n/; ??

die "The number is not valid\n" if $number =~ /^\s*\n/; ??

Update:

Looks like Perlbotics was busy proof reading a few responses - thanx to him for pointing out that the RE as I posted would invalidate all text - amended accordingly.

A user level that continues to overstate my experience :-))