Dec 29, 2011, 4:04 AM
Post #4 of 14
I don't think so. You are expecting during the login process the patterns /login:/ and /password:/, and reading the documentation shows that this is exactly the default.
Re: [Trunkenstein] Net::Telnet help needed
[In reply to]
BTW, I now also see that you don't wait for a prompt, after the login has succeeded. This means that if you try the login() function, and that system's prompt does not correspond to the default prompt, this won't work unless you explicitly define the correct prompt (which is a good idea anyway).
In your version, where you send the "dir" command immediately after the password, it might be that you are too fast, and the command gets lost. You should either wait a few seconds, or do a waitfor() in between.
Another issue to consider is the correct line ending. Currently, your "print" always appends the current output_record_separator. I don't remember whether this works with sending the password too, because during password entry, the terminal might be turned into raw mode. I suggest that, even if you believe that the standard login() routine is not suited for your case, you at least check the code of login() to see how they deal with sending the password.
BTW, both systems (client and server) are Unix/Linux?