Tom Schindl wrote:

Chris Jacobson schrieb:
| Hello,
|
|    I am attempting to write a system which allows output filters to be
| dynamicaly pushed on the output filter stack at the end of a
| PerlResponseHandler.  These output filters are generated from a master
| factory object.
| ....
| my $FilterType = "Foo";
| my $FilterObject = My::FilterFactory->new($FilterType);  #
| Class::Factory subclassed module
| # This will generate a My::Filter::Foo object which inherits methods
| from the factory object and overrides them as necessary
| $r->add_output_filter($FilterObject->handler); # This call will Seg
| Fault the server
| .....
|

This is once more you benefit form the perl-closures many people stumble
about ;-)

$r->add_output_filter(sub { $FilterObject->handler(@_) });

Tom

Brilliant. That works out perfectly! Adding the filter this way plus making some minor changes to my factory generated filter objects has solved the problem (and the seg faults!). Thanks Tom and Stas for the pointers.

--
Chris Jacobson
Online-Rewards.com
2900 Jefferson Ave.
Cincinnati, OH 45219

(513) 665-9070 x310
http://www.online-rewards.com

Reply via email to