Apache::Filter

Apache::Filter is a Perl module that can alter the output of previous handlers.
Download

Apache::Filter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ken Williams
  • Publisher web site:
  • http://search.cpan.org/~kwilliams/Module-Build-0.2808/lib/Module/Build/Compat.pm

Apache::Filter Tags


Apache::Filter Description

Apache::Filter is a Perl module that can alter the output of previous handlers. Apache::Filter is a Perl module that can alter the output of previous handlers.SYNOPSIS #### In httpd.conf: PerlModule Apache::Filter # That's it - this isn't a handler. < Files ~ "*.blah" > SetHandler perl-script PerlSetVar Filter On PerlHandler Filter1 Filter2 Filter3 < /Files > #### In Filter1, Filter2, and Filter3: $r = $r->filter_register(); # Required my $fh = $r->filter_input(); # Optional (you might not need the input FH) while (< $fh >) { s/ something / something else /; print; } #### or, alternatively: $r = $r->filter_register(); my ($fh, $status) = $r->filter_input(); # Get status information return $status unless $status == OK; while (< $fh >) { s/ something / something else /; print; }In basic operation, each of the handlers Filter1, Filter2, and Filter3 will make a call to $r->filter_input(), which will return a filehandle. For Filter1, the filehandle points to the requested file. For Filter2, the filehandle contains whatever Filter1 wrote to STDOUT. For Filter3, it contains whatever Filter2 wrote to STDOUT. The output of Filter3 goes directly to the browser.Note that the modules Filter1, Filter2, and Filter3 are listed in forward order, in contrast to the reverse-order listing of Apache::OutputChain.When you've got this module, you can use the same handler both as a stand-alone handler, and as an element in a chain. Just make sure that whenever you're chaining, all the handlers in the chain are "Filter-aware," i.e. they each call $r->filter_register() exactly once, before they start printing to STDOUT. There should be almost no overhead for doing this when there's only one element in the chain. Requirements: · Perl


Apache::Filter Related Software