home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFV12J
/
PERL.DOC
< prev
next >
Wrap
Text File
|
1997-03-25
|
4KB
|
88 lines
SRE-Filter and the use of CGI-BIN scripts written in PERL.
By default, SRE-Filter assumes that a CGI-BIN script is written
in REXX. However, to take advantage of the wide-world of PERL scripts,
SRE-Filter can invoke non-REXX interpreters when running a CGI-BIN script.
Basically, to do this you just set the SRE-Filter'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-Filter 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-Filter 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 /os2/unix/perl502.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, under /os2/unix/emx09c/emxrt.zip
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.
* 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-Filter's virtual directories when calling
PERL scripts).
* Copy perl502.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-Filter; 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 PERL502, etc.)