in reply to Need help on expect
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need help on expect
by Anonymous Monk on Feb 20, 2015 at 13:02 UTC | |
by hdb (Monsignor) on Feb 20, 2015 at 14:00 UTC | |
by Anonymous Monk on Feb 20, 2015 at 14:05 UTC | |
by toaravind (Initiate) on Feb 25, 2015 at 08:48 UTC |