Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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;

In reply to problem installing HTML::Template by teddyttas

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (4)
    As of 2015-07-05 16:19 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (67 votes), past polls