in reply to Re^5: Net::Telnet timed out when logging in
in thread Net::Telnet timed out when logging in
You need to read the Net::Telnet documentation, and do, at least, a small configuration of the module.
$telnet = new Net::Telnet(timeout => 10, # do not you the 'return' Errmode => 'die', # change the prompt Prompt => '/ </$'); # I'm gue +ssing this prompt ' <' $telnet->input_log($log_file); $telnet->dump_log($dump_file); $telnet->waitfor( -match => qr{ENTER USERNAME} ); $telnet->print($username); $telnet->waitfor( -match => qr{ENTER PASSWORD} ); $telnet->print($passard); # # and finally send a command @lines = $t->cmd("who"); for (@lines) { print }
|
|---|