Re: HTML::Template not outputting
- From: Tony Mc <afmcc@xxxxxxxxxxxxxx>
- Date: Tue, 26 Feb 2008 14:50:12 +0000
On Mon, 25 Feb 2008 12:11:11 -0800 (PST), gmail@xxxxxxxxxxxxxxx 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
.
- References:
- HTML::Template not outputting
- From: gmail
- HTML::Template not outputting
- Prev by Date: HTML::Template not outputting
- Next by Date: Re: HTML::Template not outputting
- Previous by thread: HTML::Template not outputting
- Next by thread: Re: HTML::Template not outputting
- Index(es):
Relevant Pages
|
|