Please, post your code and the resulting error!!!
State also your OS, Perl and module versions, and the underlaying SSH client you are using (probably OpenSSH on Unix/Linux).
And BTW PerlMonks is a much better place to ask for help about anything related to Perl than this forum.