|
From: <RGi...@a1...> - 2002-03-08 13:04:50
|
> I've been using Expect for Perl to handle a connection with > another system > over a modem and it's been working well, but I've recently found > IO::VT102. That's Term::VT102, right? > I've been using IO:VT102 in post processing the capture files. > Now I'm wondering if it's possible to use this mod with Expect. > That would let me extract the need information while online. > > To use VT102, I need to be able to send it the input strings, like > $vt->process($mydata). An Expect object is just a file handle that you can read from and write to, so it should be easy to link that to Term::VT102, just read a chunk and call process() with it. The OUTPUT callback should simply do a syswrite to the Expect object. > Is there some way to feed data coming from the modem into both > Expect and VT102 at the same time? It would mean I can use > Expect to tell when data I need is on the screen, then I could > pull it straight from the virtual VT102 terminal. No, you can't use the expect() method concurrently, as this would consume the characters. Instead, you have to register a ROWCHANGE callback and do your processing there via normal regexp matches. [BTW, what I think is missing from Term::VT102 is the ability to get a callback when the cursor position enters certain coordinates (to be able to react to a prompt).] Hope this helps, Roland -- RGi...@cp... |