This is so much like the recent discussion at
Larry vs. Joel vs. Ovid -- in this case, the HTTPD protocol has a well defined format in that the first line sent over the connection is a content type line, and some followup lines that may or may not include details like cookies, content length, etc. But this is all a standard, with only a few small changed (additional fields that could be accepted) since it's release. Yet, Microsoft in their incredible wisdom, is trying too accept too much and refuse little. Your example is one problem; another that I know others have had is that they want to send a HTML document as a text file as an example of code to use; that is, the end file should include all tags and the like. It's possible to force the Content-Text to plain/text on nearly any other browser, but there is absolutely no way to do this in IE; the file will always be rendered as HTML.
Now, I'm wondering if there's a reasonable solution that we can at least do with perl and CGI.pm; that is, when you create a new CGI object, there should be a flag that is set when header() is called. If the object is destroyed while this flag is unset, then a warning/die() should be issued that a header was not sent, and there *may* be erroneous code around (lacking a header line). Obviously, I'd opt to have this as an option that must be set to work, as opposed to a default out of the box. And it's certainly not infallable:
this code will not trigger the warning despite header() being called:
my $q = new CGI;
$q->header( 'plain/text' ); # It's not being printed!
(Actually, thinkning about it, I'd figure it would be just as easy to create a class such as CGI::HeaderHunter, which acts like a CGI object, but incorporates a "header()" override function and provides a new DESTROY call. Instead of creating a CGI object, you'd create this one. Not quite sure on the details yet, of course...)
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.