ellem has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict ; use diagnostics; use LWP::Simple ; print "This will get the time from an NIST clock 5 times and then ask you if you want to continue. Use 'y' to continue and any other key to stop:\n\n" ; my $answer ; my $quit = 0 ; until ($quit) { getprint("http://132.163.4.101:13") ; getprint("http://132.163.4.101:13") ; getprint("http://132.163.4.101:13") ; getprint("http://132.163.4.101:13") ; getprint("http://132.163.4.101:13") ; print "Do you want to continue? " ; $answer = <STDIN> ; chomp $answer ; } if ($answer ne 'y') { print "OK\n" ; } else { $quit = 1 ; die "OK!\n\n" ; } print "Good-bye!\n\n" ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(ichimunki) Re: Can't quit my until loop
by ichimunki (Priest) on Jul 03, 2001 at 19:36 UTC | |
by ellem (Hermit) on Jul 03, 2001 at 20:16 UTC | |
by ichimunki (Priest) on Jul 03, 2001 at 20:26 UTC | |
|
Re: Can't quit my until loop
by Hofmator (Curate) on Jul 03, 2001 at 19:42 UTC | |
|
Re: Can't quit my until loop
by tachyon (Chancellor) on Jul 03, 2001 at 19:55 UTC | |
|
Something completely different (was "Re: Can't quit my until loop")
by rrwo (Friar) on Jul 03, 2001 at 20:22 UTC | |
|
(dkubb) Re: (2) Can't quit my until loop
by dkubb (Deacon) on Jul 03, 2001 at 20:29 UTC |