PerlでTelnet接続を問題なくセットアップでき、Cursesを発見したばかりで、2つを一緒に使用してTelnetセッションからの出力を取得できるかどうか疑問に思っています。
以下の簡単なスクリプトを使用して、STDOUTの内容を行、列に基づいて表示できます。
use Curses;
my $win = new Curses;
$win->addstr(10, 10, 'foo');
$win->refresh;
my $thischar=$win->inch(10,10);
print "Char $thischar\n";
そして、以下を使用して、telnet接続を開き、問題なく\receiveコマンドを送信できます。
use net::telnet;
my $telnet = new Net::Telnet (Timeout => 9999,);
$telnet->open($ipaddress) or die "telnet open failed\n";
$telnet->login($user,$pass);
my $output = $telnet->cmd("command string");
...しかし、私が本当にやりたいのは、telnet応答(端末制御文字を含む)を取得し、cursesを使用して行\列ベースで検索することです。私が2つをつなぐ方法を知っている人はいますか?呪いはSTDOUTでしか機能しないようです