At 11:53 PM 07/19/2001 -0400, Tom Malone wrote:
>I know this is a simple, stupid question, but i can't seem to find the
>answer. I've never used Perl before - only PHP. NOt very familiar with unix
>either...
>I'm trying to get this hello world script to work - I have the shebang -
>#!/usr/bin/perl at the beginning of the file, and verified with my host that
>it is the correct path. The host said to put the file in my cgi-bin, which i
>also did, and i chmoded it to 755, which was also a direction from my host.
>I tried naming it hworld.pl and hworld.cgi, but i still get this stupid 500
>internal server error and can't figure out why.
>
>The script is very simple:
>
>#!/usr/bin/perl
>print "Hello World!\n";


You need to send valid HTTP headers before the output of your script. The
best way to do this is by using the CGI.pm module and calling the 'header'
method. You can manually set the header yourself by doing a print
"Content-type:foo/bar", but you're better off using CGI.pm, as it will
eliminate any potential mistakes you might make in setting the headers
yourself

e.g.,

#!/usr/bin/perl -w

use CGI;
use strict;

my $q = new CGI;
print $q->header;
print "Hello World!\n";


Also remember to ALWAYS use strict and -w, no matter how trivial the script.

HTH..aloha,
mel
--
mel matsuoka                      Hawaiian Image Productions
Chief Executive Alphageek                (vox)1.808.531.5474
[EMAIL PROTECTED]                    (fax)1.808.526.4040
                     

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to