Embperl - building dynamic websites with Perl

Include external components
[ << Prev: Form Validation ] [ Content ] [ Next: Finally >> ]

When running Embperl with Apache 2.0 there are some extented possibilities. While Apache 1.x sent all it's output directly to the browser, Apache 2.0 introduces a concept of filters, which allow you to process the output of any Apache handler through a chain of filters. Embperl can use this to embed any output that Apache can generate as a Embperl::Object component, just like it is any native Embperl page. This can be done by using the subreq parameter:

    [- Execute ({subreq=>'/cgi-bin/script.cgi'}) -]

The above code includes the output of a cgi script into a page.

This is especially useful for any application that is not newly written from ground up, but has grown over years, because you can include existing solution into your Embperl::Object driven website. Because of the flexibilty of the recipe/provider concept, you can not only include the output of thoses other components, but also postprocess it. For example you can include the output of a cgi script, for which you don't have the source code and can adapt the output to your current layout.

In the same way you can combine applications written in differnet languages like PHP and Java under a common layout. When you have included the Apache proxy module, the source must not reside localy on your machine, but you are able to request it from any webserver. You may for example query XML data from another server, for example news in the RSS format and run an XSL-transformation to make it look nicely into your layout.

[ << Prev: Form Validation ] [ Content ] [ Next: Finally >> ]

© 1997-2023 Gerald Richter / actevy