use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new($host); $ssh->login; my($out, $err, $exit) = $ssh->cmd($cmd);