Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!psuvax1!rutgers!mcnc!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: Wait for an output pipe? Message-ID: <1990Sep28.172753.7202@uvaarpa.Virginia.EDU> Date: 28 Sep 90 17:27:53 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 23 X-Name: Larry Wall In article <1990Sep27.195032.25135@uvaarpa.Virginia.EDU> worley@compass.com writes: : $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. Yeah, I forgot that close waits for the process to finish. Dale Worley Compass, Inc. worley@compass.com -- "We'd better wake up and smell the goats or it will be burlap soup for all of us!" "Burlap soup?" "No thanks, I had lunch on the way over."