From: Ken I. <fn...@ua...> - 2008-02-05 17:35:03
|
On Mon, Feb 04, 2008 at 07:21:25PM -0800, sumncguy wrote: > > After racking my brains for a few weeks, I found that > > Expects interact will hold and continue / return based on user input. Im now > trying to accomplish that with the Perl Expect.pm module. It says ... > # $process->interact([$in_handle],[$escape sequence]) > > $child->interact(); > > $child->interact(STDIN,'X'); > $child->interact([STDIN],['X']); > $child->interact( ,'X'); obviously not > $child->interact('X'); here too .. > > also tried all the above with dub quotes. > .... must be missing something. > > In expect > > interact "X" return > > Stops, give the user a router (for example) prompt back. When he/she hits X, > the expect script continues. You didn't hit upon the necessary syntax for passing a filehandle, e.g.: $ grep BAIL src/perl/radio-server.pl $exp->interact(\*STDIN, 'BAIL!'); The form \*STDIN is a reference to a typeglob, and is necessary to pass the filehandle as an argument. Ken -- Ken Irving, fn...@ua... Water and Environmental Research Center Institute of Northern Engineering University of Alaska, Fairbanks |