sub input { my $input; print "ILLEGAL INPUT $input\n" while ( chomp($input = ) and $input !~ /^\d+$/); return $input; }