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:

     Content-type: text/html

     <?xml version="1.0" encoding="iso-8859-1"?>
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "SNIP">
     <html xmlns="http://www.w3.org/1999/xhtml";>
     <head>
     SNIP

*****This only occurs when running under mod_perl and only when the Content-type header is set in the template and so printed during the "process" call rather than 'print "Content-type: text/html\n\n";' before the process call.*****

Did I miss the part of the docs which state "Don't do something like that idiot" or is there another issue I'm missing?

Thanks!

Tosh
--
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/


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

Reply via email to