There are major concerns with using Attributes (particularly ones that use Attribute::Handlers) in combination with mod_perl. This is due to the fact that Attribute::Handlers uses CHECK blocks (by default, anyway) to set up the subroutine attributes and CHECK blocks don't run under mod_perl. Thus, the symbol table approach is not dependent on compilation stages and is sure to be in place at runtime.
This is not a new concept -- for example, Module::Build internally marks actions callable from the command line with the prefix "ACTION_". (E.g., "sub ACTION_test"). Its dispatch function just checks that it can("ACTION_$request") and subclasses can add new actions just by adding methods called "ACTION_whatever".
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re: A useful use of Attributes?
by xdg
in thread A useful use of Attributes?
by fireartist
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |