on Fri, 24 May 2002 15:12:18 GMT, Naser Ali wrote:

> I have gotten this program from the Net::Telnet readme file, but it
> does not work. When I run it it output a message which I don't
> understand. How can I give it userid and passwd for the telnet
> session..? 
> 
> [...]
> $t = new Net::Telnet (Timeout => 10,
>                       Prompt => '/ksh\$ $/');

Add the following lines to login:

  $t->open("name-or-ipaddress of your server");
  $t->login("username", "password");

substituting your own values vor servername, username and password

> [...]
> The output message is
> 
> timed-out waiting for command prompt at Telnet.pl line 9

You defined your prompt as the following regex: '/ksh\$ $/', which must 
match any prompt your shell provides on login.
Do a manual login and inspect your shell prompt, then write a regex that 
matches this prompt.
You could also leave out the 'Prompt' parameter from the 'new'-call, then 
the default  '/[\$%#>] $/' will be used, which works most of the time.

-- 
felix

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to