home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / srev13h.zip / PERL.DOC < prev    next >
Text File  |  1998-04-17  |  4KB  |  97 lines

  1. 15 Apr 1998
  2.            SRE-http and the use of CGI-BIN scripts written in PERL.
  3.  
  4. By default, SRE-http assumes that a CGI-BIN script is a binary executable,
  5. or is a "script" written in REXX.  However, to take advantage of the
  6. wide-world of PERL scripts, SRE-http can invoke non-REXX interpreters when 
  7. running a CGI-BIN script.
  8.  
  9. Basically, to do this you just set the SRE-http's INTERPRET_TYPES parameter.
  10. The details on how to do this are in INITFILT.DOC; for now, let's assume
  11. that we've set INTERPRET_TYPES=' PL=PERL5'. 
  12.  
  13. Given the above, let's consider some examples:
  14.   * If the request string is:  CGI-BIN/TEST-CGI?arg1
  15.     then SRE-http will CALL the TEST-CGI program, which should either
  16.     be a REXX program, or a binary executable (a .EXE file).
  17.  
  18.  * If the request string is: CGI-BIN/TXTCLOCK.PL
  19.     the SRE-http will invoke the PERL5 processor, and use it
  20.     to execute TXTCLOCK.PL.
  21.  
  22. So all you need to do is make sure your PERL scripts have a .PL extension.
  23. Oh, you also need to install an OS/2 version of PERL on your
  24. computer (in this case, one with a name of PERL5).  
  25. We've had some luck with the following.
  26.  
  27. 1) Obtain the PERL5 interpreter. You can get it at hobbes, look
  28.    under /pub/os2/unix/dev/perl502b.zip.
  29.  
  30.     Hobbes can be found via FTP at ftp-os2.nmsu.edu, or through the
  31.     web at http://hobbes.nmsu.edu
  32.  
  33. 2) You'll also need a copy of the EMX "runtime environment". You can
  34.    get it at hobbes -- you can try /os2/unix/emx09c/emxrt.zip, or
  35.    you can look around for the latest version.
  36.  
  37. 3) Upon obtaining these two packages, you need to install them.
  38.    The following worked for us (though you probably will want
  39.    to look at the documentation that comes with both packages):
  40.  
  41.      a) * Create an \EMX directory somewhere (say, on C:).
  42.         * Copy EMXRX.ZIP to this directory and UNZIP it.
  43.           CAUTION: The Dec. 1997 version of EMXRT (on hobbes)
  44.                    self extracts into an EMX directory UNDER
  45.                    the current directory. Thus, you might need to
  46.                    copy EMXRT.ZIP to your root directory, and
  47.                    then unzip it (an EMX directory will be automatically
  48.                    created).
  49.         * Modify the following in  CONFIG.SYS:
  50.              i) Add C:\emx\dll to  you LIBPATH= line.
  51.              ii) Add c:\emx\bin to your PATH= line.
  52.           (of course, the c:\emx should be changed to reflect where
  53.            you installed EMX).
  54.      b)* Create a \PERL directory somewhere (say, on D:).
  55.          The PERL authors HIGHLY recommend using a HPFS drive;
  56.          since most PERL scripts are long-named. That means
  57.          you might have to change the location of your CGI_BIN_DIR
  58.          directory (or use SRE-http's virtual directories when calling 
  59.          PERL scripts).
  60.        * Copy perl502b.zip to this directory, and UNZIP it.
  61.        * Copy PERL5.EXE and PERLGLOB.EXE to a directory in the
  62.          OS/2 PATH (i.e.; C:\OS2\APPS).
  63.        * Copy PERL5.DLL to a directory in the OS/2 LIBPATH
  64.          (i.e.; C:\OS2\DLL)
  65.        * Add the following to config.sys: 
  66.               SET PERL5LIB=D:\PERL5\LIB
  67.          (of course, D:\PERL should be changed to reflect where
  68.           you've installed PERL).
  69.        * The authors also suggest adding: 
  70.               SET PERL5LOAD=10 
  71.          (to leave the interpreter in memory, thereby reducing load time)
  72.  
  73.  
  74. 4)  You'll have to reboot for these changes to take effect.
  75.  
  76.  
  77. 5) Make sure that INTERPRET_TYPES=' PL=PERL5 ' (it's set in the
  78. INITFILT.80 file). By default, it will have that value, so you
  79. should only need to check it if you've been messin' around.
  80.  
  81.   
  82. That should do it.  You'll probably want a few scripts to try out --
  83. a good source is Matt's Script archive, located at:
  84.   http://worldwidemart.com/scripts
  85. As a convenience, a very simple "time" script (TXTCLOCK.PL) is
  86. included with SRE-http; we recommend calling it as a #EXEC include --
  87. just insert the following in an HTML document:
  88.      <!-- #EXEC cmd="txtclock.pl" -->
  89.  
  90.  
  91. Good luck.
  92.  
  93. (and thanks to David Richardson for pointing out the need, and for
  94. finding the PERL5 interpreter, etc.)
  95.  
  96.  
  97.