#!/usr/bin/perl use Net::SSH::Perl; use Math::BigInt::GMP; use strict; use warnings; my $host = "xx.xx.xx.xx"; print "SSHing into $host...\n"; my $user = "xxxx"; my $passwd = "xxxxx"; my $cmd = "ls -l /root"; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user,$passwd); my ($output, $error, $exit) = $ssh->cmd($cmd); print $output;