Update 2: Ok, I just tried the following, where "dir" will hang at a "more" prompt:
use Net::Telnet ; my $telnetSession = new Net::Telnet (Timeout => undef, Prompt => '/\>/ +') ; $telnetSession->open("10.0.0.1") ; $telnetSession->login("administrator", "password") ; my @DirInfo = $telnetSession->cmd("dir") ;
The only thing changed from the code I ran is the IP and the User and pass and it is still hung (5+ minutes). This is on Win2K with ActiveState's v5.6.1 build 629.

So it looks like the desired behavior is working for me.

Update 3: Ah, it just timed out...from the other side! Are you sure it's Net::Telnet and not the responder that is timing it out? (and yes my sniffer confirmed it :)

I looked through the timout methods in the module, and it appears to require a numeric timout, undef is treated like you did not specify anything and hence defaults to 10 seconds.

My other suggestion is to crank the timout up to the max seconds you could ever imagine the data retrieval to take, add a 1 minute buffer, and use that.

I would also recomend setting the timeout right before the command and then resetting it right after.

Update: A second look tells me that undef should be valid! I'm looking into this further.

"Nothing is sure but death and taxes" I say combine the two and its death to all taxes!

In reply to Re: How to disable timeout in Net::Telnet by Rex(Wrecks)
in thread How to disable timeout in Net::Telnet by sksridevnair

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.