If I am understanding your requirement correctly then a quick fix might be this:
# at the top of your script: my $state = 0; # ... [ qr/Enter pack name \(or q\) \[q\]:\s+/ => sub { if ($state==0) { $exp->send("NB_CLT_7.6.0.2\r"); } else { $exp->send("q\r"); } $state++; exp_continue; } ],
(untested)
In reply to Re: Need help on expect
by Anonymous Monk
in thread Need help on expect
by toaravind
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |