Excellent! Given your advice, I was able to see how use my telnet object $t as a socket.
First I set the TERM TYPE Option in the $nto object:
my %options = (TTYPE => { 'DO' => sub {} },);
my $nto = Net::Telnet::Options->new(%options);
Then I set my telnetmode to 0:
$t->telnetmode(0);
After opening my host, I received three sets of data from the application server. Since the first request contained the TERM TYPE request, I sent the reply that I was an 'xterm' with the sendOpt function:
$t->open($host);
recv($t, $data, 1024, 0);
$nto->answerTelnetOpts($t, $data);
$nto->sendOpt($t, 'SB', 24, 'IS', 'xterm');
recv($t, $data, 1024, 0);
$nto->answerTelnetOpts($t, $data);
recv($t, $data, 1024, 0);
$nto->answerTelnetOpts($t, $data);
And then I went about my business as usual with Net::Telnet:
$t->telnetmode(1);
($prematch, $match) = $t->waitfor('/login:/');
|