in reply to Re^2: Telnet in perl
in thread Telnet in perl
See the output:-Use Net::TelNet; $prompt = "\<manoj\\\@ostrich.india:\>"; $telnet = new Net::Telnet ( Timeout=>3600,Prompt => "/$prompt/i",Errmo +de=>'die'); $telnet->open("ostrich"); $telnet->waitfor('/login: $/i'); $telnet->print('manoj'); $telnet->waitfor('/password: $/i'); $telnet->print('manoj'); $telnet->waitfor("/$prompt/i"); print $telnet->cmd("hostname"); @hostname = $telnet->cmd("hostname"); print"Host => @hostname\n";
Thanks and Regards,ostrich.india Host => ostrich.india <manoj@ostrich.india:>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Telnet in perl
by Anonymous Monk on Jun 26, 2006 at 13:21 UTC |