perl qustion

Latest response

I wrote a simple Perl script try to make a connection to remote server and run command. But came up some message I don’t what is about.

 

Here is the Perl script:

 

#!/usr/bin/perl

 

use Net::SSH::Perl;

 

my $host = "127.0.0.1";

my $user = "me";

my $password = "pass";

 

#-- set up a new connection

my $ssh = Net::SSH::Perl->new($host);

#-- authenticate

$ssh->login($user, $pass);

#-- execute the command

my($stdout, $stderr, $exit) = $ssh->cmd("ls -l /home/$user");

 

and here is the error message:

 

Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ssh_test.pl line 3.

BEGIN failed--compilation aborted at ssh_test.pl line 3.

Responses