[EMAIL PROTECTED] wrote:
>
> What command (contruct?) of Perl language I should to use to execute
> this problem:
>
> - loop run, and run, and run, until user key pressed <b> (break) and:
> - if user key pressed <c> (continue) then loop resume,
> - if user key pressed <q> (quit) then loop stop.
>
> ??
Take a look at the Term::ReadKey module. Something like this maybe?
HTH,
Rob
use strict;
use warnings;
use Term::ReadKey;
ReadMode 4;
LOOP:
while () {
# Do stuff
my $c = ReadKey -1;
next unless defined $c;
INPUT:
while () {
print "\n>";
$c = ReadKey 0;
last LOOP if $c eq 'q';
last INPUT if $c eq 'c';
}
}
ReaadMode 0;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/