Try using Net::OpenSSH instead of Net::SSH2.
In reply to Re: Net::SSH2 blocked while reading from Channel by salva in thread Net::SSH2 blocked while reading from Channel by psantann