in reply to Telnet in perl
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Telnet in perl
by Anonymous Monk on Jun 26, 2006 at 10:18 UTC | |
by madtoperl (Hermit) on Jun 26, 2006 at 13:14 UTC | |
by Anonymous Monk on Jun 26, 2006 at 13:21 UTC |