if (!$child) {
open STDIN, "<&", $tf;
&$childprep() if defined $childprep;
- exec $cmd @a; die $!;
+ exec $cmd @a; die "@a $!";
}
return $fh;
}
-sub pipethrough_run_finish ($) {
- my ($fh)= @_;
+sub pipethrough_run_finish ($$) {
+ my ($fh, $what)= @_;
$fh->error and die $!;
- close $fh or die "$! $?"; die $? if $?;
+ close $fh or die "$what $! $?"; die $? if $?;
}
sub pipethrough_run ($$$@) {
my $r;
{ undef $/; $!=0; $r= <$pt>; }
defined $r or die $!;
- pipethrough_run_finish($pt);
+ pipethrough_run_finish($pt, "@a");
return $r;
}
sub pipethrough_run_gzip ($) {
chomp($l) or &$bad_data('missing end-of-line');
$l !~ m/\P{IsPrint}/ or &$bad_data('nonprinting char(s)');
- $l !~ m/\\/ or &$bad_data('data contains backslashes');
my @v= split /\t/, $l, -1;
@v==6 or &$bad_data('wrong number of fields');
my ($commod,$stall) = @v;