From the Net::Telnet manual:
Debugging
The typical bug causes a timeout error because you've made incorrect assumptions about what the remote side actually sends. The easiest way to reconcile what the remote side sends with your expectations is to use input_log() or dump_log(). dump_log() allows you to see the data being sent from the remote side before any translation is done, while input_log() shows you the results after translation. The translation includes converting end of line characters and stripping and responding to TELNET protocol commands.
Use this to see what the other side is really returning (chances are there's an escape character or a spacing issue that you're missing). dump_log produces a huge amount of output, but you can find exactly what you should be waiting for. I'd be willing to be that you
really want to be waiting for something like this:
$t->waitfor('/<--- More ---> /');
I've used this several times when automatic switch/router scripts mysteriously seem to "not work".....
BlueLines
Disclaimer:
This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.