use warnings; use strict; use Template; # create Template object my $ttt = Template->new(); # define template variables for replacement my $replacements = { name => "holli" }; my $template = join ("", ); # process input template, substituting variables and save it to disk $ttt->process( \$template, $replacements, "output.xml") || die $template->error(); #call fop and translate xml file to pdf system "d:\\fop-1.0\\fop.bat -fo output.xml -pdf output.pdf" __DATA__ Hello, [% name %]!