From: Heidi Ng <ng_...@ya...> - 2002-07-31 21:21:12
|
I tired using the Expect object as suppose to the object's pid. However, it didn't work, so that's why I tried using the pid. The thing I was trying to do was: 1) created an Expect object...did some print's and expect's 2) the script went off to do something else. 3) wanted to talk to the expect object created previously but couldn't. Let me try it with using the object again. Thanks! Heidi Austin Schutz <te...@of...> wrote: 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 --------------------------------- Do You Yahoo!? Yahoo! Health - Feel better, live better |