in reply to Matching prompt in Net::Telnet

I believe the real problem is merely that the value specified for prompt in line 5 is different than the value in line 7. If you use the same value in each case, you won't have the thorny problem of seeing a prompt both before and after the command in line 7 is sent.

Replies are listed 'Best First'.
Re^2: Matching prompt in Net::Telnet
by kkarne (Novice) on Nov 11, 2006 at 18:54 UTC
    Thanks everyone for your valuable input. Quester, I guess what you said was right. I removed all prompts and just put in one prompt at the begining of object creation.
    use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die',Input_Log=>'out.txt', Prompt=>'/[\$%#>]/');
    This works!! The default prompt  '/[\$%#>] $/' didn't work because it had the extra $ towards the end of the string.