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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.