in reply to Re: How do I loop until keyboard input?
in thread How do I loop until keyboard input?
#!/usr/bin/perl -w use strict; use Term::ReadKey; my $done = 0; my $choice; my $key; ReadMode 4; while (! $done) { if (defined($key = ReadKey(-1))) { print "Test\n"; $choice = uc ($key); $done = 1 if ( $choice eq "Q" ) } } ReadMode 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How do I loop until keyboard input?
by gellyfish (Monsignor) on Dec 15, 2004 at 15:31 UTC | |
by skitchy (Initiate) on Dec 15, 2004 at 15:35 UTC |