471,872 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,872 software developers and data experts.

Perl telnet looping problem

Can someone look at the code below and tell me whats going on?

Here is the problem. I can successfully telnet one of our routers and
successfully put in a command in the while statement, but when the loop goes
around a second time, it gives me:
"pattern match timed-out at c:\filename.pl line 21"

It can't get past the waitfor statement for a prompt the 2nd go around in
the loop.


================================================== ====

use Net::Telnet;
use constant PASS=>'password';

$telnet = new Net::Telnet (Timeout=>25);


$telnet->waitfor('/assword: /');

while ($i < 6400) {

print "LOOPED!!!\n"; 'for troubleshooting purposes
$prompt = $telnet->waitfor('/> /');
print "MADE IT PAST PROMPT\n"; 'for troubleshooting purposes

$statement=('<command goes here>');

print "PORT FILTER ADDED\n"; 'for troubleshooting

Jul 19 '05 #1
0 7184

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kai Thorsrud | last post: by
4 posts views Thread by Patricia Mindanao | last post: by
2 posts views Thread by johnyboy1230987 | last post: by
9 posts views Thread by ravimath | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.