programming-examples/perl/Basics/Boolean and &&.pl

12 lines
252 B
Perl
Raw Normal View History

2019-11-18 14:44:36 +01:00
print "Please enter positive numbers up to 100\n";
while (<>) {
chomp;
if ($_ > 0 && $_ < 100) {
print "Thank you - let's have another!\n";
} else {
print "Please enter positive numbers up to 100\n";
}
}