Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by pagespank (Initiate)
on Nov 07, 2011 at 20:47 UTC ( [id://936576]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://936576]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-20 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found