Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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.) In reply to Re^3: Variable triggers global destruction hang
by ikegami
|
|