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

Is CGI::Debug still installed, unbowdlerized?


Improve your skills with Modern Perl: the free book.

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

Replies are listed 'Best First'.
Re^2: No output from CGI script when using CGI::Debug
by pagespank (Initiate) on Nov 07, 2011 at 20:47 UTC

    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

      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.