in reply to Expect Trouble
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 |