while ($x < $limit) { print "Enter P,Q,R: "; chomp(my $numbers = ); my ($p,$q,$r) = split /,/, $numbers; $x += $p; last if $x >= $limit; $x *= $q; last if $x >= $limit; $x /= $r; }