Stories
Slash Boxes
Comments
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Dispatch has to be a tree, not graph, if uri_for is supposed to be possible. And I like uri_for too 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_for already has a mechanism for specifying captures, it would work out of the box. And in fact (I think) it’s already possible to write ArgMatch yourself!

    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+')

    • 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).