HEX
Server: Apache
System: Linux br1102.hostgator.com.br 5.14.0-687.17.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jun 22 07:21:26 EDT 2026 x86_64
User: rkcent87 (3754)
PHP: 8.3.32
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;