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

It appears that using errmode you can specify code to run (i.e. a routine to reconnect) if an error condition is detected.


reading perldoc Net::Telnet says this about errmode

errmode - define action to be performed on error

   $mode = $obj->errmode;

   $prev = $obj->errmode($mode);

This method gets or sets the action used when errors are encountered using the object. The first calling sequence returns the current error mode. The second calling sequence sets it to $mode and returns the previous mode. Valid values for $mode are "die" (the default), "return", a coderef, or an arrayref.
  • Comment on Re: Net::Telnet - how to detect a reset connection ?