godaddy & perl

G

grouchy.oldgit

I've just started learning perl and am trying to run the script below
entitled p1.pl on godaddy in folder /cgi

#!/usr/bin/perl
print "hello world";

It keeps returning 500 Internal Sever Error

Is there some problem in my program? Or am I not using godaddy's perl
implementation correctly?
 
G

Gunnar Hjalmarsson

I've just started learning perl and am trying to run the script below
entitled p1.pl on godaddy in folder /cgi

#!/usr/bin/perl
print "hello world";

It keeps returning 500 Internal Sever Error

Is there some problem in my program? Or am I not using godaddy's perl
implementation correctly?

Have you consulted the Go Daddy documentation about whether they offer
CGI support and, if they do, what their requirement are to make it work?

Or did you ask the Go Daddy support?

Think that's the proper way to start.
 
T

Tad J McClellan

I've just started learning perl and am trying to run the script below
entitled p1.pl on godaddy in folder /cgi

#!/usr/bin/perl
print "hello world";

It keeps returning 500 Internal Sever Error

Is there some problem in my program?


No, it looks fine. (assuming that is the correct location for perl)

Or am I not using godaddy's perl
implementation correctly?


You need to find out *what* internal error it is.

You will probably find that in the web server's error log.

Ask your hosting provider how you can access the server error log.


Also, try it without Perl, perhaps by using a shell instead:

#!/bin/bash
echo "hello world"

If that also fails, then it is clear that your problem is not
related to Perl, as it fails in the same way even when not
using any Perl.
 
M

Michael Vilain

I've just started learning perl and am trying to run the script below
entitled p1.pl on godaddy in folder /cgi

#!/usr/bin/perl
print "hello world";

It keeps returning 500 Internal Sever Error

Is there some problem in my program? Or am I not using godaddy's perl
implementation correctly?

CGI isn't the same as shell programming. The above will only output
"hello world" when executed from the web page. CGI requires the output
type be defined before it's processed by the remote browser (these are
called headers). You sent an invalid header.

Try this instead:

#!/usr/bin/perl
print "content-type: text/plain;\n\n";
print "hello world\n";
exit;
 
J

Jürgen Exner

See 'perldoc -q 500':
My CGI script runs from the command line but not the browser.
(500 Server Error)

Aside of not using
use warnings;
use strict;
which is strongly recommended, no, the script as such looks ok. Did you
run it from the command line? What was the result? I bet it printed
"hello world" which is a strong indication that your problem is not
Perl-related.

However it appears you are running the Perl script in a CGI environment
and your script is not producing the required CGI headers. I don't know
what godaddy is and if this observation is relevant for godaddy or if
godaddy provides those headers or whatever.
Have you consulted the Go Daddy documentation about whether they offer
CGI support and, if they do, what their requirement are to make it work?

A very sound advice.

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top