Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Expect problems

by CountOrlok (Friar)
on Dec 16, 2005 at 15:48 UTC ( [id://517271]=note: print w/replies, xml ) Need Help??


in reply to Re: Expect problems
in thread Expect problems

In the original code you were looking for the same pattern twice. You were probably thinking that the first time expect sees the prompt it would match the first case and that second time expect sees the prompt it would match the second case.

This would not work. You need to, within one case, check to see how many times you have seen that prompt. Zero times? do your Apply. Seen it once before? do your save. Seen it twice before? do whatever you need to do next.

In other words keep a counter of how many times you have come across that prompt and send the appropriate response.

-imran

Replies are listed 'Best First'.
Re^3: Expect problems
by sunadmn (Curate) on Dec 18, 2005 at 22:32 UTC
    This probably going to sounds like a stupid question, but would you have a suggestion on how to keep the counter for the case matches??

    Thanks a million
    SUNADMN
    USE PERL

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://517271]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found