From: Austin S. <te...@of...> - 2002-07-31 20:41:07
|
On Wed, Jul 31, 2002 at 03:26:00PM -0500, Blackstone, J. David wrote: > I don't think you're supposed to use pids with -i; I think you're supposed > to use the Expect object itself. Otherwise, how would it get the object to > expect on? > That's right. I think the docs are clear on that point, but they seem a little vague that expect isn't supposed to be called as an object method: $object->expect($timeout, @match_patterns) or, more like Tcl/Expect, expect($timeout, '-i', [ $obj1, $obj2, ... ], [ $re_pattern, sub { ...; exp_continue; }, @subparms, [ 'eof', sub { ... } ], [ 'timeout', sub { ... }, \$subparm1 ], '-i', [ $objn, ...], '-ex', $exact_pattern, sub { ... }, $exact_pattern, sub { ...; exp_continue_timeout; }, '-re', $re_pattern, sub { ... }, '-i', \@object_list, @pattern_list, ...); which might imply something like $object->expect($timeout, '-i'...). Perhaps it would be clearer to have: Expect::expect($timeout, '-i', [ $obj1, $obj2, ... ], [ $re_pattern, sub { ...; exp_continue; }, @subparms, [ 'eof', sub { ... } ], [ 'timeout', sub { ... }, \$subparm1 ], '-i', [ $objn, ...], '-ex', $exact_pattern, sub { ... }, $exact_pattern, sub { ...; exp_continue_timeout; }, '-re', $re_pattern, sub { ... }, '-i', \@object_list, @pattern_list, ...); Austin |