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

use strict; use warnings; my $lower_limit = 50; my $upper_limit = 100; my $num; print "What is the number: "; chomp($num = <STDIN>); while($num<=$lower_limit || $num>=$upper_limit){ print "\nBad answer. Try again: "; chomp($num = <STDIN>); }; print "\nThe number is: $num\n";