[Catalyst] Regex dispatch type is deprecated

Dmitry Karasik dmitry at karasik.eu.org
Tue Jul 7 15:41:15 GMT 2015


Hello all,

I'm upgrading an older Catalyst installation, and re-writing code that uses
Regex/LocalRegex dispatchers. The rewriting is mostly for routes such as
Regex('a-(\d+)-(\d+).png'), and I'm writing new code which basically does the
same, but using :Args(1), manually matching the last part of url, and detaching
to new route with matched parameters. This is not a problem, but I'm thinking
that I must be not the only one having the same problem, and there must be a
module on CPAN that dispatches execution using regexes, as a replacement. But
Catalyst::DispatchType::Regex that seems to be the offical replacement, warns about the
Regex/LocalRegex attributes are deprecated, which is confusing to me -- the
feature was removed from the core, okay, but I still want to use it through a
separate module, why then warn about deprecation again?

So basically my question is, what's the best recommended way to rewrite
requests such as a-2-3.png, for example? Or, how could I rewrite these requests
with chaining? 

-- 
Thank you,
	Dmitry Karasik




More information about the Catalyst mailing list