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

i have the following code and i can't figure out what is wrong with it. ############### The Template (head.tmpl)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:/ +/www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Welcome <TMPL_VAR NAME=user_name> to your place</title> <link rel="stylesheet" type="text/css" href="myplace.css" /> </head> <body> <table class="main"> <tr> <td class="left"> <div class="main" align="justify">Welcome back <TMPL_VAR NAME=user_na +me>! We have let you in <TMPL_VAR NAME=usercount> times! <hr class="main"> Your access is restricted to <TMPL_VAR NAME=acclevel> level.</ +div> </td> <td class="center"> </td> <td class="right"> </td> </tr> </table> </body> </html>
##############The perl Code
#!/usr/bin/perl -w use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use HTML::Template; my $cgi = new CGI; my $template = HTML::Template->new(filename => 'head.tmpl'); print $cgi->header; $template ->param(user_name => 'antonis'); $template ->param(acclevel => 'the bastard'); $template ->param(usercount => '10'); $template->output();

Replies are listed 'Best First'.
Re: HTML::Template - can't display the tmpl
by Wonko the sane (Curate) on Feb 22, 2003 at 18:07 UTC
    print $template->output();

    Wonko :-)

      thanks