HEX
Server: Apache
System: Linux gator4103.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64
User: carold (32340)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //usr/share/doc/perl-Net-OpenSSH/examples/net-telnet.pl
#!/usr/bin/perl

use strict;
use warnings;

use Net::OpenSSH;
use Net::Telnet;

$Net::OpenSSH::debug = -1;

my $ssh = Net::OpenSSH->new('localhost');
my ($fh, $pid) = $ssh->open2pty();
my $conn = Net::Telnet->new(Fhopen => $fh);
my @lines = $conn->cmd("find /tmp");
print @lines;
my @lines1 = $conn->cmd("ls");
print "\n\nls:\n", @lines1;