K
Kevin
I'm getting a Server error - malformed header from script. Bad
header=<html>: template.pl when running a very simple example of
the template toolkit. When I run the script, and redirect output to a
file (.html) it opens nicely in a browser.
Strange it shows < and >
Output from the script is:
<html>
<head><title>Template Toolkit @TPC4</title></head>
<body bgcolor="#ffffff">
<h1>Hello World!</h1>
<p>The Cat Sat on the Mat</p>
</body>
</html>
Here's what I've got:
template.pl
-----------
#!/usr/bin/perl -w
use strict;
use Template;
my $template = Template->new({
INCLUDE_PATH => './templates',
});
my $file = 'welcome.html';
my $vars = {
message => 'The Cat Sat on the Mat',
};
$template->process($file, $vars)
|| die $template->error(), "\n";
templates/header
----------------
<html>
<head><title>[% title %]</title></head>
<body bgcolor="#ffffff">
templates/footer
----------------
</body>
</html>
Any help would be appreciated.
Kevin
header=<html>: template.pl when running a very simple example of
the template toolkit. When I run the script, and redirect output to a
file (.html) it opens nicely in a browser.
Strange it shows < and >
Output from the script is:
<html>
<head><title>Template Toolkit @TPC4</title></head>
<body bgcolor="#ffffff">
<h1>Hello World!</h1>
<p>The Cat Sat on the Mat</p>
</body>
</html>
Here's what I've got:
template.pl
-----------
#!/usr/bin/perl -w
use strict;
use Template;
my $template = Template->new({
INCLUDE_PATH => './templates',
});
my $file = 'welcome.html';
my $vars = {
message => 'The Cat Sat on the Mat',
};
$template->process($file, $vars)
|| die $template->error(), "\n";
templates/header
----------------
<html>
<head><title>[% title %]</title></head>
<body bgcolor="#ffffff">
templates/footer
----------------
</body>
</html>
Any help would be appreciated.
Kevin