Superlman has asked for the wisdom of the Perl Monks concerning the following question:

Hello! I've always used Telnet for all my MUD needs, but it occured to me that I could spruce this up a little bit.

What I'd like to do is put an additional layer in between Telnet and me: Basically, it would be a perl script which takes my input, does whatever I want to it (substitute predefined strings with a long command, for example) and return the output (after, say, putting all instances of my name in red or something), ready to take more.

I've learned enough perl by now to handle the regexes and so forth. What I need help with is talking to telnet. Can I both send input to and receive output from Telnet simultaneously, or must it be back-and-forth one way? I'm willing to settle for half-duplex if nothing else.

Anyone?

Thank you!

Replies are listed 'Best First'.
Re: Sending to and receiving from Telnet
by lshatzer (Friar) on Jul 23, 2001 at 22:40 UTC
    Have you looked at Net::Telnet? If so, are you having problems with it?
      Thank you! This looks to be perfect!

      Out of curiousity, though, if I had to do it some other way, is this possible? For example, could I open "telnet $address $port" as a filehandle and write and read from it? How would this (or something close to it) be done?

        I would suggest reading perlipc for more information.