From: John B. (Lists) <li...@jo...> - 2007-03-20 11:18:02
|
Hi Ronald, That works perfectly. Thanks! John On Tue, 2007-03-20 at 11:22 +0100, Roland Giersig wrote: > how about > > my $promptRE = join("|", keys %args); > > $exp->expect($timeout, > [ > qr/^($promptRE) /, > sub { > $self = shift; > my $prompt = ($self->matchlist())[0]; > $self ->send($args{$prompt}, "\n"); > exp_continue > } > ], > ); > > to use a list of responses in the hash to be able to handle multiple > occurances of the same prompt is left as an exercise to the reader... > :-) |