"Internal Server Error" problem

Hey Guys & Gals,

I'm pulling my hair out here :) I'm trying to get this survey to process on my site... and I'm running into some trouble. I keep getting the "Internal Server Error" problem and my Error logs are saying Premature End of Script Headers. Can Someone help me out? I'm not sure if I'm aloud to post URL's or not, so if you're willing to help, let me know what you need from me.... I really appreciate it guys... Thanks in advance.

500 internal server error means the server cannot read/find the file specified. Premature End of Script Headers is usually a perl error.

Check your permissions, most cgi (perl) scripts have to be executable, so chmod the file 755.

Is your host using suEXEC make sure you set the proper user/group for the file.

Make sure the shebang line (first line of the script usually #!/usr/bin/perl) contains the proper path to perl on your server/host.

Make sure you are setting the content type and that you have two line feeds after it ala,
#!/usr/bin/perl
print "Content-type: text/html\n\n";

Are you sure your host/server supports the script extension you are using? .cgi .pl?

Did you upload in ascii not binary?

You've got a bit of hunting down to do, the pleasures of perl :) ( I almost forgot why I switched to php).

One thing that help in debugging perl is to output the errors to the browser by adding
use CGI::Carp qw(fatalsToBrowser);
after the shebang (#!/usr/bin/perl) line.
Be sure to remove it once you get the script working.

[edit]
Just thought of another possible problem. Line endings. If you are editing the file in a windows text editor and uploading to a unix server then you are going to hit problems as *nix servers will not recognise the windows end of line character (carriage return), use a text editor that can save the file with *nix type line endings (line feed) crimson editor is a good one for windows with syntax highlighting.
[/edit]

"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
"The secret to creativity is knowing how to hide your sources" - Albert Einstein.

Thanks alot for the reply... I really do appreciate it. I'm not all that familiar with Perl, I used a program called Visual Form Mail to generate this script for the form I had made.. They say it's easy to use, however, it doesn't seem to be all that easy. Anyways, I've checked out most of the stuff you mentioned, and still no dice! I will continue to plug away at it, again I appreciate the advice.. If you have anymore.. It's always welcome :) Take Care!

If its not permissions then perhaps the script is including other files that it cannot find. No way of knowing without you posting the html page and the script.
If your post them I can check them on my local server and see if its a script problem or something on your server.

Remove any personal data such as emails/ips/domains in the script before posting.

"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
"The secret to creativity is knowing how to hide your sources" - Albert Einstein.