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";
In reply to Re: Perl script asking question and staying in a loop
by arun_kom
in thread Perl script asking question and staying in a loop
by TheBigAmbulance
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |