in reply to Net::Telnet::Cisco, a question

Even though perldoc Net::Telnet::Cisco has an example using this syntax, I believe the problem is in this line:
my $ok = $cs->login('login', $switchPassword) or die "Error logging in: @{[ $cs->errmsg+() ]}\n";

You probably shouldn't have the word login as the first argument.   Try empty single quotes instead, like so:
$ok = $cs->login('', $switchPassword) or die "Error logging in: @{ $cs->errmsg+() }\n";
since the first agument is userID.

Additional info can be found at perldoc Net::Telnet.   I don't have access to chassis Catalysts for the time being, otherwise I'd take your code out for a spin.   So please feel free to /msg me or post a reply to this node if any other questions.
    hope this helps,
    Don
    striving toward Perl Adept
    (it's pronounced "why-bick")

p.s. I could be wrong, but AFAIK, the only difference between 'use warnings' and '-w' is what versions of the Perl interpreter support them - the former only on 5.6 or greater, the latter useable from waaay back to 4.something props to tye for the ancient history {grin}.

p.p.s. Welcome to the Monastery, ericj!

Replies are listed 'Best First'.
Re: Re: Net::Telnet::Cisco, a question (ditch the arugment 'login')
by ericj (Initiate) on Dec 19, 2001 at 02:01 UTC
    Thanks for the welcome and the advice. As far as I can tell, Net::Telnet::Cisco works on anything running IOS. I have not been able to get this to work on any Cisco devices running the Catalyst OS. I think I may have to change the perl mod to work on these.