From: Blackstone, J. D. <jda...@ci...> - 2002-06-07 13:15:14
|
> -----Original Message----- > From: Austin Schutz [mailto:te...@of...] > Sent: Thursday, June 06, 2002 3:00 PM > To: Blackstone, J. David > Cc: exp...@li... > Subject: Re: [Expectperl-discuss] Suggestions for FAQ entries > > > On Thu, Jun 06, 2002 at 01:57:15PM -0500, Blackstone, J. David wrote: > > * My spawned processs doesn't produce any output, and > Expect.pm doesn't wait > > for it to end. > > > > [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()); > } > > Austin 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. :) jdb |