in reply to Net::Telnet - how to detect a reset connection ?

The get and getline methods invoke the behavior specified in errmode, IIRC, so you might be able to use that.
  • Comment on Re: Net::Telnet - how to detect a reset connection ?

Replies are listed 'Best First'.
Re^2: Net::Telnet - how to detect a reset connection ?
by smeenz (Sexton) on Dec 12, 2006 at 22:54 UTC
    The most promising option I've found is that errmsg() gets set to 'Connection reset by peer' when the connection has been reset... but it's not ideal because I have to do a string comparison, and there may be other values of errmsg that require a reconnection to recover that I don't know about yet.

    I think what I'm looking for is something like $t->alive() or $t->ping() that returned 0 or 1 based on whether the tcp connection was open not.