How can I screen-scrape output from telnet in Perl?

后端 未结 6 415
死守一世寂寞
死守一世寂寞 2021-01-18 00:13

I can setup a telnet connection in Perl no problems, and have just discovered Curses, and am wondering if I can use the two together to scrape the output from the telnet ses

6条回答
  •  生来不讨喜
    2021-01-18 00:23

    You're looking for Term::VT102, which emulates a VT102 terminal (converting the terminal control characters back into a virtual screen state). There's an example showing how to use it with Net::Telnet in VT102/examples/telnet-usage.pl (the examples directory is inside the VT102 directory for some reason).

    It's been about 7 years since I used this (the system I was automating switched to a web-based interface), but it used to work.

提交回复
热议问题