While I agree with the fact that it's hard to screw up the headers when you
use the function interfaces of CGI.pm, I guess I'm just a little anal about
clarity, and true clarity means that you shouldn;t have to know a lot about
the behind-the-scenes interfaces in order to know precisely what the program
is doing. That is, if you're new to Perl, you should be able to see what
the program is doing at-a-glance. So, when I'm doing perl for the office
environment, or a consulting cusotmer, I either explicitly print every line,
or I use a heredoc syntax. That way, it's easier for other newbies to
maintain.
Now, some of the stuff I write just for my own use is, well, another matter
;0
> -----Original Message-----
> From: Curtis Poe [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 07, 2001 12:37 PM
> To: CGI Beginners
> Subject: Re: Erratic server errors apparently caused by
> missing header.
>
>
> --- Peter Cline <[EMAIL PROTECTED]> wrote:
>
> > print "Content-type : text/html \n\n";
>
> I'm not sure if the above line is the issue or not. How the
> browser or Web server deals with that
> could be the issue (though it sounds like your problem is on
> the server side). A proper content
> type header is:
>
> Content-Type: text/html
>
> ...or...
>
> Content-Type: text/html; charset=ISO-8859-1
>
> Note that there is no space before the colon and the 't' in
> 'Type' is capitalized (though the
> capitalization shouldn't matter here).
>
> This is an excellent reason to use CGI.pm: it's tough to
> mess up the headers:
>
> #!/usr/bin/perl -wT
> use strict;
> use CGI qw/:standard/;
>
> print header;
>
> Cheers,
> Curtis Poe
>
> =====
> Senior Programmer
> Onsite! Technology (http://www.onsitetech.com/)
> "Ovid" on http://www.perlmonks.org/
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year! http://personal.mail.yahoo.com/
>