in reply to Re: Net::Telnet::Cisco: nullifying first prompt in output for cmd() matching
in thread Net::Telnet::Cisco: nullifying first prompt in output for cmd() matching

Actually, I don't think you can. From what I know, cmd() matches against the prompt. That's fine if the first time you see a prompt, it's been matched against a specific cmd or other call. What I'm talking about isn't the possibility of matching against a funky new prompt or something, which I kinda think is what you're suggesting. The problem I have is that there's a prompt which comes up *the second* I connect to the device. In other words, there's no way I can match against it and remove it from the buffered stream. And clearing the buffer doesn't beat that in my experience either. When you capture the output from a 'cmd()' the way it seems to work is that it reads the buffer of everything which has occurred in the telnet session so far. That buffer is matched against for every call made against the router, and every prompt is accordingly dealt with. So if you have a prompt appearing anywhere in the stream and it's not been matched, then all of your matched output will be one prompt behind. Sorry if you're dead right and I've missed it, but I can't see what the prompt documentation provides for other than matching against a given string.
toeslikefingers.com - because you've got too much time on your hands
  • Comment on Re: Re: Net::Telnet::Cisco: nullifying first prompt in output for cmd() matching

Replies are listed 'Best First'.
Re^3: Net::Telnet::Cisco: nullifying first prompt in output for cmd() matching
by Anonymous Monk on Oct 09, 2008 at 07:21 UTC
    $session->waitfor_pause(1) may be a workaround. /chAlx