Please note the modification done on your code.
Use Net::TelNet; $telnet = new Net::Telnet ( Timeout=>3600,Prompt => "/$prompt/i",Errmo +de=>'die'); $telnet->open("susan"); $telnet->waitfor('/login: $/i'); $telnet->print('blab'); $telnet->waitfor('/password: $/i'); $telnet->print('blab'); $telnet->waitfor("/$prompt/i"); @hostname = $telnet->cmd("hostname"); print"Host Details => ", join("-",@hostname) , "\n";
In reply to Re: Telnet in perl
by jesuashok
in thread Telnet in perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |