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.
-GIn reply to Re^3: problems using Expect.pm in foreach loop
by gg48gg
in thread problems using Expect.pm in foreach loop
by gg48gg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |