Thanks to both Darren and Mark.  Indeed, DATA is not available in mod_perl, and
you've got to tell the server what the document type is.  Although I'd be
surprised if there wasn't some way to default the document type for a directory
(although DefaultType didn't work).

Thanks guys,
Rob

#!/usr/bin/perl

use strict;
use warnings;

use Template;

my $data =<<__END_TEMPLATE__;
[% INCLUDE header %]
count: [% GET count%]
date: [% GET date%]
[% INCLUDE footer %]
__END_TEMPLATE__

my $config = {
   INCLUDE_PATH => '/usr/local/tt2/templates/html',
   };

my $vars = {
   'count' => 3,
   'date' => scalar localtime,
   };

print "Content-type: text/html\n\n";

my $tt = Template->new( $config )
   || die Template->error(), "\n";

$tt->process( \$data, $vars )
   || die $tt->error(), "\n";


-- 
 19:40:30 up 1 day,  9:34,  4 users,  load average: 1.13, 0.91, 0.50

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to