Did your CGI-script end with an error? What does the Apache error log show? Is your script very slow (in other words does it run for a long time before finishing the file)?
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law