Gossamer Forum
Home : General : Perl Programming :

Weird header problems

Quote Reply
Weird header problems
I'm having yet more irritating problems - this time with headers.

I have internal error subs in my script called when a file can't be opened or a template can't be parsed etc.....

I use print $in->header(); before each occurance of print $tpl->parse ( ... )

However I keep getting an extra header printed.

I have:
eval { &main; };

if ($@) {
print "Content-type: text/html\n\n";
print $@;

.....at the top of the script and if I comment out the header, the extra header on my error pages disappears, however if $@ exists then the header won't be printed and an internal server error occurs.

Now, if I add fatalsToBrowser to the script, the content of my custom error pages is printed as plain text inside the fatalsToBrowser error page.

Does anyone know how I can get around this?


Last edited by:

RedRum: Sep 30, 2001, 12:28 PM
Quote Reply
Re: [RedRum] Weird header problems In reply to

I was returning a parsed template and they dying, but I needed to print and exit.