tc1364 has asked for the wisdom of the Perl Monks concerning the following question:
sub work () { my $err_flg = 0; $exp->send("command\r"); $exp->expect(5, [ qr/ERROR MESSAGE 1/i, sub { my $self = shift; sleep(1); $err_flg = 1; }], [ qr/ERROR MESSAGE 2/i, sub { my $self = shift; sleep(1); $err_flg = 1; }], [ qr/command prompt/i, sub { my $self = shift; sleep(1); $self->send("command\r"); }] ) or return(1); if ($err_flg == 1) { return(1); } return(0); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Expect Trouble
by shmem (Chancellor) on Nov 27, 2006 at 14:52 UTC | |
by tc1364 (Beadle) on Nov 27, 2006 at 15:54 UTC | |
|
Re: Expect Trouble
by wulvrine (Friar) on Nov 27, 2006 at 16:17 UTC |