in reply to Perl script asking question and staying in a loop

Consider looking into IO::Interactive if you can. Alternatively, consider placing your code in a while loop:
my $upper_limit = 10; my $lower_limit = 5; my $number; while( $number >= $lower_limit && $number <= $upper_limit) { $number = <>; }
Although my disclaimer is that the above is untested.