# ouch open(my $fh, '>', 'data.tmp') or die("open failed: $!"); $template->output(print_to => $fh); close($fh); open(my $fh, '<', 'data.tmp') or die("open failed: $!"); chomp( my @template_txt = <$fh> ); close($fh);