NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
That's not what's missing (Score:1)
Dispatch has to be a tree, not graph, if
uri_foris supposed to be possible. And I likeuri_fortoo much to consider any proposal that breaks it.Instead, I would like to see a way to constrain the possible values of
CaptureArgs. That way you could say something like this:PathPart("") Chained('/api/v1/v1_chain') CaptureArgs(2) ArgMatch(0, 'episode|broadcast')Since
uri_foralready has a mechanism for specifying captures, it would work out of the box. And in fact (I think) it’s already possible to writeArgMatchyourself!I don’t know if a subroutine can have several instances of the same attribute. If not, the interface would have to be pretty clumsy. Otherwise, you could just repeat it to constrain multiple captures. So with that in hand you could throw in this for good measure:
ArgMatch(1,'\d+')Reply to This
Re: (Score:2)
Yeah, I've thought that matching args against regular expressions would make this grief go away. I was whining about this yesterday to colleagues (I've found myself supremely dissatisfied with the amount of cut-n-paste that Chained actions entail which the Regex actions didn't, even though our regexes were too unwieldy).