Path: utzoo!attcan!uunet!midway!ncar!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Wait for an output pipe? Message-ID: <9717@jpl-devvax.JPL.NASA.GOV> Date: 27 Sep 90 20:52:38 GMT References: <1990Sep27.195032.25135@uvaarpa.Virginia.EDU> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 17 In article <1990Sep27.195032.25135@uvaarpa.Virginia.EDU> worley@compass.com writes: : : X-Name: Stephen Schaefer : : OK, I could collect the process ID from pipe open, but then how do I : wait for that process? : : $pid = open(RDIST,"|rdist -f -"); : ... write stuff to RDIST ... : close RDIST; : # Wait until process $pid is done : until (wait == $pid) {} Er, you've just written an infinite loop, since close will harvest the pid in question, and wait will return -1 eternally. Larry