1. This will work for SSH2, but if you are going to wind up supporting a mixture of Telnet, SSH1, and SSH2 clients, you will have a lot fewer headaches using Expect.pm from CPAN.
2. I'm not on a Windows box, so I can't check this, but... in the command $ssh->cmd('ls',"\n"); the "\n" is an optional stdin parameter. In this case, it is fed into ls, which doesn't read its standard input.
It may be that the Net::SSH::W32Perl problem described in its CPAN page "the shell() interface is not supported due to MSWin32's lack of support for select() on non-socket filehandles" also applies to the case where stdin and stdout are active at the same time.
I would try removing the "\n" parameter and see if that helps. If you need to pass some input to other commands, you could use echo commands to create a file and then redirect stdin to the file.
In reply to Re: SSH::W32Perl and STDOUT
by quester
in thread SSH::W32Perl and STDOUT
by spanko
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |