suppressed wrote:
I have what looks like a fairly simple problem. I have a run mode and this run mode calls a utility method. The utility method might throw an error, but the error is fixable. I want my utility method to see if it has an error and then switch to a specific error run mode to fix the error. The problem is, of course, I can't switch run modes from my utility method, the only place I can switch is from the cgiapp_prerun method. Whats the best way to hack around this problem?
To switch to one run mode from any other run mode you just need to return $self->new_run_mode. So adjust your utility sub in such a way that it makes sense in your application and makes it easy
to return the run mode .
# Our current run mode
sub runmode_1 {
my $html = foo();
# utility will tell us what's next
my $next_run_mode = utlity( qw/args to utility/ );
return $self->$next_run_mode defined $next_run_mode;
return $html;
}
sub utlity {
return 'error_run_mode';
}
sub error_run_mode {
...
}
--
Clayton
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.