print "$in was not a number!"; input() unless $in =~ /\d/; #### $in; #### $in =~ /\d/ ? $in : print "$in was not a number!"; #### $in !~ /\D/