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:




use Net::SSH::Perl;


my $host = "";

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/ 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 line 3.

BEGIN failed--compilation aborted at line 3.


You might have to install per-Net-SSH packages for this. Unfortunately these packages are not available officially from Red Hat.


One place you can look for them is at epel.


Look for perl-Net-SSH in the last link.


Please note that the above packages are not officially supported by Red Hat since it's not provided by Red Hat.