I think what you are looking for is CGI::Application::Plugin::AutoRunmode. What you are doing sounds inherantly dangerous. You are allowing the user to execute any function that you have loaded into memory (remember that you can fully qualify your functions by putting the package name in front of it, so the user isn't even limited to just your CGI::Application namespace).
The way that CGI::Application::Plugin::AutoRunmode handles things is by using method attributes. Using your example, you would just do the following:use CGI::Application::Plugin::AutoRunmode qw [ cgiapp_prerun]; sub menu : Runmode { 'Ouch'; }
Not only is that safer, but it is also a lot cleaner and simpler than your AUTOLOAD solution.
In reply to Re: CGI::Application musings
by cees
in thread CGI::Application musings
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |