in reply to Need help on expect
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...
|
|---|