use strict; use warnings; my $no=12; my $target; do { print "Guess the number : "; chomp($target = ); print "$target is too low\n" if ($target < $no); print "$target is too high\n" if ($target > $no); } until ( $target == $no);