Sorry, I should have included more of the code.
use Net::Telnet (); <--some variables defined here--> $connect = new Net::Telnet (Telnetmode => 1); $connect->open(Host => $hostname, Port => $port); # For debugging print "First, login with $act\n"; print "\n"; <---snip---> print "Now for the RTRV command:\n"; print "command is $rtrv\n"; print "\n"; $connect->print("$rtrv"); (@prematch,$match) = $connect->waitfor('/COMPLD/'); while (@rlines = $connect->getlines(Timeout =>1)) { print @rlines; }

So, you see it uses the perl telnet.pm module. Pretty simple really, but the problem I'm having is that the data stream doesn't flow consistently, and getlines apparently believes it is finished taking data before all the data is actually retrieved. So, I repeatedly call getlines until finally one of the requests gets a blank line. At this point it times out. My problem is that I want to issue one more command after I've received all the data (I need to log out gracefully). But, when the timeout occurs, the script exits. I can't do anything further. There does appear to be a way to check the status of timed_out, which is what I need (I think). If I time out, then log out, don't just exit. Another solution may be to change the Errmode from the default of "die" to something else.


In reply to Re: (tye)Re: timed_out usage? by Galen
in thread timed_out usage? by Galen

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.