in reply to Perl On Server

Hi.

As you can see from the apache log error, "Bad header: Connect to masslottery_db...", it's clear that the apache server was expecting your Perl script to output a header. All CGI programs need to output a header such as "Content-type: text/html" followed by a blank line.

This can either be explicitly outputted like so:

print "Content-type: text/html\n\n";
Or using a module such as CGI.

Also, as seen from the log error of "Mal formed header from script. Bad header:connect to masslottery_db"., it's clear it was able to connect to the MySQL database, because you used a lowercase 'c' in "connect to masslottery_db successful" and an uppercase 'C' in "Connect to masslottery_db failed". :)