in reply to Performance Question

I think there's some heavy weather being made of this. So here's my go. :-)

There's not a regex or any html to be seen. Neither is there any 'hard coded' field names. All the data is taken straight from the CGI.pm param method.

This is, imho, the most effiecient way to go. :-)

#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; use CGI; use HTML::Template; # create query object with some params # (straight from the docs) :-) my $q = new CGI( { 'dinosaur' => 'barney', 'song' => 'I love you', 'friend' => 'george', } ); # create data structure for HTML::Template my @param_loop = map { {name => $_, value =>$q->param($_), } } $q->param; # get the template from DATA (this would normally be in a file) my @tmpl = <DATA>; # blast off! my $t = HTML::Template->new(arrayref => \@tmpl); $t->param(param_loop => \@param_loop); print $t->output; __DATA__ <html><head><title>template</title></head> <body> <TMPL_LOOP NAME=param_loop> <p><TMPL_VAR NAME=name> -> <TMPL_VAR NAME=value></p> </TMPL_LOOP> </body> </html>
output:
<html><head><title>template</title></head> <body> <p>friend -> george</p> <p>song -> I love you</p> <p>dinosaur -> barney</p> </body>
update:

From the docs:

If a value is not given in the query string, as in the queries "name1=&name2=" or "name1&name2", it will be returned as an empty string.
So you won't get any pesky undefs either.