in reply to Re^2: Net:SSH::Expect and microcom?
in thread Net:SSH::Expect and microcom?

Maybe you have to wait for microcom to settle before sending anything. Try sleeping for 1 second before sending the modem command.

Replies are listed 'Best First'.
Re^4: Net:SSH::Expect and microcom?
by Anonymous Monk on Nov 08, 2011 at 12:37 UTC

    No luck - it sleeps for 5 seconds an continue - if anything, it made the issue of timeout not being honoured even worse:

    Before timeout: Tue Nov 8 04:14:40 2011 Timeout is: 500 Timeout! at getdbm.pl line 20. After timeout: Tue Nov 8 04:14:40 2011
      opps, you have to use the m switch on the regular expressions in order to make ^ and $ match at the beginning and end of lines:
      $exp->expect($timeout, [qr/^OK$/m => sub { ... }], [qr/^ERROR$/m => sub { ... }]);