Perlfect Solutions

[Perlfect-search] Why it is not stable?

Attiah, Ibrahim A
Sun, 24 Nov 2002 09:39:18 +0300
The below code worked fine and gave the desired result many time but
suddenly started to return the same earlier error message "timed-out
waiting for command prompt at line 8". I used to get this
message before 
Until I got a help from to add the Prompt setting to
the code as it appear below. Please help. Thank you.

use Net::Telnet;
my $Telnet = new Net::Telnet; 
my $InHandle = $Telnet->input_log("inlog.txt"); 
my $OutHandle = $Telnet->output_log("outlog.txt"); 
my $prmpt = '/[\w().-]*[\$#>:.]\s?(?:\(enable\))?\s*$/'; 
$telnet = new Net::Telnet (Timeout=>40, Prompt => $prmpt,
Errmode=>'die'); $telnet->open('');
$telnet->login('user','user'); @lines= $telnet->cmd("Networking"); 
@lines= $telnet->cmd("IP");
@lines= $telnet->cmd("ipmac");
print STDOUT @lines;