in reply to HTML Formatting of perl code

I'm down with marto

Here's an example.. (untested!)

use HTML::Template; my $src = q{ <h1>Stock data..</h1> <ul> <TMPL_LOOP STOCKLOOP> <li><TMPL_VAR NAME> <TMPL_VAR NET></li> </TMPL_LOOP> }; my $tmpl = HTML::Template->new( scalarref => \$src ); my %stock = ( 'Nikkei 225' => ^N225 ); my @STOCKLOOP; for my $name ( keys %stock ) { my $symbol = $stock{$name}; my %dat = $q->fetch( $name, $symbol ... # or whatever you do to get +this push @STOCKLOOP, { name => $name, net => $net }; } $tmpl->param( STOCKLOOP => \@STOCKLOOP ); print "Content-Type: text/html\n\n"; print $tmpl->output;