sfantar wrote:
Hi there,
I am starting using HTML::Template modules and I wrote a script with
the first example within the doc.
I am not able to see the results of my CGI from my browser. It
displayed error 500 Internal Server Error.
I gave the correct rights to my script to make it executable.
In the @INC, there is no problem. When I run perl -e 'use
HTML::Template', there is no error in the output.
When I launch my script from the command line, it's ok. I can see the
results.
I don't know where the problem is.
Thanks for your help.
Hello ,
Try with this example(change the file permission) and if you still get
the error message.Paste the error from "/var/log/httpd/error_log" .
$ cat templ.tmpl
<html>
<head><title>Test Template</title>
<body>
My Name is <TMPL_VAR NAME=name>
<p>
This is a simple Example <TMPL_VAR NAME=example>
</body>
</html>
$ cat templ.cgi
#!/usr/bin/perl -w
use HTML::Template;
# open the html template
my $template = HTML::Template->new(filename => 'templ.tmpl');
# fill in some parameters
$template->param(name => "Prabu");
$template->param(example => "For Template");
# send the obligatory Content-Type and print the template output
print "Content-Type: text/html\n\n", $template->output;
$ perl templ.cgi
Content-Type: text/html
<html>
<head><title>Test Template</title>
<body>
My Name is Prabu
<p>
This is a simple Example For Template
</body>
</html>
-- Prabu.M.A
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>