[Catalyst] Patch for Catalyst::Manual::Intro

Matt S Trout dbix-class at trout.me.uk
Thu Oct 27 19:02:44 CEST 2005


On Thu, Oct 27, 2005 at 09:29:09AM -0700, Phil Mitchell wrote:
> On 10/27/05, Will Hawes <info at whawes.co.uk> wrote:
> > Attached is a patch to explain Regex actions in a little more depth. I think this is necessary from a new user's perspective -  I misunderstood how Regex actions work from day one and only had it clarified in IRC yesterday :)
> >
> > The patch is against Intro.pod from the 5.49_01 release on CPAN.
> 
> Thanks a lot for this patch. I've been confused by regex actions, too.
> However, is it true that this snippet matches /order/view/123? That's
> a bit odd, since it has the end of string metacharacter ...
> 
> +    sub view_good : Regex('^.*/view$') {
> 
> +        # better!
> 
> +    }

Catalyst matches by path part, though

/one/two/three

will be dispatched as

"Do we have anything to match /one/two/three?"
"Do we have anything to match /one/two (to be executed with args of 'three')?"
"Do we have anything to match /one (with args of ('two', 'three'))?"
"Do we have anything to match / (with args of ('one', 'two', 'three'))?" [0]
"What's the (possibly inherited) default for /one/two/three?"

[0] Can't remember if this one actually happens, no time to check, sorry.

-- 
     Matt S Trout       Specialists in Perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list