Subject: Re: [SWIPL] really need help! problem about CGI executable

From: Jonathan D Johnston <[email-masked]>
Date: Sun, 31 Dec 2000 23:54:16 -0500

On Sat, 30 Dec 2000 19:37:46 +0800,
Cecilia Wong <[email-masked]> writes:
>Hi, 
>
>I am trying to use CGI (perl) to call my SWI-Prolog program. I followed
something found 
>in this mailing list like this:
>
>#! /bin/sh
>exec /usr/local/bin/pl -f none -g
>"load files (['http://localhost/myprologfile.pl'], [silent (true)])" -t
main -- $*

1) This is a shell script, not Perl. For one thing, note the
     "shebang" line: #! /bin/sh
2) load_files/2 syntax is load_files(+Files,+Options).
     No space between "load" & "files" or between "files"
     & the "(".
3) load_files needs a path, not a URL.

>(suppose "main" a program in the "myprologfile.pl") 
>
>but it doesn't work! The error message is:
>
>Bareword found where operator expected at test.pl line 2, near "/bin/pl"
>(Missing operator before pl?)
>Scalar found where operator expected at test.pl line 3, near "-- $*"
>(Missing operator before  $*?)
>syntax error at test.pl line 2, near "/usr/local"
>Execution of test.pl aborted due to compilation errors.

These error messages are from Perl, not Prolog  You have fed
a shell script to Perl, so naturally there will be syntax errors.

>
>Can anyone help? Thanks in advance!
>
>Cecilia

Hope that helps,
Jonathan D Johnston
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.