in reply to Very wierd CGI behavior

Are you using CGI::Carp's fatalsToBrowser, and printing a valid header as soon as possible (so the error message is sure to come after a header)?