Hi list,
I am testing HTML::Template with a sample script, I can run the script from command line which is working fine but when I run it from browser (http://webserver/cgi-bin/test1-cgi) I am getting the following error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/1.3.26 Server at aegdbs001.aegislink.com Port 80 I checked in the web server logs, I see the following errors in the error log
[Tue Aug 3 10:47:11 2004] [error] [client 10.15.18.120] malformed header from s
cript. Bad header=<HTML>: /var/apache/cgi-bin/test1-cgi
[Tue Aug 3 11:34:52 2004] [error] [client 10.15.18.120] malformed header from s
cript. Bad header=<HTML>: /var/apache/cgi-bin/test1-cgi
cript. Bad header=<HTML>: /var/apache/cgi-bin/test1-cgi
[Tue Aug 3 11:34:52 2004] [error] [client 10.15.18.120] malformed header from s
cript. Bad header=<HTML>: /var/apache/cgi-bin/test1-cgi
Script test1-cgi
#!/usr/bin/perl
use HTML::Template;
use HTML::Template;
# open the html template
my $template = HTML::Template->new(filename => '/home/raj/www/test/test.tmpl');
my $template = HTML::Template->new(filename => '/home/raj/www/test/test.tmpl');
# fill in some parameters
$template->param(
HOME => $ENV{HOME},
PATH => $ENV{PATH},
);
$template->param(
HOME => $ENV{HOME},
PATH => $ENV{PATH},
);
# print the template
print $template->output;
print $template->output;
Template:
bash-2.03$ cat test.tmpl
<HTML>
<HEAD><TITLE>Test Template</TITLE>
<BODY>
My Home Directory is <TMPL_VAR NAME=HOME>
<P>
My Path is set to <TMPL_VAR NAME=PATH>
</BODY>
</HTML>
<HTML>
<HEAD><TITLE>Test Template</TITLE>
<BODY>
My Home Directory is <TMPL_VAR NAME=HOME>
<P>
My Path is set to <TMPL_VAR NAME=PATH>
</BODY>
</HTML>
Anyone know what could be the problem?.
Thanks in advance