Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

problem installing HTML::Template

by teddyttas (Novice)
on Oct 10, 2012 at 09:42 UTC ( [id://998185]=perlquestion: print w/replies, xml ) Need Help??

teddyttas has asked for the wisdom of the Perl Monks concerning the following question:

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;

Replies are listed 'Best First'.
Re: problem installing HTML::Template
by Khen1950fx (Canon) on Oct 10, 2012 at 14:36 UTC
    Give this a try:
    #!/usr/bin/perl BEGIN { $| = 1; $^W = 1; } use strict; use autodie; use warnings; use HTML::Template; my $that_famous_string = 'Hello, world!'; my $tmpl = "<TMPL_VAR NAME=THAT_FAMOUS_STRING>\n"; my $template = HTML::Template->new_scalar_ref( \$tmpl, strict => 1, debug => 1, ); $template->param(THAT_FAMOUS_STRING => $that_famous_string); print "Content-Type: text/html\n\n"; print $template->output;
Re: problem installing HTML::Template
by Anonymous Monk on Oct 10, 2012 at 10:49 UTC

    That doesn't look particularly HTML::Template related

    This means complain to your vendor

    [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

    Whoever your vendor is, the hosed Config.pm

      soory, I forgot to say that for the moment I run it locally, on wamp server.

        soory, I forgot to say that for the moment I run it locally, on wamp server.

        Yeah, but you didn't compile your WAMP, including perl, yourself, did you?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://998185]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-19 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found