in reply to Re^2: Perl's Expect - foreach loop
in thread Perl's Expect - foreach loop

Still guessing, but I think what you want is multiple calls to expect, one for each time you want it to respond to something you've sent:
$exp->expect(180, [ qr/>/i, sub { my $self = shift; sleep(1); $self->send("TABLE $table; FORMAT 132 PACK\r"); }]); $exp->expect(180, [ qr/UNKNOWN TABLE/i, sub { my $self = shift; sleep(1); $self->send("")ort\r"); next; }], [ qr/TABLE: $table/i, sub { my $self = shift; $self->send(""); }]); ...etc...

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^4: Perl's Expect - foreach loop
by tc1364 (Beadle) on Apr 28, 2005 at 18:49 UTC
    You were right, the multiple calls worked fine. I sincerely appreciate the assistance you have provide me, thank you very much!
Re^4: Perl's Expect - foreach loop
by tc1364 (Beadle) on Apr 28, 2005 at 18:51 UTC
    You were right, the multiple calls worked fine. I sincerely appreciate the assistance you have provided me, thank you very much!