Comments

[b][red]This message was edited by Xfactor at 2004-2-6 22:57:8[/red][/b][hr]: I am trying to write a hello world Perl/CGI program.: : When I go to the file on the web it says "Internal Server error": : I have already changed the permissions on helloworld.pl and I am pretty sure that I have the right #! line at the beginning. Any ideas what could be wrong?

We have to see your code but make sure you have the print statement:

print "Content-type: text/html

";

This needs to be placed before your other perl code. If this isn't the problem, you'll need to post your code.

: [b][red]This message was edited by Xfactor at 2004-2-6 22:57:8[/red][/b][hr]: : I am trying to write a hello world Perl/CGI program.: : : : When I go to the file on the web it says "Internal Server error": : : : I have already changed the permissions on helloworld.pl and I am pretty sure that I have the right #! line at the beginning. Any ideas what could be wrong?: : We have to see your code but make sure you have the print statement:: : print "Content-type: text/html

";: : This needs to be placed before your other perl code. If this isn't the problem, you'll need to post your code.: Or more specifically, it has to be before any other print statement.

Also, if you FTP'd the file up, make sure you did so in ASCII mode, otherwise you'll run into issues with different line endings, which also results in an Internal Server Error.

Do you have access to the server's error log? If so, it can often provide valuable insight into the problem - just grep it for the name of your script (if you have that kinda access to it).

My first guess would be that the script isn't communicating with Perl. Telnet in, and try a whereis to be sure. The content-type thing should just mean that it displays as HTML, not plaintext - leave it out and you get the equivalent of a .txt file, which wouldn't be a problem with a simple hello world.

: The content-type thing should just mean that it displays as HTML, : not plaintext - leave it out and you get the equivalent of a .txt : file, which wouldn't be a problem with a simple hello world.: Sometimes yes, sometimes no. I've come accross a whole range of things that can happen if you don't add a valid header, including:-

- Server supplies a text/html one so it displays as HTML- Server supplies a text/plain one so it displays as text- Server says "no headers, no play" and gives a 500 error

I'm pretty sure I've seen all three of these happen accross various servers I've had the pleasure (or displeasure) of working with.