Hi all!
I'm new on this forum and I still don't know it very well. It seems cool anyway. I hope you guys can help with a little difficulty. I'm trying to develop a little application for the web.
I began using CGI and everything was good, but then I felt on some articles talking about cgi:: application and html::templates. I wanted to test this modules, but I can't make them work.
As for now, I've installed HTML::template, but when I run a script, I get the following errors:
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] Premature end of
+ script headers: helloworld.tmpl.pl
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] Bad name after p
+rivlibexp' at C:/wamp/perl/lib/Config.pm line 1219.\r
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] Compilation fail
+ed in require at C:/wamp/perl/lib/DynaLoader.pm line 25.\r
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] BEGIN failed--co
+mpilation aborted at C:/wamp/perl/lib/DynaLoader.pm line 25.\r
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] Compilation fail
+ed in require at C:/wamp/perl/lib/Digest/MD5.pm line 12.\r
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] Compilation fail
+ed in require at C:/wamp/perl/lib/HTML/Template.pm line 1035.\r
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] BEGIN failed--co
+mpilation aborted at C:/wamp/perl/lib/HTML/Template.pm line 1035.\r
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] Compilation fail
+ed in require at C:/wamp/www/helloworld.tmpl.pl line 6.\r
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] BEGIN failed--co
+mpilation aborted at C:/wamp/www/helloworld.tmpl.pl line 6.\r
[Wed Oct 10 11:26:33 2012] [error] [client 127.0.0.1] File does not ex
+ist: C:/wamp/www/favicon.ico, referer: http://localhost/helloworld.tm
+pl.pl
The code is simple and I found it on the net, just to test if the module worked, but it doesn't. I'm not an expert, but I think that mine is a module's configuration problem.
#!c:/wamp/perl/bin/perl.exe
##
## HTML template Hello World
##
use strict;
use HTML::Template;
my $that_famous_string = 'Hello, world!';
# open the html template
my $template = HTML::Template->new(filename => 'helloworld.tmpl.html')
+;
# fill in some parameters
$template->param(THAT_FAMOUS_STRING => $that_famous_string);
# send the obligatory Content-Type
print "Content-type: text/html\n\n";
# print the template
print $template->output;