1

Im trying to run a perl script which involves ssh to a remote server and while executing this code, it throws an error like

Can't locate Net/SSH/Perl.pm in INC <@INC contains:C:/Perl/site/lib c:\perl\lib  at line5.

I open ppm graphical UI and installed NET-SSH, area= site but still not able to execute this script Here is the script

use strict;
use warnings;

use Net::SSH::Perl;
my $ip=12.14.142.22;
my $user = "qwerty";
my $pass = "termide";

my $ssh = Net::SSH::Perl->new($ip, use_pty => 1);

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

3 Answers 3

7

While Foo::Bar often includes a Foo::Bar::Baz module, that isn't the case here.

Net::SSH and Net::SSH::Perl are different distributions. You need to install Net::SSH::Perl.

Sign up to request clarification or add additional context in comments.

2 Comments

Any idea how to install that in a windows machine?
Not for ActiveState Perl. I use Strawberry Perl when I need to use Windows, and that is just a case of cpan Net::SSH::Perl
3

You should install Net::SSH::Perl, not Net::SSH. The error message is clean about that :)

1 Comment

Any idea how to install that in a windows machine?
0

Net::SSH2 is another SSH client that works on Windows and far easier to install. A PPM is available from here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.