in reply to Device::Modem Help
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' : ''; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Device::Modem Help
by Anonymous Monk on Apr 24, 2006 at 19:38 UTC |