[Templates] sending header as text/html

Dave Cross dave@dave.org.uk
Mon, 21 May 2007 14:22:21 +0100


Ken Perl wrote:

> how can I include the code,
> 
>   print "Content-type: text/html\n\n";

You know that only creates a _really_ correct CGI header on a Windows 
web server :)

> into the wrapper default-template ? I use the wrapper like this,
> 
> [% WRAPPER default-template %]

Use the CGI plugin[1]. That'll get your line endings right too.

     [% USE CGI;
        CGI.header %]

Dave...

[1] 
http://www.template-toolkit.org/docs/plain/Modules/Template/Plugin/CGI.html