use Net::OpenSSH; my $ssh = Net::OpenSSH->new($host); my ($fh, $pid) = $ssh->open2socket(); my $conn = Net::Telnet->new(Fhopen => $fh);