lhp@nereida:~/public_html/cgi-bin/tt$ cat -n ttcgi4.pl 1 #!/usr/bin/perl 2 use strict; 3 use warnings; 4 use Template; 5 use CGI; 6 7 $| = 1; 8 9 my $cgi = CGI->new(); 10 my $tt = Template->new(); 11 my $input = 'cgiparams.html'; 12 13 my $vars = { 14 cgi => $cgi, 15 }; 16 17 print $cgi->header(-charset => 'utf-8' ); 18 19 $tt->process($input, $vars) 20 || die $tt->error( );
lhp@nereida:~/public_html/cgi-bin/tt$ cat cgiparams.html <h1>CGI Parameters</h1> <ul> [% FOREACH p = cgi.param -%] <li><b>[% p %]</b> [% cgi.param(p) %]</li> [% END -%] </ul>