|
Posted by Tony Mc on February 26, 2008, 9:50 am
Please log in for more thread options
On Mon, 25 Feb 2008 12:11:11 -0800 (PST), gmail@indigorobot.com wrote:
> Hello all.. I'm having trouble getting HTML::Template to output. Here
> is a simple script and config snippet:
>
>
----------------------------------------------------------------------------------------------------------------------
> Script (index.pl):
>
> #!/usr/bin/perl -w
>
> #Load some helpful functions
> use strict; #strict tolerance for code
> use warnings; #extra warnings in the log
> use Carp; #verbose logging
> use diagnostics; #more verbose logging
>
> #Loadup some functions for later use
> use HTML::Template;
>
> my $template = HTML::Template->new( filename => "/var/www/html/
> index.tmpl");
> warn "outputting template...\n\n";
> print "Content-Type: text/html\n\n";
> print "Print test from script...\n\n";
> $template->output();
>
----------------------------------------------------------------------------------------------------------------------
> Config:
>
> <Location />
> AllowOverride None
> Options MultiViews ExecCGI
> DirectoryIndex index.pl
> SetHandler perl-script
> PerlHandler ModPerl::Registry
> PerlSendHeader On
> Allow from all
> Deny from none
> </Location>
>
----------------------------------------------------------------------------------------------------------------------
> index.tmpl:
>
> <br /><br />
> Template Output
> <br /><br />
>
>
----------------------------------------------------------------------------------------------------------------------
> All that ends up being printed to the web browser is:
>
> "Print test from script..."
Hi,
I think you need:
print $template->output();
rather than the $template->output(); in your programme.
Best,
Tony
|