Web Hosting Talk







View Full Version : Perl question rather urgent.


michael-lane
11-02-2005, 02:01 PM
Okay this is really fustrating. I've got 3 hosts currently. And when running this simple perl code on both i get INTERNAL SERVER ERROR 500 and none of my perl mates can see whats wrong. This is my code:

#!/usr/bin/perl
print "hello and welcome to my site! this is my first taste of perl";

That is the exact syntax no code has been modified not one bit. Anyway i saved two versions a .pl of it and a .cgi of it and placed them in my CGI-BIN and i get INTERNAL SERVER ERROR 500. Am I doing something wrong i checked cpanel its definatly usr/bin/perl but all i get is the error. My perl mate tested it out and it worked fine for him. What am i doing wrong. I dont know but someone (non perl) suggested that i change usr to my cpanel username but i doubt somehow they are right. Can some perl people help me here. Urgent?

foobic
11-02-2005, 06:48 PM
Perl doesn't provide headers automatically like php. Try this:

#!/usr/bin/perl

print "Content-type: text/html\n\n" .
"hello and welcome to my site! this is my first taste of perl";Also make sure you upload in ASCII mode and change permissions to 755.