Might I make a slightly different suggestion: Leave it up to the user.
There are so many places to get the run mode from (a cgi param, any place that can be reached from a subroutine passed into the runmode sub) that it would probably be healthiest for the projected development of CGI::App to let the users bang on this on their own for a while before you impose a preconcieved one-way-to-do-it. I know you are wisely asking this list our opinion, but I think it would be prudent to say that we don't know what the "right" answer is either, if such a thing exists. But why would we? We haven't taken what you've currently got for a spin yet. We haven't discovered the ins and outs of working with this new, cool toy. i say give it some time. no rush. Stephen -----Original Message----- From: Greg Marr [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 03:58 PM To: [EMAIL PROTECTED] Subject: RE: [cgiapp] cgiapp_prerun() method At 03:41 PM 05/06/2002, Jesse Erlbaum wrote: > > What about having $self->current_rm() as an object function > instead of > > passing it around into and out of sub-routines? > > > > then you could get the rm: > > my $rm = $self->current_rm(); > > > > and change the rm: > > $self->current_rm( $rm ); > >This is the same problem as $self->param('CGIAPP_RUNMODE') -- >namely, you cannot actually change the run-mode unless you do so in >the cgiapp_prerun() method! > >For instance, if you're in the middle of a run-mode, there is no >hope that calling current_rm() (or changing 'CGIAPP_RUNMODE') will >have any effect: I thought this sounded bad at first, but the more I think about it, the less unreasonable it seems. This is really no different than the existing functions run_modes() and mode_param(), which only have any effect up until the point that the run mode is chosen. Changing either of these in the run-mode has no chance of changing the selected run mode. I'm starting to like this much better than having to return a value that was passed to the function in order to make the simple addition of the function not completely break your application. -- Greg Marr [EMAIL PROTECTED] "We thought you were dead." "I was, but I'm better now." - Sheridan, "The Summoning" --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]