in reply to detecting non-zero exit code when opening from a pipe

Can you suggest a way to have open fail when the pipe command has non-zero result code?

Simple way (that avoids all the "safer argument handling" bullshit) :

open my $fh, "gunzip -c $input_file |" and !eof($fh) or die "$!/$?"; while(<$fh>){ ... }

Elaborate the error handling to suite your needs.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy