sugarboy has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

I have a code which connects to a remote machine using Net::SSH::Perl and executes few commands on the remote machine As part of a test it also restarts the remote machine.

Now the the connection between the local remote machine is lost. Is it possible to retrieve the previous object of Net::SSH::Perl rather than creating the new connection again.

Thanks,
Sagar
  • Comment on Is it possible to retreve a lost connection object

Replies are listed 'Best First'.
Re: Is it possible to retreve a lost connection object
by Anonymous Monk on Jan 07, 2011 at 09:58 UTC
    No, its not possible. You could try to $foo->_connect again after being disconnected
Re: Is it possible to retreve a lost connection object
by locked_user sundialsvc4 (Abbot) on Jan 07, 2011 at 16:22 UTC

    /me nods...

    Stop and think about it ... the machine that you were talking to has just been rebooted.   Hence, nothing associated with any prior connections (or anything else) that it may have had “in its previous reincarnation” is applicable to “its new life.”

    (And by the way, I mean this in a respectful way; not to poke fun at you in any way whatsoever.)