home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
srev13g.zip
/
PERL.DOC
< prev
next >
Wrap
Text File
|
1998-04-17
|
4KB
|
97 lines
15 Apr 1998
SRE-http and the use of CGI-BIN scripts written in PERL.
By default, SRE-http assumes that a CGI-BIN script is a binary executable,
or is a "script" written in REXX. However, to take advantage of the
wide-world of PERL scripts, SRE-http can invoke non-REXX interpreters when
running a CGI-BIN script.
Basically, to do this you just set the SRE-http's INTERPRET_TYPES parameter.
The details on how to do this are in INITFILT.DOC; for now, let's assume
that we've set INTERPRET_TYPES=' PL=PERL5'.
Given the above, let's consider some examples:
* If the request string is: CGI-BIN/TEST-CGI?arg1
then SRE-http will CALL the TEST-CGI program, which should either
be a REXX program, or a binary executable (a .EXE file).
* If the request string is: CGI-BIN/TXTCLOCK.PL
the SRE-http will invoke the PERL5 processor, and use it
to execute TXTCLOCK.PL.
So all you need to do is make sure your PERL scripts have a .PL extension.
Oh, you also need to install an OS/2 version of PERL on your
computer (in this case, one with a name of PERL5).
We've had some luck with the following.
1) Obtain the PERL5 interpreter. You can get it at hobbes, look
under /pub/os2/unix/dev/perl502b.zip.
Hobbes can be found via FTP at ftp-os2.nmsu.edu, or through the
web at http://hobbes.nmsu.edu
2) You'll also need a copy of the EMX "runtime environment". You can
get it at hobbes -- you can try /os2/unix/emx09c/emxrt.zip, or
you can look around for the latest version.
3) Upon obtaining these two packages, you need to install them.
The following worked for us (though you probably will want
to look at the documentation that comes with both packages):
a) * Create an \EMX directory somewhere (say, on C:).
* Copy EMXRX.ZIP to this directory and UNZIP it.
CAUTION: The Dec. 1997 version of EMXRT (on hobbes)
self extracts into an EMX directory UNDER
the current directory. Thus, you might need to
copy EMXRT.ZIP to your root directory, and
then unzip it (an EMX directory will be automatically
created).
* Modify the following in CONFIG.SYS:
i) Add C:\emx\dll to you LIBPATH= line.
ii) Add c:\emx\bin to your PATH= line.
(of course, the c:\emx should be changed to reflect where
you installed EMX).
b)* Create a \PERL directory somewhere (say, on D:).
The PERL authors HIGHLY recommend using a HPFS drive;
since most PERL scripts are long-named. That means
you might have to change the location of your CGI_BIN_DIR
directory (or use SRE-http's virtual directories when calling
PERL scripts).
* Copy perl502b.zip to this directory, and UNZIP it.
* Copy PERL5.EXE and PERLGLOB.EXE to a directory in the
OS/2 PATH (i.e.; C:\OS2\APPS).
* Copy PERL5.DLL to a directory in the OS/2 LIBPATH
(i.e.; C:\OS2\DLL)
* Add the following to config.sys:
SET PERL5LIB=D:\PERL5\LIB
(of course, D:\PERL should be changed to reflect where
you've installed PERL).
* The authors also suggest adding:
SET PERL5LOAD=10
(to leave the interpreter in memory, thereby reducing load time)
4) You'll have to reboot for these changes to take effect.
5) Make sure that INTERPRET_TYPES=' PL=PERL5 ' (it's set in the
INITFILT.80 file). By default, it will have that value, so you
should only need to check it if you've been messin' around.
That should do it. You'll probably want a few scripts to try out --
a good source is Matt's Script archive, located at:
http://worldwidemart.com/scripts
As a convenience, a very simple "time" script (TXTCLOCK.PL) is
included with SRE-http; we recommend calling it as a #EXEC include --
just insert the following in an HTML document:
<!-- #EXEC cmd="txtclock.pl" -->
Good luck.
(and thanks to David Richardson for pointing out the need, and for
finding the PERL5 interpreter, etc.)