Thanks.
Duh.

Clinton Gormley wrote:
     $r->set_handlers(PerlFixupHandler => \{$_[0]->handler('modperl')});

The funny thing is, the way I understand that code above is to mean :
"take a reference to the piece of code between the curly brackets, and pass that code reference as the 2d argument to $r->set_handlers()". But the error message seems to indicate that perl is actually trying to execute "$_[0]->handler()" at that point, no ?


Actually, this code takes a reference to the value returned when you run
the code between the curlies.


What I can't figure out is why it works at all in one of your systems :)

I think you're wanting:

     $r->set_handlers(PerlFixupHandler => sub {$_[0]->handler('modperl')});

Yes.  That works.
Thank you, my mistake. Shows how easily I get confused when trying to do anything even remotely sophisticated with perl references.

Now that you pointed this out, I also don't understand why it is running on the other system. It would be interesting to figure out what the returned value of that call is (was) (probably the old value of handler()), and why it is then different between these two systems also. The module is exactly the same in both cases, and it is called in the same circumstances, from a <Location> section configured in the same way.
Yes, I know, there must be a difference. Hmm.


Reply via email to