Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Sending to and receiving from Telnet

by Superlman (Pilgrim)
on Jul 23, 2001 at 22:37 UTC ( [id://99115]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://99115]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found