> sub display_index {
> my $self = shift;
> my $run_mode = $self->get_current_runmode();
> ...
> }
> I pass $run_mode to the template and upon first invocation
> 'mode1' is displayed.
> When going to mode2 and hitting the
> error condition, it returns to diplay_index and 'mode2' is
> displayed. I'm guessing I'm returning incorrectly?
Your return is fine. What you're not understanding is that the runmode
does not change. From Perl's and C::A's point-of-view, you're just
calling another subroutine.
> I don't see a runmode() method in the docs. Where can I read about
> that? And after returning how can I make it display the proper run
> mode?
That was my bad; there's no such thing. The get_current_runmode is all
that's available (and as Michael pointed out it's read-only).
You still haven't really showed us the code that is at the root of your
problem. What are you doing with the value of $run_mode that's giving
you problems? If you need to change this value, why not pass it in
something like this:
mode2 -- return $self->display_index('mode1');
mode1 -- my $run_mode = shift || $self->get_current_runmode();
Good luck,
William
--
Knowmad Services Inc.
http://www.knowmad.com
---------------------------------------------------------------------
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]