[Catalyst] sub default :Private versus sub xxx :Path

Brandon Black blblack at gmail.com
Tue Jul 11 17:48:59 CEST 2006


On 7/11/06, John Napiorkowski <jjn1056 at yahoo.com> wrote:
> With Catalyst we now have three ways to hook an action to the package namespace (That I know of)
>
> package myapp::Controller::demo
>
> 1) sub default :Private {...}
> 2) sub index :Private {...}
> 3) sub xxxxx :Path {...}
[....]

I would tend to think that "default" is the least-preferred way of
doing these days.  "default" used to be an interesting way to do
certain tricky things, but most of those things can now be handled
better via the new "Chained" stuff.  I can't imagine a really good use
for "default" that isn't covered better by Path or Chained or "sub
index".  Also, default has the nasty side effect of matching
unintended things that should have been 404's.

-- Brandon



More information about the Catalyst mailing list