Programming :  Student Freelance Forum For Work Experience Builders' (CertificationPoint) The fastest message board... ever.
 
PERL-Apache::OutputChain -- Chain Stacked Perl Handlers
Posted by: adcertpoint (Moderator)
Date: April 29, 2020 04:42PM

Apache::OutputChain was written as a way of exploring the possibilities of stacked handlers in mod_perl. It ties STDOUT to an object which catches the output and makes it easy to build a chain of modules that work on output data stream.

Examples of modules that are build on this idea are Apache:confused smileySIChain, Apache::GzipChain and Apache::EmbperlChain -- the first processes the SSI's in the stream, the second compresses the output on the fly, the last adds Embperl processing.

The syntax goes like this:
<Files *.html>
SetHandler perl-script
PerlHandler Apache::OutputChain Apache:confused smileySIChain Apache:tongue sticking out smileyassHtml
</Files>

The modules are listed in the reverse order of their execution -- here the Apache:tongue sticking out smileyassHtml module simply picks a file's content and sends it to STDOUT, then it's processed by Apache:confused smileySIChain, which sends its output to STDOUT again. Then it's processed by Apache::OutputChain, which finally sends the result to the browser.

An alternative to this approach is Apache::Filter, which has a more natural forward configuration order and is easier to interface with other modules.

It works with Apache::Registry as well, for example:
Alias /foo /home/httpd/perl/foo
<Location /foo>
SetHandler "perl-script"
Options +ExecCGI
PerlHandler Apache::OutputChain Apache::GzipChain Apache::Registry
</Location>

It's really a regular Apache::Registry setup, except for the added modules in the PerlHandler line.

(Apache::GzipChain allows to compress the output on the fly.)

Options: ReplyQuote


Sorry, only registered users may post in this forum.
This forum powered by Phorum.