[Phoenix-pm] Looking for ideas - Perl Telnet Monitor

Metz, Bobby W, WCS bwmetz at att.com
Thu Jun 30 06:25:47 PDT 2005


Yeh, I was looking at the buffer stuff last night.  Believe expect has a
similar "problem"...that's why I canned that script...plus I hate
expect. :)

-----Original Message-----
From: Andrew Johnson [mailto:aj at exiledplanet.org]
Sent: Wednesday, June 29, 2005 7:34 PM
To: Metz, Bobby W, WCS
Cc: phoenix-pm at pm.org
Subject: Re: [Phoenix-pm] Looking for ideas - Perl Telnet Monitor


On Wed, 2005-06-29 at 19:54 -0500, Metz, Bobby W, WCS wrote:
> [snip]
> IO, i.e. it looks like regular send/expect stuff to me.  Anyone out
> there ever do anything like this or know of some easy Perl trick to
> monitor bi-dir IO on a TTY or Net:Telnet session without completing
> taking control from the user typing.  I'm sure the solution is staring
> me in the face, but right now it eludes me.

bidirectional IO that _doesn't_ take control from the user typing.
Well, no.  But you might try IPC::Open2 (I suppose you could capture
your prog's STDIN and feed it to the telnet process, and pass back
anything that is read from the telnet process's stdout handle).   Check
out Chapter 16 (Interprocess Communcation), section 3.3 (Bidirectional
Communication) of /Programming Perl/.  Since standard I/O buffering is
probably going to "ruin your day" (the Camel's quote), you might also
find IO::Select and the IO::Pty (avail on CPAN) module useful.

Hope this helps.

--aj



More information about the Phoenix-pm mailing list