By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,948 Members | 1,585 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,948 IT Pros & Developers. It's quick & easy.

Perl telnet looping problem

P: n/a
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:\ 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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.