in reply to Perl as a telnet server?

I have to ask, what are you trying to do? If you're connecting to a unix machine, wouldn't there already be a telnet server running?

If you want to have a script telnet to a machine and fire commands at it, there's a better solution: Expect.pm. This is a module that mimics the Expect programming language. You fire off a command, Expect listens, and you use standard perl to parse the response. This is really helpful if you have to automatically navigate a menu.

I'm using Expect.pm for a script that automates build installation, and it's made life much easier.

-Logan
"What do I want? I'm an American. I want more."

Replies are listed 'Best First'.
Re: Re: Perl as a telnet server?
by Revelation (Deacon) on Dec 14, 2002 at 18:19 UTC
    A quick question:
    Why use Expect.pm, when you can use Net::Telnet? Could you provide some sort of cursory explenation about why Expect programming would be better for this cause?
    Gyan Kapur
    gyan.kapur@rhhllp.com
      I'm not sure what the cause is. Sure, Net::Telnet will establish the connection, but Expect.pm has all sorts of functions for looking for specific user-defined responses, and automatically recognizes a prompt. If it's a matter of telnetting in, doing an ls, and exiting, Expect is overkill, but if there's an extended conversation between client and server, Expect makes life easier.

      -Logan
      "What do I want? I'm an American. I want more."