What the symptoms actually *are* would be more useful in solving
the problem then your interpretation of what they "look like."
You should be providing the first instead of the second, rather
than the other way around.
OK,
here are the symptoms:
$linenumber=796;
open (PROG, "|$MyProgram &> /dev/null") or &err;
print PROG "Load file $FileName\n";
print PROG "Calculate all\n";
$linenumber=801;
close (PROG) or &err;
$linenumber=$803;
....
sub err {
print "error - last line to be noted was $linenumber \n";
exit;
}
The symptoms being that it sometimes ends with sub err printing 801,
suggesting that it ended on the line 'close (PROG) or &err;', ie
failure to close the program [premature close attempt?]. This does not
happen when I run the Perl script by hand, but it does sometimes happen
when I run it as CGI or with crontab. The Apache timeout, as far as I
can tell, is more allowing than the time it takes for the script to
halt prematurely (and does not explain the crontab issue). Any other
ideas?
Thanks for your time,
JA