It appears that the file() function causes file access problems for perl
cgi scripts accessing the same files. I am using Perl v5.6.0 in linux with
PHP/4.0.4pl1. After running a php app using the file() function, any perl
cgi trying to access the same file randomly dies returning an internal
server error: premature end of script headers.
The simple fix is to
use fopen(), fgets() and fclose() instead of file().