in reply to Re: how to close shh connection
in thread how to close shh connection

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;