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

I'm trying to write a script to telnet to several cisco devices. I have several Cat 5000 series switched with a prompt of 'switch' that I can't telnet to with the module. If I change the prompt to 'switch>' telnet works fine. Does anyone have any idea why it works this way?

Replies are listed 'Best First'.
Re: Using Net::Telnet::Cisco
by traveler (Parson) on Aug 16, 2001 at 02:28 UTC
    From the pod: The default cmd_prompt is /[\w().-]*[\$#>]\s?(?:\(enable\))?\s*$/, suitable for matching promtps like 'rtrname$ ', 'rtrname# ', and 'rtrname> enable) '. Note the [\$#>] in the RE showing the prompt endings. Presumably you can change cmd_prompt by using the prompt method of Net::Telnet thus:
    $foo=Net::Telnet::Cisco->new( Host => '10.10.10.10' ); $foo->promp($new_prompt);
    but I haven't tried this as I don't have the Ciscos in my lab just now.

    HTH -- traveler