From: Chuck S. <Chu...@me...> - 2007-07-26 15:08:25
|
It appears that whenever I use send(), the next expect() will read the previous line again and thus causing the send() to occur twice. I read the FAQ and it appears this is a common problem? Has anyone figured out a workaround? Thanks. my $exp = new Expect; $exp->raw_pty(1); $exp->spawn("randomApplication.pl"); while ($value != 3) { my $value = $exp->expect($timeout, [ qr/sender/], [ qr/receiver/], [ qr/whatever/] ); if ($value == 1) { $exp-send("Yes"); } elsif ($value == 2) { $exp-send("No"); } } |