Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Pls let me know how to get the value of the command to one variable.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"); print $telnet->cmd("hostname"); $hostname = $telnet->cmd("hostname"); print"Host => $hostname\n"; My Expected Output :- Host => osmosun.wmjapan(i.e hostname) Current outuput => 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Telnet in perl
by shmem (Chancellor) on Jun 26, 2006 at 10:04 UTC | |
|
Re: Telnet in perl
by kabeldag (Hermit) on Jun 26, 2006 at 10:13 UTC | |
|
Re: Telnet in perl
by jesuashok (Curate) on Jun 26, 2006 at 10:07 UTC | |
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 |