Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
the template file:#!/usr/bin/perl use strict; use Template; my $template = new Template; my $file = 'tt/template.html'; my $data = { env => \%ENV, }; print "Content-type: text/html\n\n"; $template->process($file, $data) || die $template->error;
the output:<html> <head> </head> <body> <ul> [% foreach thing in env.keys.sort %] <li><b>{% thing %}:</b>[% env.thing %]</li> [% end %] </ul> </body> </html>
I even tried a# perl template.pl Content-type: text/html file error - parse error - tt/template.html line 12: unexpected token +(thing) [% foreach thing in env.keys.sort %]
at the top of my template and that didn't seem to do any good either.[% get env %]
Thanks.
AM
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Beginer TT question
by davidrw (Prior) on Jul 05, 2005 at 21:26 UTC | |
by Anonymous Monk on Jul 05, 2005 at 21:40 UTC | |
|
Re: Beginer TT question
by jeffa (Bishop) on Jul 05, 2005 at 21:23 UTC | |
by matthewb (Curate) on Jul 06, 2005 at 08:43 UTC | |
by Anonymous Monk on Jul 05, 2005 at 21:27 UTC |