in reply to Net-SSH-W32Perl hanging
I spent a few days tracking this down (I really like Net::SSH::Perl and friends) and believe I have a solution.
Hope it helps.
-Craig
In order to fix the problem, I modified these lines:
To look like this (what the original code was):my $proto_class = join '::', __PACKAGE__, ($proto == PROTOCOL_SSH2 ? "SSH2" : "SSH1");
This fixes the problem for me.my $proto_class = $ssh->protocol_class($proto);
If you are using Net::SSH::W32Perl to access the Net::SSH::Perl modules from your windows PC, the original Net::SSH::Perl code would correctly set
The new version 1.34 of Net::SSH::Perl will incorrectly set$proto_class='Net::SSH::W32Perl::SSH2'
which causes Net::SSH::W32Perl all sorts of grief, and your remote commands end up hanging.$proto_class='Net::SSH::Perl::SSH2'
Some folks have asked for a recipie for installing Net::SSH::Perl & friends on a PC. Here is how I do it...
use strict; use warnings; use Net::SSH::W32Perl; # Set $HOME (if not set), to avoid another Net::SSH::Perl bug... if(! $ENV{HOME}) { $ENV{HOME}='c:\\' }; my $ssh=Net::SSH::W32Perl->new('myhost.com'); $ssh->login('myuser', 'mypasswd'); my ($stdout, $stderr, $exit) = $ssh->cmd('uname -a; date; uname -a'); print STDERR "exit=$exit\n"; print STDERR "STDERR: $stderr\n" if $stderr; print STDERR "STDOUT: $stdout\n" if $stdout;
|
|---|