in reply to Re: No output from CGI script when using CGI::Debug
in thread No output from CGI script when using CGI::Debug

Yep it's still installed, however I think the error may lie not with CGI::Debug per se.

My scripts are outputting plain text to the browser ok without CGI::Debug; however when I try a script that exports attachments (ie using Spreadsheet::WriteExcel), I now get a bunch of weird characters, followed by the HTML of the page with messed up line breaks.

Very weird but perhaps Apache related? Am running on RHEL 5 & Apache 2.2.3

  • Comment on Re^2: No output from CGI script when using CGI::Debug

Replies are listed 'Best First'.
Re^3: No output from CGI script when using CGI::Debug
by johnny_carlos (Scribe) on Nov 07, 2011 at 21:21 UTC
    If you are trying to stream a spreadsheet to a browser, you'll need to define a different content-type. Browsers don't automatically know what the web server is sending, you define that in the content-type(also known as MIME). The code snippet above is telling the browser, "Hey, what I'm about to send you is text/html". So if the web server outputted excel binary code instead, the browser will render it as funny text.