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:
if ($@) {
print "Content-type: text/html\n\n";
print $@;
}
exit;
.....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?
Thanks.
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:
Code:
eval { &main; }; if ($@) {
print "Content-type: text/html\n\n";
print $@;
}
exit;
.....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?
Thanks.