in reply to Unwanted line (CGI question)

By default, CGI::Application uses CGI which will output the header 'content-type' by default:

#!/usr/bin/perl use CGI qw/:standard/; print header, start_html('A Simple Example'), end_html;
produces:
Content-Type: text/html; charset=ISO-8859-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>A Simple Example</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> </body> </html>
Normally, for web pages serving html, you want/need that line. Why do you think it's weird? What problems is it causing you?

-derby

Replies are listed 'Best First'.
Re^2: Unwanted line (CGI question)
by xiaoyafeng (Deacon) on Oct 21, 2008 at 11:18 UTC
    Normally, for web pages serving html, you want/need that line. Why do you think it's weird? What problems is it causing you?

    Content-Type: text/html; charset=ISO-8859-1 is http header. IMHO, that means it's invisible to client. That's why I think it's weird.


    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

      Right ... depending on the client. Are you seeing that line in the browser?

      -derby
        Sure, both IE 6.0 and Firefox 3.0

        I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction