FAQ
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Intro.pod.patch
Type: application/octet-stream
Size: 2400 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20051027/27ff0ddc/Intro.pod.obj

Search Discussions

  • Phil Mitchell at Oct 27, 2005 at 6:24 pm

    On 10/27/05, Will Hawes 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 mailing list
    Catalyst@lists.rawmode.org
    http://lists.rawmode.org/mailman/listinfo/catalyst



    --
    ==========================
    2People Blog: http://2-people.blogspot.com/
    2People site: http://www.2people.org
  • Matt S Trout at Oct 27, 2005 at 6:48 pm

    On Thu, Oct 27, 2005 at 09:29:09AM -0700, Phil Mitchell wrote:
    On 10/27/05, Will Hawes 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/ +
  • Phil Mitchell at Oct 27, 2005 at 7:08 pm

    On 10/27/05, Matt S Trout wrote:
    On Thu, Oct 27, 2005 at 09:29:09AM -0700, Phil Mitchell wrote:
    On 10/27/05, Will Hawes 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.
    Ah, that's very helpful. I haven't checked the docs lately, but it
    would be great to have that in there...
    --
    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/ +

    _______________________________________________
    Catalyst mailing list
    Catalyst@lists.rawmode.org
    http://lists.rawmode.org/mailman/listinfo/catalyst

    --
    ==========================
    2People Blog: http://2-people.blogspot.com/
    2People site: http://www.2people.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedOct 27, '05 at 1:00p
activeOct 27, '05 at 7:08p
posts4
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase