in reply to Re^3: Variable triggers global destruction hang
in thread Variable triggers global destruction hang

But the OP has duplicated the file handle in both cases.

I have tried with 5.8.8 (redhat build) and 5.10.0 (default build) on Linux. Neither waits on the sub-process - neither hangs. But the OP says 5.10 hangs with either form. If it is hanging waiting for the sub-process, then something very different is happening.

So, question for the OP: who's build and on what platform are you seeing this?

  • Comment on Re^4: Variable triggers global destruction hang

Replies are listed 'Best First'.
Re^5: Variable triggers global destruction hang
by ikegami (Patriarch) on Sep 12, 2009 at 07:11 UTC

    But the OP has duplicated the file handle in both cases.

    huh?

    open FH , "| cat " or die ; open STDOUT, ">&FH"or die ; <-- dup
    open FH , "| cat " or die ; <-- no dup

    But the OP says 5.10 hangs with either form

    huh? He asked "what is the reason that [the one with duping] hangs while [the one without duping] doesn't?" Clearly, both don't hang for him.

      I'm confused. The two cases I see in the original post are:

      open FH , "| cat " ; open STDOUT, ">&FH";

      and

      my $foo = qr(a); open FH , "| cat " ; open STDOUT, ">&FH";

      FH is duplicated to STDOUT in both cases.

      And, saintmike said:

      Just verified: With an old perl-5.8 I get the different behavior with/without the variable, with perl-5.10 it hangs regardless.

      I took this to mean that with 5.10 it hangs waiting for the sub-process to terminate.