Thursday, 22 August 2013

Pattern Match Timed-out

Pattern Match Timed-out

I use Perl Net::telnet for connecting to my router and change some
options, but i get this error:
pattern match timed-out
every thing is true (user , pass , pattern and etc), i am going crazy for
the source of this error. my code is:
use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die');
$telnet->open('192.168.1.1');
$telnet->waitfor('/login[: ]$/i');
$telnet->print('admin');
$telnet->waitfor('/password[: ]$/i');
$telnet->print('admin');
$telnet->waitfor('/\$ $/i' );
$telnet->print('list');
$output = $telnet->waitfor('/\$ $/i');
print $output;
What should i do now? Is there any alternative way? Thank you

No comments:

Post a Comment