That module is old, problematic, and being replaced because of the types of problems you mention. If possible, try Net::SSH2 See A little demo for Net::SSH2
If you are forced to use the old modules, try upgrading
all the dependency modules to the latest versions.