in reply to Re^2: problems using Expect.pm in foreach loop
in thread problems using Expect.pm in foreach loop
The reason I was doing that is because if the '/^\s*exit\s*$/i' matched, that means the isql code is an exit statement, which would cause the isql program to terminate, thus I would not want to expect another '\d+\>' prompt.
Taking the if statement out, makes the code work as expected, although I'm not sure why. Also, it does not seem to cause a problem when the exit statement is given. It doensn't hang expecting another prompt. The program just exits, but I really don't understand why.
Can someone help explain? What if I do want to only expect a prompt if the $line does not match '/^\s*exit\s*$/i' ?
Thanks for helping me get this code working and thanks in advance for helping me understand the behavior better.
-G
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: problems using Expect.pm in foreach loop
by keszler (Priest) on Sep 11, 2011 at 04:59 UTC | |
by gg48gg (Sexton) on Sep 22, 2011 at 04:11 UTC | |
by gg48gg (Sexton) on Oct 04, 2011 at 21:06 UTC |