Thanks, but it doesnt work. I am experiencing some very odd behaviour with the suggested snipped.

When run manually, the AT command returns to OK within 500ms. Since the RegEx would match and it still times out, I believe it safe to conclude that it still doesnt pass in the AT command.

More important is the fact that no matter what timeout I set, it throws the warning after ~2 seconds. I've set 50 seconds in the example below:

print "Before timeout: " . localtime() . "\n"; my $timeout = 50; $exp->expect($timeout, [qr/^OK$/ => sub { print "Success!\n"; }], [qr/^ERROR$/ => sub { print "Failure!\n"; }]) or warn "Timeout!"; print "After timeout: " . localtime() . "\n";
and the output I get from the above:
Before timeout: Tue Nov 8 03:31:02 2011 Timeout! at getdbm.pl line 18. After timeout: Tue Nov 8 03:31:04 2011

Am I experiencing a bug here, or am I (still) an idiot?


In reply to Re^2: Net:SSH::Expect and microcom? by Anonymous Monk
in thread Net:SSH::Expect and microcom? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.