<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Mar 9, 2007, at 10:04 AM, Robert 'phaylon' Sedlacek wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Christopher H. Laco wrote:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Sure, it they're that different. The goal still stands, don't use</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">uri_for everywhere. Only use it when you really need it.</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Jep. But this is not getting easier if you start to have captures in your chains. I'm still having high hopes to build something fast(er) with URI::Template.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV></BLOCKQUOTE></DIV>I actually built something to do this just this weekend, because I had some big tables that were calling uri_for more than once for every row of the table.  I ended up doing something like this...<DIV><BR class="khtml-block-placeholder"></DIV><DIV>In the controller...</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>$c-&gt;stash-&gt;{ 'uri_templates' }-&gt;{ 'id' } = $c-&gt;req-&gt;uri_with( { object_id =&gt; '[*id*]' } )-&gt;as_string;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>In the template....</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[% WHILE ( row = resultset.next ) %]</DIV><DIV>    [% FOR col IN columns %]</DIV><DIV>        [% IF uri_templates.$col %]</DIV><DIV>            [% action_link( uri_templates.$col, row ) %]</DIV><DIV>        [% ELSE %]</DIV><DIV>            [% row.$col %]</DIV><DIV>        [% END %]</DIV><DIV>    [% END %]</DIV><DIV>[% END %]</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Elsewhere...</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sub action_link {</DIV><DIV>    my ( $template, $object ) = @_;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    while ( $template =~ /\[\*(\w+)\*\]/ ) {</DIV><DIV>        my $i = $1;</DIV><DIV>        my $rep = $object-&gt;$i();</DIV><DIV>        $template =~ s/\[\*$i\*\]/$rep/g;</DIV><DIV>    }</DIV><DIV>    return $template;</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I actually looked at URI::Template, and the one major issue I had with it was the choice of { and } as the template indicator characters, you can't do $c-&gt;req-&gt;uri_with( { foo =&gt; '{bar}' } ), since URI will escape the { and }, and your template will end up saying %7Bbar%7D instead of {bar}.</DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Jason Kohles</DIV><DIV><A href="mailto:email@jasonkohles.com">email@jasonkohles.com</A></DIV><DIV><A href="http://www.jasonkohles.com">http://www.jasonkohles.com</A>/</DIV><DIV>"A witty saying proves nothing."  -- Voltaire</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></DIV></BODY></HTML>