I switched to IPC::Run but has not faired any better. I keep getting a premature end error even though there is input data. Here is the relevent code segment I have now after many various iterations:
my $h=start(\@cmd,\$in,\$out,\$err);
while (!eof(FILELIST)) {
$thisline=readline(FILELIST);
($thisfile,$thisfilesize)=split(/\t/,$thisline
+);
$in="$thisfile\n";
$h->pump;
while ($h->pumpable) {
$h->pump;
}
if (length($out)>0) {
putmsg($out);
}
$total+=$thisfilesize;
$complete=sprintf("%.2f",$total/$dumpsize);
putmsg("$complete%\n");
}
finish $h;
In one of my iterations I avoided the premature end message however, the script simply quits on the first call of 'pump'. No error message, nothing. Does anyone one see anything obvious? Thanks. |