in reply to weird CGI problem

You've forgotten to print the closing tag functions:

print $q->end_table, $q->end_html;
It would be good to either check for errors on DBI methods, or else set the DBI attr {RAISE_ERROR => 1} when you connect.

After Compline,
Zaxo