Perl error 500

Status
Not open for further replies.

dmosen

New Member
Messages
3
Reaction score
0
Points
0
Hi!
Before posting, I checked out other posts with the same problem. The Perl file returns a server error. Here is what I have checked:
*Correct path (cgi-bin).
*Simple code.
*With and w/o the ---> #!/usr/bin/perl <--- line.
*Correct chmoding (755).

Maybe I am missing something, or it is due to the newness of the account.

Ideas?? Thanks!
 

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
In development, I always try to start my web based perl scripts with:

Code:
#! /usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);

print "Content-type: text/html\n\n";

The header must be the first output, and the Carp usually gives more info on errors.

Also, if you uploaded the file, make sure you did it in text mode, not binary (especially if you wrote on Windowz).
 
Last edited:

dmosen

New Member
Messages
3
Reaction score
0
Points
0
Thanks descalzo. Yeah, problem still there. The thing is that Perl me any details on the error, given that the problem is the server environment and not the script :sad:
About the uploading, I have been using hmtl forms, but nevertheless, when editing the scripts, they seem to be alright.

PD: be careful where you step descalzo ;)
 

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
I usually run this on any new server...

test.pl

Code:
#! /usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);
 

print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD><TITLE>Hello World!</TITLE></HEAD>\n";
print "<BODY>\n";
print "<H2>Hello World!</H2> <br /> \n";
 
foreach $key (sort keys(%ENV)) {
  print "$key = $ENV{$key}<p>" ;
}
print "</BODY>\n";
print "</HTML>\n";
 

dmosen

New Member
Messages
3
Reaction score
0
Points
0
Hi again! That seemed to be working after some minutes!!! :dunno:
I will work from it and post something if I see anything that may help future perlers!

Thanks and cheers!!
Edit:
Hi again! So. Problem was Perl was not working just after I activated the account. Impatient users like me have to wait some minutes (maybe an hour). Take your time.

Cheers!
 
Last edited:
Status
Not open for further replies.
Top