Posted on 2007-11-21 21:33:25-08 by georgeking
Can't read from Channel filehandle.
I just tried Net::SSH2 out with an example derived from the Read example. I can connect, open a channel, and successfully exec a command ( I tried a simple 'pwd'). Everything seems fine. However, when I try to read from the tied file handle, the perl script seems to block.
while (my $line = <$channel>) { # never get here }
With debug enabled, it shows a poll as the last thing that happens before it blocks. If I close the channel beforehand then it doesn't block, but then there is nothing to be read. How do I get the output of my command? Happy Thanksgiving! George
Direct Responses: 6690 | 6842 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.