my $child_pid = open( CHILD, "| child_program arg1 arg2" ) || die "unable to start child_program\n"; # Feed the child, if that's necessary select CHILD; $|++; # turn off output buffering print CHILD $/; # send a blank line # give the child about 5 seconds to produce something my $counter = 0; until ( -s "child_output.file" or ++$counter == 5 ) { sleep 1; } # now, we could kill $child_pid, or just: close CHILD;