use Net::SSH::Any; my $ssh = Net::SSH::Any->new($host, user => $user, password => $password); my @out = $ssh->capture($cmd);