--- fliptop <[EMAIL PROTECTED]> wrote:
> > print "Content-type: text/html\n\n";
> >
> > My question is this: Since you already have the CGI module included and
> > used, why not call the CGI module's header() function? I thought that it did
> > the same thing, and might be a little clearer in intent.
>
> i could, since both statements do the same thing. now that i think
> about it, i really don't know why i still do it manually. force of
> habit, i guess. that's the beauty of perl, 'tmtowtdi'!
That's *almost* correct. CGI.pm also states the "charset" that the document is to be
rendered
with:
C:\>perl -MCGI -e "$q=CGI->new;print $q->header"
Content-Type: text/html; charset=ISO-8859-1
This tells the browser what type of character encoding to use. For example, if you
want japanese
characters, you could use ISO-2022-JP. If the charset is not specified, the browser
(if I recall
correctly), will use the default charset that the user has chosen.
In practice, this rarely makes a difference, but when working with international
documents, it's
important.
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/