On 4/14/02 2:31 PM, "John Buono" <[EMAIL PROTECTED]> wrote:

> I am trying to run perl scripts through CGI.  I am running the straight OSX
> not the server.
> 
> Every time I try and run a script through the browser I am given an
> "Internal Server Error".

Try the below code, making sure you set it executable:

Last login: Sat Apr 13 16:52:14 on ttyp1
Welcome to Darwin!
[localhost:~] sneex% cd /Library/WebServer/CGI*
[localhost:/Library/WebServer/CGI-Executables] sneex% ls -l bo*
-rw-r--r--  1 sneex  admin  518 Apr 14 21:11 bottles.cgi
[localhost:/Library/WebServer/CGI-Executables] sneex% chmod +x bot*
[localhost:/Library/WebServer/CGI-Executables] sneex% ls -l bo*
-rwxr-xr-x  1 sneex  admin  518 Apr 14 21:11 bottles.cgi
[localhost:/Library/WebServer/CGI-Executables] sneex%



#!/usr/bin/perl -w

use CGI qw(:all);
use CGI::Carp qw/fatalsToBrowser/;
use strict;
use diagnostics;

my($fccjPointer) = new CGI;
$fccjPointer->import_names('FCCJ');

$FCCJ::x = '' unless param('x');
$FCCJ::y = '' unless param('y');

unless (length($FCCJ::x . $FCCJ::y) > 0) {
    print "Location: http://127.0.0.1/\n\n";;
    exit;
}

print<<__IMA;
Content-type: text/html

99 bottles of beer on the wall,
99 bottles of beer...

Take one down, have a few rounds...

98 bottles of beer on the wall...

__IMA


__END__


If all works correctly, it should just send you to you own local host home
page  :)  If you see the song, then you must have submitted it as a form...


Cheers;
-Sx-  :] 
My new personal quote:
Be alert!  The world needs more Lerts!  :)


Reply via email to