Looks like your ppm must be finding a cached version of the ppd file - as opposed to reading the file that's now actually on the server. (I didn't expect that would happen.) Anyway, since you're using perl 5.6, then it's not going to work for - though you should be getting different errors to the ones you're seeing.
I'll stick up a ppm for perl 5.6.1 - and update this post with details of how you can access it once the job has been done. (Probably take about half an hour all being well.)
Cheers, Rob Update:Try:
ppm install http://members.optusnet.com.au/~sisyphus1/ppms/Net-SSH2-56.ppd
Warning:I had to modify the source code to enable building under perl 5.6.1. To be more specific, Net-SSH2 requires perl 5.8. By using the 5.8 ExtUtils/typemap with perl 5.6.1, and by changing every occurrence of "use 5.008;" to "use 5.006;" (in the Makefile.PL and the all of the .pm files) I was able to get Net-SSH2-0.09 to build with perl 5.6.1. I can't guarantee, however, that there isn't some bug in there just waiting to bite :-) | [reply] |
Hi Rob,
Thanks for your great help,
yes what you told is right,i am able to install from
http://members.optusnet.com.au/~sisyphus1/ppms/Net-SSH2-56.ppd
but if i am testing with simple code
#!/usr/bin/perl
use warnings;
use strict;
use Net::SSH2;
my $ssh2 = Net::SSH2->new();
$ssh2->connect('$hostname') or die "Unable to connect Host $@ \n";
$ssh2->auth_password('veeru','143') or die "Unable to login $@ \n";
my $chan2 = $ssh2->channel();
$chan2->shell();
print $chan2 "cd /home/john";
print "LINE : $_" while <$chan2>;
print $chan2 "pwd\n";
print "LINE : $_" while <$chan2>;
print $chan2 "ls -lrt \n";
print "LINE : $_" while <$chan2>;
iam getting errors like :
print() on unopened filehandle Net::SSH2::Channel::_GEN_0 at testex.pl line 14.
readline() on unopened filehandle Net::SSH2::Channel::_GEN_0 at testex.pl line 15
print() on unopened filehandle Net::SSH2::Channel::_GEN_0 at testex.pl line 16.
readline() on unopened filehandle Net::SSH2::Channel::_GEN_0 at testex.pl line 17
print() on unopened filehandle Net::SSH2::Channel::_GEN_0 at testex.pl line 19.
readline() on unopened filehandle Net::SSH2::Channel::_GEN_0 at testex.pl line 20
| [reply] [d/l] |
And the exact same script runs fine on linux ? If so, then I guess the problem is either the fact that you're using perl 5.6 or the fact that you're using Windows. Afaik, I don't have any access to a secure shell server, so I'm unable to personally test things properly.
One thing you could try is to grab the Net-SSH2-0.09 test script from cpan (http://search.cpan.org/src/DBROBINS/Net-SSH2-0.09/t/Net-SSH2.t) and give it a run. The first 11 tests should pass ... beyond that I don't really know. Perhaps it might help. But I think the best thing to do would be to update your Windows to perl 5.8.8 and try out Net-SSH2 on that.
If you haven't already, check the Net::SSH::Channel documentation - there might be something in there that helps.
Cheers, Rob
Update: And how about the example script at http://search.cpan.org/src/DBROBINS/Net-SSH2-0.09/example/read.pl ... does it work for you ?
| [reply] |