use Net::OpenSSH; my $ssh = Net::OpenSSH->new('username:password@hostname', ssh_cmd => '/bin/ssh'); $ssh->error and die "Can't ssh: " . $ssh->error;