use Text::ScriptTemplate;
my $template = Text::ScriptTemplate->new;
# Oder Template mit ->load aus einer Datei holen:
$template->pack(<<'EOF');
<%= $x %> | <%= $y %> |
EOF
my $html = "";
for my $x (0 .. 10) {
my $y = $x * 2;
$template->setq(x => $x,
y => $y);
$html .= $template->fill;
}
print $html;