How about packing the response into a variable and changing it after the first time?
my $response = "NB_CLT_7.6.0.2\r"; ... ... [ qr/Enter pack name \(or q\) \[q\]:\s+/ => sub { $exp->send($response); $response = "q\r"; exp_continue; } ],
Admittedly, I have never used Expect so I cannot test whether this would work. Also, this would involve a closure of $response, so I am not sure...
In reply to Re: Need help on expect
by hdb
in thread Need help on expect
by toaravind
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |