The obligatory simple (untested) solution:
use Term::ReadKey; use threads; ... my $flag = 0; async{ $modem->hangup(), $flag = -1 if ReadKey 0.25; redo unless $flag }; if( $modem->dial( $number ) and not $flag ) { print "Modem connected"; $flag = 1; ## terminate thread } else { print "Dial failed:", $flag == -1 ? ' Terminated by user' : ''; }
In reply to Re: Device::Modem Help
by BrowserUk
in thread Device::Modem Help
by strange1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |