End of script output before headers - Perl

1

Why so:

print "Content-type: text/html\n\n";
print "<H1>Hello World</H1>\n";

It works!

And so:

my $tpl = HTML::Template->new(filename => 'index.html');
print "Content-Type: text/html\n\n" , $tpl->output

I have the error:

  

The server encountered an internal error and was unable to complete   your request.

     

Error message: End of script output before headers

  • I already checked permission
  • I've already inserted plain html

I'm having a problem, when I try to import an HTML and I really need to do this. Would anyone give me a light?

    
asked by anonymous 24.12.2015 / 03:10

0 answers