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.
|
|---|