[Catalyst] Handling arguments with Reges vs the meaning of paths
apv at sedition.com
Thu Jan 5 23:18:44 CET 2006
First, to set a baseline, I love Catalyst and am working on 3 different
projects with it.
Now, I am arguing that the Regex argument (not snippet) handling is
conceptually broken and should be changed.
If I have a Regex ('whatever/(STOP-HERE)$'), I really mean the '$'. I
want it to stop.
I don't want to slurp up more path into arguments because it's not
mapping to anything
the application does.
A path is, conceptually, a pointer to a real thing. Not an arbitrary
set of parameters which
may or may not map to results. This is different from query string
arguments which are
conceptually asking a question for which there may be no answer. E.g.:
Even in the rare cases where paths can be arbitrary, like
They are typically limited to 1 argument.
So, I'm in the position where I'm about to start adding:
my ( $self, $c, $path_args ) = @_;
die 404 if $path_args;
into most all my Regex controllers.
The solution, if anyone agrees, is to allow '$', '\Z', '\z' to truly
the Regex controller will accept. If there is more, it should be kicked
the default(s) where several (or all) can be handled at once instead of
Yes, sensible? No, crazy talk?
Thanks for looking!
More information about the Catalyst