in reply to Expect Trouble

I guess that your error message is not matched due to the new behaviour
Changed from older versions is the regular expression handling. By default now all strings passed to expect() are treated as literals. To match a regular expression pass '-re' as a parameter in front of the pattern you want to match as a regexp.
$object->expect(15, 'match me exactly','-re','match\s+me\s+exactly');

stated in the Expect docs, since you do not reset $err_flag if the prompt is matched.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: Expect Trouble
by tc1364 (Beadle) on Nov 27, 2006 at 15:54 UTC
    No, either of the error messages can be matched fine if present. The trouble is when one of the error messages are matched, the check for $err_flg is being skipped. This may be caused because the command prompt is matched afterwards.