Hello I am a newbie to perl-cgi. I am trying to run the hello world cgi script but Apache keeps giving me "500 Internal Server Error". So I checked my apache error log to see what the issue was, and I get this "(2)No such file or directory: exec of '/var/www/cgi-bin/index.cg
i' failed" error, and below that another log mentions "Premature end of script headers: index.cgi". I tried to see if the shibang line was wrong and went back to test the perl script, and it worked fine. I also double checked the perl path by doing "which perl" and my shibang line was right. I am adding the code snippet that I am using, could anyone tell me what could the problem be, and a possible solution.
I am using a ubuntu as my OS. I have assigned webserver as the owner of the cgi-bin folder and also have set executable file permissions, by using chmod 755.
print "Content-type: text/html\n\n";
print "hello world";