[Catalyst] Clash of the plugins: SubRequest vs Static::Simple

Andy Grundman andy at hybridized.org
Wed Oct 5 04:07:17 CEST 2005


Johan Lindström wrote:
> At 00:29 2005-10-05, Andy Grundman wrote:
> 
>> I'll try to duplicate this and write a failing test for 
>> Static::Simple.  Just looking at the code, I can't see anything wrong, 
>> though.
> 
> 
> Attached is a simple Cat project that demonstrates the behaviour (note: 
> Windows newlines).
> 
> perl script\smurf_test.pl /bar/baz
> [just outputs text]
> ...
> in Bar::baz
> 
> perl script\smurf_test.pl /bar/foo
> [calls /bar/baz as a subrequest and outputs some text with the result]
> ...
> in Bar::foo with subreq: (in Bar::baz)
> 
> If you edit Smurf.pm and add the Static::Simple, you get this instead:
> in Bar::foo with subreq: ()
> 
> And if you'll trace after the breakpoint you'll see how 
> Smurf::dispatch() is never called.

Thanks.  I worked up a test that duplicates the issue which I just 
committed.  Unfortunately, it appears to be an issue with NEXT.  When 
subrequest calls $c->dispatch, NEXT has already seen the dispatch method 
and therefore refuses to call it a second time.

Tried this in sub_request():

{
     local $NEXT::SEEN = {};
     $c->dispatch();
}

but with no luck.  There is probably a solution here with localizing the 
proper NEXT data structure.

I also changed my calls to NEXT::ACTUAL so it will die if it can't call 
the dispatch method, rather than appearing to work and just returning 
nothing.

-Andy



More information about the Catalyst mailing list