Could you show us your code. I've done a lot of development this last year using this module. I believe I used 'shell' when sending commands over the established channel. I don't recall it closing the channel but it's been awhile since I've written code with this module.
I recall having a lot of problems with STDERR and this module. Is this what you are having difficulty with? From the channel module page it says:
shell
Start a shell on the remote host; calls process("shell").
exec ( command )
Execute the command on the remote host; calls process("exec", command). Note that only one of these requests can succeed per channel (cp. "exec" in perlfunc); if you want to run a series of commands, consider using shell instead.
I recommend 'shell'. It worked well for me. Post the code and we'll check it out.
BTW, while this module is still immature IMO (not even at 1.0 I think). David has done a fantastic job and it's far better than the original NET::SSH::PERL IMO. I've been able to hit a couple hundred Unix/Linux servers in a few minutes and run inventory reports. It's very speedy and does a great job. We're now using it to create user accounts and set passwords in minutes rather than days.
Yeah it's archaic but we can't decide how to tie everything together with LDAP and I was tired of waiting for management to approve funding :-)