From: Hal V. <ha...@th...> - 2002-03-08 15:47:32
|
Yes, it's Term::VT102. Oops. The system I'm dealing with has a habit of freezing at times, so VT102 by itself would not work, since I would have no way of detecting a timeout. I agree having a callback for a specific screen X,Y co-ord would be helpful, but it would not help me for this specific system. It always returns the cursor to 80,24 when posting a screen (on the other hand -- that could prove helpful...). If I were used to data structures and OOP, I'd look at finding a way to combine the two -- that would be extremely powerful. One could get callbacks if certain prompts were sent through the VT102, but could also check the exact screen locations, to get more information (with this system that would be a HUGE help). Off the top of my head, I was thinking I could do an expect statement and, after it's matched, feed the exp_before string into VT102. Assuming there's only been one screen of info (or less) since the last expect, that should put it all on the virtual screen, right? I'm going to look into that. Thanks for the comments. Hal On Friday 08 March 2002 08:04 am, RGi...@a1... wrote: > > 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 |