[Catalyst] Root controller index() vs auto()

Matt S Trout dbix-class at trout.me.uk
Wed Aug 2 21:26:55 CEST 2006

leonard.a.jaffe at jpmchase.com wrote:
> Once again I have been bitten by the "Return a true value form your 
> auto() method or accept the consequences"
> I had no explicit return value in Root::auto, and was getting the 
> squirrely results previously mentioned.
> I added an explicit "return 1" at the bottom, and now I'm seeing 
> Root::index run (defined as index:Private)
> So I repeat
> <em>Make sure your auto() subs return a true value, or the main 
> controller sub you were expecting will not execute</em>

Evil hack:

package Catalyst::Action::Auto;

sub execute { shift->NEXT::execute(@_); return 1; }

sub auto :ActionClass('Auto')

(and use $c->detach if you want a genuine splat)

More information about the Catalyst mailing list