cyril has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm going to try and make a switch from PHP to Perl for my next web project. I've just been going through the basics and was wondering why there is the need to output an HTTP header line as the first line of output from a perl script. I run apache and it seems that a certain level of intelligence takes place before passing the data back to the client because Apache seems to cut out any duplicate HTTP headers, that is to say it appears that the ouput from Perl is not just added to the headers and sent without first being checked. For example, if the first line of my Perl output is to simply output "\r\n", that works fine and a content-type header is added automatically by Apache as I would expect. If I output a Content-Type header in Perl, Apache doesn't then try and add this header twice. Therefore, I would have though that it would be simple enough for Apache to add the extra line break needed before sending back the data. I am hoping someone can help me understand how it is all formed as It always helps me to know why things behave how they do. Hope that made some sense.
regards
cyril
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: cgi theory
by hardburn (Abbot) on Sep 15, 2003 at 20:42 UTC | |
by cyril (Acolyte) on Sep 15, 2003 at 20:57 UTC | |
by jdtoronto (Prior) on Sep 16, 2003 at 01:34 UTC | |
|
Re: cgi theory
by bear0053 (Hermit) on Sep 15, 2003 at 20:46 UTC | |
|
Re: cgi theory
by Taulmarill (Deacon) on Sep 15, 2003 at 20:51 UTC | |
by jeffa (Bishop) on Sep 16, 2003 at 15:04 UTC | |
|
Re: cgi theory
by tcf22 (Priest) on Sep 15, 2003 at 20:47 UTC |