PERL: blank page or 500 error

Published by

Posted on August 09, 2009

Possible error in the logs or blank page
malformed header from script Bad Header

You will need to add
print “Content-type : text/html\r\n\r\n”;

to your script unless your using the cgi module

use cgi;

Here is a sample script

#!/usr/bin/perl -w
##print "Content-type : text/html\r\n\r\n";
#use CGI;

#print "mas\n";

use CGI; # load CGI routines
$q = new CGI; # create new CGI object
print $q->header, # create the HTTP header
$q->start_html('hello world'), # start the HTML
$q->h1('hello world'), # level 1 header
$q->end_html; # end the HTML

CGI Module