I am completely new to perl scripting and I need to write a script to login to a router and execute few commands. I have tried the below script but I am getting an error as "Can't locate Net/SSH" Could anybody please tell how to install the module or is there any better script...?
#!/usr/bin/perl -w
use strict;
use lib qw("/path/to/module/");
use Net::SSH::Perl;
my $hostname = "hostname";
my $username = "username";
my $password = "password";
my $cmd = shift;
my $ssh = Net::SSH::Perl->new("$hostname", debug=>0);
$ssh->login("$username","$password");
my ($stdout,$stderr,$exit) = $ssh->cmd("$cmd");
print $stdout;