activerperl,使用Net::SSH::Perl时遇到:Can't set socket non-blocking: Bad file

activerperl,使用Net::SSH::Perl时遇到:Can't set socket non-blocking: Bad file

感谢“撒哈拉里的鱼”,让我顺利地在activeperl中用ppm安装了Net::SSH::Perl和DBD::Oracle模块,其中,DBD::Oracle模块测试通过.

刚才在测试Net::SSH::Perl模块时,遇到以下问题:
C:\Perl\my>perl 2
Math::BigInt: couldn't load specified math lib(s), fallback to Math::BigInt::FastCalc at C
:/Perl/site/lib/Crypt/DH.pm line 6
Can't set socket non-blocking: Bad file descriptor at C:/Perl/site/lib/Net/SSH/Perl.pm lin
e 213, <GEN0> line 1.

我用ppm install Math::BigInt,它说“No missing packages to install”。

请问各位,在activeperl中使用Net::SSH::Perl,还要做什么配置啊,谢谢!

我的测试脚本如下:
#!/usr/bin/perl
use strict;
use warnings;
use Net::SSH::Perl;
my $ssh=Net::SSH::Perl->new("127.0.0.1");
$ssh->login("Administrator","jjqing");
my @my_result = $ssh -> cmd("dir");
print "ssh test : dir is\n @my_result \n";

我安装了Math::BigInt::GMP之后,错误提示就变了,变成了:
C:\Perl\my>perl 2
Can't set socket non-blocking: Bad file descriptor at C:/Perl/site/lib/Net/SSH/Perl.pm lin
e 213, <GEN0> line 1.


====================================================
C:\Perl\my>ppm install Math::BigInt::GMP
Downloading ActiveState Package Repository packlist...not modified
Downloading log4perl packlist...redirect
Downloading log4perl packlist...forbidden
Downloading Math-BigInt-GMP-1.24...done
Unpacking Math-BigInt-GMP-1.24...done
Generating HTML for Math-BigInt-GMP-1.24...done
Updating files in site area...done
   7 files installed
我看了Perl.pm的第213行,是如下:
    defined($sock->blocking(0))
        or die "Can't set socket non-blocking: $!";


QUOTE:
原帖由 jjqing 于 2008-12-12 16:54 发表
我看了Perl.pm的第213行,是如下:
    defined($sock->blocking(0))
        or die "Can't set socket non-blocking: $!";

我试着改了一下这一行,将die语句注释掉:
    defined($sock->blocking(0));
       # or die "Can't set socket non-blocking: $!";


然后我再运行我的测试脚本,竟然通过了:
C:\Perl\my>perl 2
Use of uninitialized value in join or string at 2 line 8.
ssh test is
afiedt.buf
Desktop
oracle_report_daily
oracle_report_daily.zip
perl
upload
  0

难道我要一直保留我修改的Perl.pm文件吗?

请各位帮忙看看,这个问题要怎样才能彻底解决?