[Xitami] CGI Perl scripts

Russel Olinger xitami@lists.xitami.org
Sun, 30 Dec 2001 20:49:49 -0800


1.  #!  is the first line in your perl script.
2.  C:\perl\bin needs to be in your PATH
3.  all perl scripts need to go in your /xitami/cgi-bin directory (or what
ever directory you have designated to hold your CGI files
4.  The URL alias reference would be: <a
href=/cgi-bin/guestbook.pl>Guestbook</a> OR if you wanted the full path it
would be: <a href=http://208.33.152.220/cgi-bin/guestbook.pl>Guestbook</a>
5.  Your reference below is calling an .html file (guestbook.html), not the
perl .pl file

When calling a CGI file you need to call the script itself, in this case the
perl "guestbook.pl" file.  Xitami allows you to define where you are going
to keep your CGI scripts at.  You only get one root location.  By default it
provides you the /cgi-bin directory but you could modify that to
/my_cgi_files or /perl_scripts or what ever you want, assuming that the
directory EXISTS in c:\xitami\.  So when you are calling CGI files through a
href tag the CGI directory needs to be the first directory in the reference
path: <a href=http://x.x.x.x/cgi-bin/....>click here</a>.  Xitami see's the
/cgi-bin in the URL call and then goes to the /cgi-bin directory to complete
the rest of the URL reference.

valid calls assuming Xitami defaults (/cgi-bin must be at the beginning of
the path):
<a href=/cgi-bin/file.pl>
<a href=http://x.x.x.x/cgi-bin/file.pl>
<a href=/cgi-bin/perlscripts/file.pl> ## /perlscripts is a subdirectory and
it must exist for the URL call to work
<a href=/cgi-bin/blah/blah1/blah2/file.pl>

If Xitami is configured to accept /cgi-bin anywhere in the path:
<a href=/personal/cgi-bin/file.pl>
<a href=http://x.x.x.x/files/yourfiles/cgi-bin/myfiles/perlscripts/file.pl>

hope this helps.
----- Original Message -----
From: "Bruce" <bd4u@earthlink.net>
To: <xitami@lists.xitami.org>
Sent: Sunday, December 30, 2001 12:44 PM
Subject: Re: [Xitami] CGI Perl scripts


> On Mon, 31 Dec 2001 08:46:47 +1300, you wrote:
>
> >In message <qlou2u80essafl9cjt88eov26k7h7igg4b@4ax.com>, Bruce writes:
> >>In the following Perl script snipet, where would the URL
> >>be fit in exactly..
> >>======================>
> >><a href=\"$guestbookurl\">Guestbook</a>
> >>======================>
> >
> >I'd imagine that $guestbookurl is defined somewhere towards the top of
> >the script and should be set to the URL of either the perl script or
> >some HTML page it generates (depends on how the script works).
> >
>
>
>    The above HREF command is part of the Perl script. The helpfiles
> say to edit the href command in the Perl script to point to  the  html
> file. If by default it's the root, then I figure it might look
> something like
>
> <a href=\"$208.33.152.220\guestbook.html">Guestbook</a>
>
> But I have NO idea of the correct syntax for using in Perl. Does
> the above look right? Remember the above is supposed to be
> in a Perl script.
>
>    Also if the file resided in the CGI bin, do I add the directory
> structure, or will it be found by default of "root", so that all I
> need is the filename such as 208.33.152.220\guestbook.pl
> for a CGI URL?
>
> Xitami for Dummies-
>
> Bruce
>
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>
>