in reply to How do I present other web extensions?

This is more a function of your webserver, than of CGI or Perl. Webservers by default just act as a switchboard, and can optionally hand off to CGI, ColdFusion, PHP, SSIs, or whatever other text-preprocessor you might have. It is exceedingly difficult to have one preprocessor hand off to another one. Generating a seperate page, and then redirecting to it is one way to get the webserver to use a diffferent interpreter for each step of the process, but if that is out, for whatever reason, it's possible that there might be another way --

Apache uses a series of handlers, and it might be possible, using mod_perl to adjust the stack. (I don't know if it can be done dynamically, as I've never tried, but I have that general impression after having read Practical mod_perl.). It may be easier with Apache 2, as there are specifically SetInputFilter and SetOutputFilter rather than just SetHandler. If you set mod_perl as the input filter, the webserver may still do its general switchboarding to pass off to another program.

Another alternative would be to call the other language's engine from within your script, but this would probably ruin any optimizations they might have, and would only be possible with those parsers that can be called from the command line (like PHP), or to have the script use LWP or similar to call the webserver to get the templates that have already been parsed. (you may have to change the order of operations, to have whatever the alternative preprocessor is, to call the script through the webserver, so it executes last, but this could be messy, and need extra files)

Update: Practical mod_perl is available online, under the creative commons license.

  • Comment on Re: How do I present other web extensions?

Replies are listed 'Best First'.
Re^2: How do I present other web extensions?
by satchm0h (Beadle) on Mar 17, 2005 at 15:48 UTC