Very nice!  One of the things that always catches me when developing
is remembering to add a new runmode method to the list at the top of
the page.  This would save me a little time during development.

Although it is also nice to have all the runmodes listed at the top of
the package to show what is implemented in the app (sort of self
documenting).

It is unfortunate that it needs to be implemented using the prerun
hook, but I can see your reasons for not rewriting the 'run' method in
CGI::Application.  It might be worthwhile to either add this to
CGI::App itself, or to make CGI::App easier to subclass.  Right now it
is difficult to subclass when you only want to alter a small part of
CGI::App since a lot is happening in only a few methods (init and run
in particular).

This module also shows a very good example of the potential usefulness
of the callbacks patch as well.

Cheers,

Cees

On Sun, 17 Oct 2004 10:56:25 +0900, Thilo Planz <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> here is another plugin to discuss:
> 
> http://perl-pad.sourceforge.net/cgiapp/AutoRunmode.html
> 
> http://perl-pad.sourceforge.net/cgiapp/CGI-Application-Plugin-
> AutoRunmode-0.01.tar.gz
> 
> The plugin lets you flag methods as "Runmode" and then you can call
> them without setting up the usual name mapping table
>   via $self->run_modes :
> 
> >  package MyApp;
> >   use base 'CGI::Application';
> >   use CGI::Application::Plugin::AutoRunmode
> >                 qw [ cgiapp_prerun];
> >
> >    sub my_run_mode : Runmode {
> >                 # do something here
> >    }
> >
> >    sub another_run_mode : Runmode {
> >                 # do something else
> >    }
> >
> >    # you now have two run modes
> >    # "my_run_mode" and "another_run_mode"
> 
> Feedback, as usual, highly appreciated,
> 
> Thilo
> 
> ---------------------------------------------------------------------
> Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
>               http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Cees Hek

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to