Geoffrey Young wrote:

interesting.  the last time I tried was with bleedperl before 5.8 was
released - I know it worked then because I was writing a patch for
mod_perl core based on it.  this thread has most of the dialogue:

Hrm. Well, not sure how the :method attribute is implemented, but what I was trying to do was create a :Profiled attribute handler. So in my base class I had:

use Attribute::Handlers;

sub Profiled ATTR(CODE) { ... }

and in a subclass:

sub foo :Profiled {
}

but I was never able to get the Profiled handler to get called. I looked into Attribute::Handlers and it has INIT and CHECK blocks that set up the handlers in it, so I suspected this might be the problem. Doug claims that CHECK blocks dont work because perl calls CHECK blocks during perl_parse(), which only happens once at startup. So he said that it doesnt work for the same reason that:

perl -e 'eval qq(CHECK { print "hello world" })'

doesnt work.

I tried just putting a CHECK block with a warn in my application, and it is true that the the CHECK block never gets called. So given that it seems impossible that the Attribute::Handlers module can work under mod_perl.

Given that though, I dont doubt that the :method handler works for you :). Maybe this is implemented as a special case in mod_perl??

Mike



Reply via email to