[Catalyst] does detach cancel forward

Steve Rippl rippls at woodlandschools.org
Sat Nov 7 23:44:28 GMT 2009


On Sat, 2009-11-07 at 15:30 -0800, Andrew Rodland wrote:
> On Saturday 07 November 2009 01:08:33 pm Steve Rippl wrote:
> > it's just that I had started thinking
> > in terms of "nested" flow control because that's what I wanted
> (wishful
> > thinking...).  I thought perhaps each forward created a separate
> > nest/level I could detach out of and previous forwards were
> > "remembered", but obviously this isn't the case.
> 
> No, this *is* the case, 100%. Forward is nothing more than a function
> call, so
> you can nest it and you get a call stack. It's just that, as I pointed
> out,
> detach throws an extension that unwinds that whole stack.
> 
Sorry I wasn't clear, I got that it worked that way with forward, what
threw me was I didn't assume that detach unwound the whole stack (until
I saw it behaving that way).  But if I put use eval{$c->forward...) as
Bill suggested then a detach within that gets me back to where I want to
be.  I could probably rework things and remove the detaches I have in
there and just rely on the appropriate forwards, but the eval{} is a
quick solution.

Thanks for clarifying...



More information about the Catalyst mailing list