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