sub getTemplate { # first argument is the templatefile other arguments are still keys my ( $template_file, @keys ) = @_; my ( $temp_file, @t ); local ($/); open( TMP, $template_file ) || warn "Can“t open template $template_file ( $! )"; $temp_file = ; close TMP; if ( @keys ) { for( @keys ){ my ($tpl) = $temp_file =~ /(.*?)/s; $tpl = 'TEMPLATE ERROR' if !$tpl; push ( @t, $tpl ); } return @t; } return $temp_file; }