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