Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-29 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found