use Net::OpenSSH; use Net::Telnet; my $ssh = Net::OpenSSH->new('pa:abc@10.0.0.1'); my ($fh, $pid) = $ssh->open2socket(); my $conn = Net::Telnet->new(Fhopen => $fh); my @lines = $conn->cmd("sh ver"); print join "\n";