in reply to Everything gets output twice
Very odd coincidence--hiroki and I experienced a similar problem this morning.
We were using path info in the URL to the script: http://script.pl/OTHER_DATA. Our script was pulling in an HTML template which pulled in an image: src="images/test.png". Of course, the browser didn't handle the path info correctly and interpreted the image source to be http://script.pl/images/test.png. Thus, the script was being called twice by the browser and printing duplicates to the error log.
If this was your exact same problem then that'd be an odd coincidence indeed. Else, it would be helpful if you post the code, or else dump the environment variables to the log file and post those.