I was able to resolve my issues with Net::Telnet not working, thank you to
everyone who replied to my post.  Now I have something different.  Below is
a script that I wrote, it telnets to a Cisco router, goes into enable mode,
and is supposed to print the output of a "show ip route" command.  The issue
is that the script times out at line 13, which is where it is supposed to
send the command.  I know that the telnet is connecting, and the script is
authenticating, because if it wasn't it would time out way before line 13
(at least I hope that is correct).  Can anyone tell me why it is timing out?
I thought that maybe it was because there was no newline at the end of line
13, but supposedly when using cmd there is an automatic newline appended to
the string.  I would appreciate any help.


use Net::Telnet();
$t = new Net::Telnet;
$t->open("x.x.x.x");
$t->waitfor('/Username:/');
$t->print("glupi");
$t->waitfor('/Password:/');
$t->print("neteng1283");
$t->waitfor('/br01-nyc1.ny>/');
$t->print("enable");
$t->waitfor('/Password:/');
$t->print("neteng1283");
$t->waitfor('/br01-nyc1.ny#/');
@lines = $t->cmd("show ip route");
print @lines;



Guy H. Lupi


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to