use Template;
use CGI qw(:standard);
$| = 1;
print "Content-type: text/html\n\n";
$cgi = CGI->new();
%cgiArgs = $cgi->Vars;
my $file = 'templates/test.tmpl';
my $vars = {
message => "Hello World",
me => {
'name' => 'Dan',
'email' => '[EMAIL PROTECTED]',
},
cgi => %cgiArgs,
};
my $template = Template->new({
INCLUDE_PATH => '/inetpub/wwwroot/workcomp',
});
$template->process($file, $vars) || die $template->error();
And the template file I'm referencing contains:
<HTML>
<HEAD>
<TITLE>Template test</TITLE>
</HEAD>
<BODY>
[% me.name %] .. [% me.email %]
<BR>
[% message %]
<P>
<UL>
[% FOREACH item = cgi.keys %]
<li>[% item %] => [% cgi.$item %]
[% END %]
</UL>
</BODY>
</HTML>
I'm calling the script as http://<server IP>/<directory>/test.pl?a=1&b=2&c=3 and based upon what I read in Template::Manual::Variables and Template::Manual::VMethods, I expected to see my 3 CGI parameters displayed. I see the "me" and "message" elements ok, but no CGI params. What's my error?
--------------------------
Dan Mahoney
[EMAIL PROTECTED]
AA6GF
"How you behave towards cats here below determines your status in Heaven."
Robert Heinlein
"There are two means of refuge from the miseries of
life - music and cats" - Albert Schweitzer
_______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates
