[Catalyst] Has $c->response->redirect behaviour changed?

Alex Kavanagh alex at tinwood.homelinux.org
Wed Jan 25 13:24:08 CET 2006


At Wed, 25 Jan 2006 12:04:49 +0000,
Chisel Wright wrote:
> 
> On Wed, Jan 25, 2006 at 11:59:17AM +0000, Alex Kavanagh wrote:
> > > ---- cut here ----
> > > # updated to use information from:
> > > # http://catalyst.perl.org/calendar/2005/8/
> 
> > >     # use DefaultEnd magic
> > >     $c->NEXT::end( $c );
> >      ^^^^^^^^^^^^^^^^^^^^^^
> 
> > I'm not expert on NEXT but aren't you passing $c *twice* to
> > DefaultEnd's end?  It could just be me not understanding, but I would
> > probably have done (wrongly?) :
> > 
> >       $self->NEXT::end($c);
> 
> Yes, the double use of $c did make me suspicious. I blindly followed the
> example in the link: http://catalyst.perl.org/calendar/2005/8/
> 
> I kept meaning to change to $self to see what happens, or ask about it
> but I keep forgetting.
> 
> ...
> 
> ...
> 
> While I think about it, I've been reading
> http://catalyst.perl.org/calendar/2005/8/ and I noticed that there was
> double-use of $c in the example:
> 
>   $c->NEXT::end( $c );
> 
> Is this correct? SHould it be $self->NEXT::end($c);

Having just read the pod for NEXT.pm and also
Catalyst::Manual::WritingPlugins I'm now thoroughly confused.  I
*think* it should be $self->NEXT::end($c) as NEXT re-dispatches a call
continuing where the call to this sub left off as though this sub
hadn't been called.  Therefore, I would have thought that it would
need to the $self so that the stack contains ($self, $c, ....) for the
next sub.

However, NEXT might not work that way - maybe it stores params, etc. !???

We need a NEXT expert to step in please ...

Cheers

-- 
Alex.



More information about the Catalyst mailing list