in reply to Premature end of script headers

How can i debug this error?

:) <joke> You're not qualified, you have an error message and 200 years worth of FAQ </joke>

Work through these, check the logs, ... CGI Help Guide , Troubleshooting Perl CGI scripts, Basic debugging checklist , brian's Guide to Solving Any Perl Problem