Alright, the next thing I would check would be the encoding on the file. Make sure it's not some crazy dos format with ^M's everywhere, or any other weird line endings. Like I said above cgi can be really picky about syntax, and line endings is just another tough to troubleshoot part of it.