| Sfantar 2006-06-20, 7:56 am |
| Prabu a écrit :
> sfantar wrote:
> 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
>
While trying your solution, I got the same error as mentioned above.
But if I give the full path to templ.tmpl in the script, then it works !
Thanks for your help.
By the way, where can I find how Perl is configured on my webserver?
|