Monnappa Appaiah wrote:

.
.
> ----------------------------------------------------------------------------
> 1)
>
>  #!/usr/bin/perl -w
> use strict;
> use Net::SSH2;
>
> my $ssh2 = Net::SSH2->new();
> $ssh2->connect('sys5') or die "Unable to connect host $@ \n";
> $ssh2->auth_password('xyz','mypass');
> my $chan = $ssh2->channel();
> $chan->exec('ls -la');
> while (<$chan>) {print}
> -------------------------------------------------------------------------------------

The trouble is that, on Windows, the "<$chan>" doesn't work. Try
removing that last line of your code, and replace it with:

--------------------------------
my $buflen = 10000;
my $buf1 = '0' x $buflen;

$chan->read($buf1, $buflen);
print "BUF1:\n", $buf1, "\n";
--------------------------------

That works for me. If the buffer needs to be bigger just increase
$buflen accordingly.

Cheers,
Rob


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to