Perl CGI and HTTP headers
Posted by: mgendron
Posted on: 2004-11-24 20:36:00
My Perl CGI script is returning 'text/plain' as the MIME type in the HTTP header returned by the Dreamhost server. This causes the Firefox browser to display my HTML code as text instead of interpreting (IE figures out that it's HTML anyway, and displays it correctly.) I have tried setting the MIME type by using the CGI.PM module, coding as follows:
use CGI;
my $query = new CGI;
print $query->header(-type=>'text/html');
Unfortunately, any attempt on my part to modify the HTTP header in this way is ineffective. The server continues to return its HTTP header with the 'text/plain' MIME type. My specified header attribute(s) are printed after, and end up displaying with my HTML output.
I will appreciate any assistance that you can offer.
Thanks
-Mark