in reply to Re^3: Can't close pipe to invalid process
in thread Can't close pipe to invalid process
I'm wondering if an assumption is made internally about piping to the executable until Perl receives a return value on closing?!?
Looking back at what you're sending down the pipe; it is way less than the typical 4kb buffer size; which means nothing will be sent until you try to close, at which point it will attempt to flush the buffer through and it is only at that point that the broken pipe will be discovered.
You could verify that conjecture by trying to print more data to the pipe:
my $fh; ok( open($fh, "|-", "prince - 2>/dev/null $test_file"), "Open +$test_file for writing" ); print( $fh 'x' x 1024 ) or die "Print failed at $_ with $!" fo +r 1 .. 5; ok( close($fh), "Close $test_file");
My guess is that will fail at the 4th or 5th iteration with "Broken pipe".
|
---|