in reply to Re^2: Variable triggers global destruction hang
in thread Variable triggers global destruction hang
Neither of those hang for me. (5.8.8 on linux)
Update: I just figured out why it hangs in 5.10+.
Closing the Perl handle will cause perl to close the system handle and wait for cat to end.
Without duping: Since the pipe is closed on Perl's side, it gets closed on cat's side and cat exits. perl's wait is short.
With duping and STDOUT gets closed after FH: Since the pipe is still open on Perl's side because of the dup, it doesn't gets closed on cat's side and cat doesn't exit. perl's wait is "infinite".
With duping and STDOUT gets closed before FH: It's like there was no duping.
(The order in which stuff gets freed during global destruction is undefined and/or unpredictable.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Variable triggers global destruction hang
by ig (Vicar) on Sep 12, 2009 at 07:03 UTC | |
by ikegami (Patriarch) on Sep 12, 2009 at 07:11 UTC | |
by ig (Vicar) on Sep 12, 2009 at 07:25 UTC | |
by ikegami (Patriarch) on Sep 12, 2009 at 07:34 UTC | |
by ig (Vicar) on Sep 12, 2009 at 07:42 UTC |