Tosh Cooey wrote:
Hi, I have the following program running under mod_perl:

program.pl
**********
do stuff...
my $sitewide = new SITEWIDE;
more stuff...
$template->process($page, $vars);
END

SITEWIDE.pm
***********
stuff...
my $cgi = new CGI;
my $cookie = $cgi->cookie(-name=>'UID');
&set_cookie  if (!$cookie);
stuff...


In "program.pl" there is no "Content-type:" header sent in the CGI but it's rather in the template, that way each template has control over it's own header.


If a user hits "program.pl" and they *don't* have a cookie then one is set, BUT then the output of program.pl isn't sent as rendered HTML but as text, ie. the user sees this:

This may be wrong but what way are you sending the header. if its a plain piece of text in the template then mod_perl will ignore it and guess the mime type which in your case is text. If you use the CGI module from withing the template to call its header method them the CGI module should detect mod_perl and handle it properly.


"Parctical mod_perl: Oreilly" has some stuff on this. Have a look at Chapter 6

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to