[Catalyst] Why does $c->stats require -Debug flag?

Richard Jones ra.jones at dpw.clara.co.uk
Sat Apr 12 10:45:18 BST 2008

Jon Schutz wrote:
> On Fri, 2008-04-11 at 19:53 +0100, Richard Jones wrote:
>> Yeah I tried -Stats already - something must have changed in a recent 
>> version of Catalyst::Stats, as now I get:
>> [error] Caught exception in MyApp::Controller::Root->end "Can't locate
>> object method "accept" via package "Catalyst::Stats" at .. etc"
>> So it's now finding the stats method but apparently not accept. accept 
>> is a method of Tree::Simple I think. I didn't specifically load anything 
>> from Tree::Simple previously, it just worked using $c->stats->accept().
> I think you probably want $c->stats->report, but can't think why you're
> calling this directly as it is invoked in finalize() if -Debug or -Stats
> is set.  See perldoc Catalyst::Stats.

Because I never got round to delving into Catalyst::Stats or 
Tree::Simple inner workings. I copy/pasted the example from 
into my Root::end() method and it just worked.

At least it did until I removed the -Debug flag. And then tried to 
recover functionality by updating Catalyst::Stats to the latest version, 
which also updated Catalyst itself (I was using an earlier 5.70x). So 
I've no idea in which module(s) the change occurred to stop the process 
working. Maybe someone more familiar with these modules could offer a clue?
Richard Jones

More information about the Catalyst mailing list