in reply to Concatenating a list...
This is the skeleton of something you might want to do with your template. Please take Anonymous Monk's advice and use HTML::Template's built-in functions instead of concatenation.
#!/usr/bin/perl -T use strict; use warnings; use Carp; use HTML::Template; open my $file, "<", 'file.txt'; while (<$file>) { chomp; my($fn,$ln) = split /\t+/, $_ or carp "Row unreadable.\n"; push @loop_data, { firstname => $fn, lastname => $ln }; } my $template = HTML::Template->new(filename => 'template.tmpl'); print "Content-type: text/html\n\n"; $template->param(printlist => \@loop_data); print $template->output; <!-- Relevant part of a template: --> <table> <TMPL_LOOP NAME="printlist"> <tr> <td><TMPL_VAR ESCAPE=HTML NAME="firstname"></td> <td><TMPL_VAR ESCAPE=HTML NAME="lastname"></td> </tr> </TMPL_LOOP> </table>
--
Allolex
|
|---|