note
saintmike
<blockquote>What Perl version and system?</blockquote>
Just verified: With an old perl-5.8 I get the different behavior with/without the variable, with perl-5.10 it hangs regardless. It's reproducable (on 5.8) with variables that hold regular expressions, not with variables that hold scalars. Really weird, probably an old bug that got fixed in 5.10.
<blockquote>The "bug" is that file handles aren't closed during global destruction — Perl let's the system do it — so cat is left running, ignored.</blockquote>
Nice, that explains your examples well, but what is the reason that
<p><c>
open FH , "| cat " or die ;
open STDOUT, ">&FH"or die ;
</c>
hangs while
<p><c>
open FH , "| cat " or die ;
</c>
doesn't?
794885
794886