in reply to Mapping URLs to code - in search of perlish dispatch schemes

As of Version 5.7, Catalyst has the Chained dispatch type, which makes the common stuff regexes were used for more easy:

# chain to / sub local : Chained PathPart('foo') { ... } # chain to the foo action sub bar : Chained('foo') CaptureArgs(1) { ... } # endpoint, chain to bar action sub baz : Chained('bar') Args(1) { ... }

This gives a /foo/bar/*/baz/* resource where * stands for one argument. If /foo/bar/23/baz/17 is requested, first 'foo' will be run, then 'bar' with '23' as argument, and at last 'baz' with an argument of '17'.

For more information see Catalyst::DispatchType::Chained

Ordinary morality is for ordinary people. -- Aleister Crowley

Replies are listed 'Best First'.
Re^2: Mapping URLs to code - in search of perlish dispatch schemes
by Corion (Patriarch) on Jul 21, 2006 at 10:17 UTC

    While this syntax is too verbose for my taste, does the module allow for implicit untainting? I would imagine a second parameter to the Args or CaptureArgs attribute, that specifies the regex or code to be run.

      That module does just the dispatching. Tho I'm working on something like what you want.

      And too verbose? Naah :)

      Ordinary morality is for ordinary people. -- Aleister Crowley