in reply to Re^3: close statement issue
in thread close statement issue

I don't know what to tell you; it most certainly does in current perls, and based on the doc, did so in 5.005 too. Try this:
$ perl -we'open FOO, q<| sh -c "sleep 5;exit 123"> or die; print "clos +ing:\n"; close FOO; print $? >> 8' closing: 123
to verify that close() is waiting for the process to finish and putting its status in $?.

(Update: removed lexical filehandle; I'd really like to see you try the above on your SunOS 5.005.)

Replies are listed 'Best First'.
Re^5: close statement issue
by Moron (Curate) on Mar 02, 2007 at 12:17 UTC
    Looking at the documentation you were reading, I think I can understand your confusion. Closing the pipe at one end is not synonymous (or to make it clearer what is happening 'not simultaneous') with termination of the subprocess.

    If a parent closes its end of a pipe and doesn't wait for the child to terminate, the subprocess can become a zombie under SunOS - I discovered waitpid for the first time during the successful process of investigating and solving the problem.

    I am talking reality here, not supposition or documentation.

    Update: I am not convinced by the example which does nothing with the pipe - When I have time, I'll try to reproduce the actual case with some "ps"s to show the zombies.

    -M

    Free your mind