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

I am writing a script that will open up a telnet connection and then login. So far so good. The problem I am having is determining whether the host returns a prompt or not. I know this may seem a very stupid question, but I have only been working with perl for about 1 month. Thanks in advance for any suggestions. Prince 99

Replies are listed 'Best First'.
Re: Password Verification
by TheoPetersen (Priest) on Feb 22, 2001 at 02:47 UTC
    Use Expect instead of writing this yourself.
Re: Password Verification
by mp3car-2001 (Scribe) on Feb 22, 2001 at 05:46 UTC
    I've gotta agree on Expect here. Besides stuff like this, expect works very well to hack together common things. A month ago I'd have said SSH, but now we have an SSH module. If you want to automate anything on the console Expect is the way to do it and I thoroughly recommend the O'Reilly on it as it has many well written examples and worth the money.
Re: Password Verification
by McD (Chaplain) on Feb 22, 2001 at 03:43 UTC
    I use Net::Telnet for this.

    Not real secure, mind you. And Expect is probably better for all but trival stuff.

    Peace,
    -McD