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' : ''; }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Device::Modem Help
by Anonymous Monk on Apr 24, 2006 at 19:38 UTC
    Hi, Thanks for the reply browserUK. Could you explain or add some more comments to the code?

    Thanks