-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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 | I can not seem to get anything to work here except a simple coderef. | This defeats my entire purpose of dynamically pushing filter handlers, | if they can only be a simple subroutine. Is there any possible way to | use an object as a filter handler, or can it only be a monolithic | subroutine code reference? | | Thanks, | Chris | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCkG/0kVPeOFLgZFIRAkUnAKCaeFnvhd3rAf8uMseypOn95uH/IwCcDlYL S2p7lYLPGiaUEy7w0pHi4ik= =kaUI -----END PGP SIGNATURE-----