Posted on 2008-11-28 17:47:42-08 by oldlurker
Net::SSH2 does not work on Window
I suspect I missed something obvious when building the module. Here is the code I tried to run
use strict; use Net::SSH2; my $ssh2 = Net::SSH2->new(); if (!$ssh2->connect('svl-command') || ! $ssh2->auth_password($user, '$pwd)) { print join(':', ($ssh2->error)); exit 1; } my $chan = $ssh2->channel(); $chan->exec('/bin/ls');

Here is the result when ran via Debugger:

perl -d p.pl Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `perldoc perldebug' for more help. main::(p.pl:4): my $ssh2 = Net::SSH2->new(); DB<1$gt; c Signal SEGV at p.pl line 12
An error popup comes up when I run this without Debugger, Here is the output of perl -v:
This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 5 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com Built Sep 3 2008 13:16:37
Direct Responses: 9454 | 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.