in reply to Performance Question

If you have a large number of variables that you want to access in the same way, then it makes sense to store them in some kind of aggregate variable. In this case I'd go for a hash.

use CGI ':cgi'; # list of parameter names my @params = qw(city zip lastname country other obs); # extract all parameters into a hash my %param; foreach (@params) { $param{$_} = param($_); } # time passes... while (<MYTEMPLATE>) { foreach my $p (@params) { s/<\?--$p-->/$param{$p}/g if defined $param{$p}; # you'll probably want to print it too } }