On Monday 24 November 2008 01:58:33 pm monnappa appaiah wrote: > Hi all, > > I'm running kubuntu linux............I used Net::SSH2 > to login to remote machine, execute commands and give me the > ouput.......when i run the below code i get this error > "Segmentation fault"...........does anybody have an idea wat this > error is? > > ----------------------------------------------------------------- >---------------- >#!/usr/bin/perl -w > use strict; > use Net::SSH2; >
Change the above to this: #!/usr/bin/perl -T use strict; use warnings; use diagnostics -verbose; It will tell you what is going on. > my $ssh2 = Net::SSH2->new(); > $ssh2->connect('10.10.10.5') or die "unable to connect to host > [EMAIL PROTECTED]"; $ssh2->auth_password('xxz', 'xyzpass'); > my $chan = $ssh2->channel(); > $chan->exec('ls -la'); > while (<$chan>) { print} > > ----------------------------------------------------------------- >----------------- > > > Thanks, > Monnappa -- Stealth -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/