On Tue, 04 Dec 2001 09:37:19 -0500, Mark Stosberg <[EMAIL PROTECTED]> wrote :

> "Christopher S. Hyne" wrote:
> > 
>  I'd like
> > to be able to have run modes that instead of returning output, perform some
> > action and then call on a second run mode which returns the output.
> 
> does this work?: 
> 
> sub my_run_mode {
>       my $self = shift;
> 
>       # perform some action
> 
>       return $self->other_run_mode;
> }

This works if both run modes are in the same module, in my case this is not 
necessarily true. My program creates an instance of one application 
module, runs one of its run modes, then optionally overwrites the instance which an 
instance of a second application module and then run one of 
its run modes. For example a runmode in MyApp::Login would validate a user and then 
display a home page generated by a runmode in 
MyApp::Home. Or a runmode in MyApp::Settings would save user preferences and then 
display a home page from MyApp::Home. I can get away 
with displaying a page that says 'settings saved, click here for home'. I could also 
hack the module and add a 'if 
($ENV{CGI_APP_NO_HEADERS})' don't add headers. But then I'd have to patch the module 
everytime I installed or upgraded. I can work around 
it, I was just looking for a better way.

Thanks.

Christopher
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to