in reply to Any tips on this?
use warnings; use strict; print "Please give me a number:\n"; my $initial_number = <STDIN>; chomp $initial_number; while (1) { print "Please continue with a new number:"; my $new_number = <STDIN>; chomp $new_number; if ($new_number < $initial_number) { print "You specified a number which is smaller than the previo +us. The program will now exit\n"; exit; } $initial_number = $new_number; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Any tips on this?
by Anonymous Monk on Feb 04, 2014 at 17:58 UTC | |
by Anonymous Monk on Feb 04, 2014 at 20:50 UTC |