Why sometime when request http and response header not return text/html in perl script?

  • Page is at random blank on load (whitened screen)
  • Response headers HTTP/.9 200 OK (whitened screen), however when page loads properly – HTTP/1.1 200 OK
  • No error log apache.
  • When page load blank, I View page Source all tag html exist.

Try adding:

use CGI::Carp qw[fatalsToBrowser];

for your program to ascertain if you receive any error messages.

Make sure to comment it again before putting this program into production.

We can not tell without seeing the origin code. My first guess is the fact that rather than printing

Content-Type: text/html

   ... rest of your page

you do not have the blank line following the Content-Type header.

Again, it's difficult to inform without seeing your code, or seeing the precise response in the server.