Disclaimer: Without having the actual program to interact with, the following is only based on a simplified test. Also, I assume that the program's prompts are as shown in the regular expressions (with the exception of \s+ instead of \\s+).
Another problem is that the second "Enter pack name" regex, qr/Enter pack name \(or q\) \[q\]: \(q\)\s+/, will never match, because the first "Enter pack name" regex, qr/Enter pack name \(or q\) \[q\]:\s+/ will always match first. So one possible solution is to move the second regex before the first.
Or, you could remove the second "Enter pack name" regex, and apply either of the two solutions given above (1, 2), they do seem to work under the assumptions given above.
In reply to Re: Need help on expect
by Anonymous Monk
in thread Need help on expect
by toaravind
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |