Irfan J Sayed (isayed) wrote:
>  
> I want to execute one command on remote Linux machine.
>  
> Following is the perl code.
>  
> #! /usr/bin/perl;
>  
> # perl module to parse the Install.log file for errors
>  
> use lib "/tmp/";
> use Net::SSH::Perl;
>     my $ssh = Net::SSH::Perl->new(avm-qa-cam2.net.com);
>     $ssh->login(cgadgil, cgadgil);
>     my($stdout, $stderr, $exit) = $ssh->cmd(ls);
>  
> Actually i want to parse the log file for errors which is on the remote
> machine. so i want to execute some commands on remote machine. for
> example ls
> I have copied the Perl.pm in the /tmp folder but still i am getting @INC
> error.
> Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /tmp/
> /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi

You are getting a lot of similar advice but it doesn't seem to be getting you
anywhere. Do this.

Make sure your library file Perl.pm is installed here

  /tmp/Net/SSH/Perl.pm

then you can write

  use lib '/tmp';
  use Net::SSH::Perl;

Although as Tom said it would be nicer to install it in your home directory -
something like

  /home/isayed/lib/Net/SSH/Perl.pm

in which case you would say

  use lib '/home/isayed/lib';
  use Net::SSH::Perl;

You should be able to get one of these going at least.

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to