docs.roxen.comView this page in a printer friendly mode
DocsRoxen2.2Administrator ManualScripting
Copyright © 2004, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com

   

CGI
Fast CGI
SSI
Java servlets
Roxen modules
Pike scripts
Pike tag
Perl support

Perl support

The Perl support provides support for both Perl scripts and Perl tags. In both cases, the actual Perl code is executed in a subprocess, and not in the main Roxen process, which makes it harder for the programmer to accidentally mess things up for the main Roxen server.

The module will catch requests to documents whose path ends with any of the extensions (suffixes) indicated by the `Extensions' setting in the module configuration. The default is `.perl' and `.pl'.

Perl tags, or processing instructions, will be available if the module setting `Enable Perl tag' is set to `Yes'. This means ordinary RXML pages can use Perl code, such as in the example below.


<?perl print scalar(localtime), "\n"; ?> 

It is possible to enable similar parsing of script results by switching the `Script output' option to `RXML', but this is usually not desirable, and may not work so well with traditional CGI scripts. Nevertheless, it might be useful under special circumstances.

When configuring the Perl support, it may be worth considering how heavy load the Perl support will be expected to handle. If a Roxen site makes heavy use of Perl scripts, it may be desirable that several such scripts can execute in parallel, while the opposite may be true if your Roxen server runs on modest hardware. In either case, the maximum number of subprocesses on behalf of the Perl support can be decided through the `Parallel scripts' setting in the module configuration. The default is 3, which should be good enough in most cases, but it might be desirable to raise or lower it some cases.

Unless other arrangements are made by the scripts, errors occuring during the execution of Perl scripts will be reported in the server debug log, so this is the place to watch for error reports. (The Event log in the web interface won't show these errors.)

Consult the Roxen Programmer manual for more details about how to use the Perl support.