At ApacheCon this year Geoff gave a talk about Output filters (slides: =
http://www.modperlcookbook.org/~geof...mp2_filters-p=
rintable.pdf.gz) which included a sample handler that ran the manual =
through HTML::Clean. a big part of the code in the filter was to handle =
the possibility of having split tags and that subsequently making =
HTML::Clean not play nice. =20

Philippe gave a talk about Profiling and Instrumenting (slides: =
http://ectoplasm.org/Talks/mod_perl-...iling-9394.pdf) in which a =
comment came up about using Filters to insert page generation metrics =
into the body of the page the metrics were about. This kind of filter =
too would have to handle the split tags problem.

So it occurred to me that this might well be handled by subclassing =
Apache2::Filter and making the subclass handle it. So after a bunch of =
screwing around I finally got a pretty much working version.

An example is running here:

http://filtertest.kabob.ca/

It's running the manual through a filter that injects '!!' at the end of =
each read call, basically just illustrating that it's actually working.

code here:=20

http://kabob.ca/perl/Apache2-Filter-...ter/TagAware.=
pm

notes:

What constitutes a 'tag' is user defined. it just takes a regexp that =
defines an incomplete tag, the default being '(<[^>]*)$'.

It only works with the stream filter API right now. I haven't read any =
of the bucket brigade documentation, but I assume that this idea could =
also be applied to that API as well.

I'm not sure if i'm doing anything really weird or really wrong here, so =
any and all comments are welcome.

Adam