jacques has asked for the wisdom of the Perl Monks concerning the following question:
So what to do? Here's one solution I came up with:
But I am not sure if this is 100% foolproof. Is it?print "Content-type: text/html\n\n" if defined $ENV{'SERVER_SOFTWARE'} +;
Also, I am worried about something else: What if someone printed the header before using my function and then the header gets printed again when they use my function. The Content-type line would be printed within the HTML. How could I prevent this? Is there a way of checking if the header has already been sent?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing content-type in the proper context
by johnnywang (Priest) on Dec 24, 2004 at 04:15 UTC | |
by jacques (Priest) on Dec 24, 2004 at 04:33 UTC | |
by itub (Priest) on Dec 24, 2004 at 14:42 UTC | |
|