[Catalyst] Explicit subroutine call and use SubRequest
Will Hawes
info at whawes.co.uk
Sat Jan 21 10:52:31 CET 2006
Omid Houshyar wrote:
> Hi
>
> Actualy I saw the email about explicit subroutine and reply it and of
> course I follow up the replys and I saw the SubRequest plugin.
>
> I used it in my code and got deep recursion error. I used it in sub
> default. I don't know it is related to the place I call it. Anyway is
> there any recomendation to solve my problem.
>
> Thanks,
> Omid Houshyar
Your default sub gets called when no other action matches. If you are
using subreq in default and getting deep recursion, it could be because
no action matches the uri in your call to $c->subreq():
sub default {
my ( $self, $c ) = @_;
# subreq ends up here too
$c->res->{body} = $c->subreq('non_existent_action');
}
Try commenting out your call to $c->subreq() and see what happens when
you enter the uri you're passing to $c->subreq in the browser instead.
More information about the Catalyst
mailing list