From: Austin S. <te...@of...> - 2002-06-07 20:01:55
|
> > > [Might need to reword this. Suggestions? See > > > http://use.perl.org/~djberg96/journal/5430/] > > > > > > Spawning a process just starts it up. From then on, any > > interaction with > > > your process, including waiting for it to end, is up to > > you. Usually this > > > involves expect()ing output. If there is no output, > > however, you will need > > > to expect() a special signal sent when the process ends called eof. > > > > Maybe I'm missing something. Why do I _need_ to expect > > eof? Expect > > should return at eof. It should also be setting $err. > > > > $process->expect(undef); > > if( $process->error() =~ /EOF/ ) { > > waitpid($process->pid()); > > } > > > Or you can do that. Want to rewrite it to include the alternative? :) > The way I showed is more like the original TCL Expect. I'm happy to see > Expect.pm makes Expect very Perl-like by following the TMTOWTDI rule. :) > I could. I guess there could be a little discussion of the different ways to reap child processes. Another way to do it is just: undef($process); which reaps the process as part of the Expect deconstructor. Are we submitting interesting things as patches to what's in CVS? Austin |