in reply to my() troubles
I changed it slightly in that it will only return input if $input is a number. Your example would return "spam9" as good input.sub input { my $input; print "ILLEGAL INPUT $input\n" while ( chomp($input = <STDIN>) and $input !~ /^\d+$/); return $input; }
|
|---|