use Net::OpenSSH; my $ssh = Net::OpenSSH->new('repository'); $ssh->error and die "Can't ssh to $host: " . $ssh->error;