in reply to Re: Adding regexps to named URI parameters aka /from/:foo/to/:bar - can it get better than this?
in thread Adding regexps to named URI parameters aka /from/:foo/to/:bar - can it get better than this?

Thank you, roboticus.

Despite my post being a case of "rubber duck debugging", my duck didn't tell me anything, so I had no choice but to submit it.

Your answer was quite insightful though. I realized that if I used an actual regexp I would most likely use something like my ($foo, $bar) = $line =~ qr/.../; instead of named captures. I think I'll just add a method to extract unnamed captures from path_info.

As for the use cases, IMHO mapping fancy URLs to query parameters is not at all a framework's responsibility. A proxy should do it. However, Mojo and Dancer and Kelp have it and I have to match if I want to ever take off.

Thanks again.

  • Comment on Re^2: Adding regexps to named URI parameters aka /from/:foo/to/:bar - can it get better than this?

Replies are listed 'Best First'.
Re^3: Adding regexps to named URI parameters aka /from/:foo/to/:bar - can it get better than this?
by Anonymous Monk on Sep 11, 2017 at 12:42 UTC
    To match add dependency on standalone cpan module that does it
      Looks like Routes::Tiny does it. Hmmm, maybe I'll try it. Thanks!