in reply to how to close shh connection

I am not sure about perl implementation,

but ssh->cmd("exit") should do the trick, it is an applied ssh level command, not a module method level so it should work in warper one

I think connection is present till $ssh->session_id is defined =)

Replies are listed 'Best First'.
Re^2: how to close shh connection
by salva (Canon) on Nov 14, 2009 at 12:22 UTC
    ssh->cmd("exit") will do mostly nothing.

    The proper way to close the connection is to undefine the $ssh variable, or just to let it go out of scope:

    undef $ssh;