<div>
Hi,
</div><div><br></div><div>Maybe for compatibility (-ish), it could be changed so that 'splat' is still stored in the request params, but only if there is not an existing 'splat' param.</div><div>This would fix the ?splat=spolsh case, and more than likely cover any existing users of params->{splat} as splat()?</div><div><br></div><div>Haven't dug into the code so not sure what technical effort that implementation would require.</div>
<div><div><br></div><div>-- </div><div>Rik Brown</div><div>http://www.rikbrown.co.uk</div><div><br></div></div>
<p style="color: #A0A0A8;">On Wednesday, 26 December 2012 at 21:31, damien krotkine wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div><div dir="ltr">Hi,<div><br></div><div>I think this is due to this line : </div><div><br></div><div><a href="https://github.com/PerlDancer/Dancer/blob/devel/lib/Dancer/Route.pm#L139">https://github.com/PerlDancer/Dancer/blob/devel/lib/Dancer/Route.pm#L139</a><br>
</div><div><br></div><div style="">And I don't know the rational for this feature. I don't think we need to pollute the request params with splat, so I vote for its removal. Of course in theory it breaks backward compatibility, so caution must be applied... Anyone ever used $params->{splat} ? I think the splat() function can be used instead in every cases.</div>
<div style=""><br></div></div><div><br><br><div>On 26 December 2012 21:33, <span dir="ltr"><<a href="mailto:alois.mahdal.1-ndmail@zxcvb.cz" target="_blank">alois.mahdal.1-ndmail@zxcvb.cz</a>></span> wrote:<br><blockquote type="cite"><div>Hello dancers!<br>
<br>
I like Dancer but I'm having a little problem with this<br>
regex/wildcard matching. The issue is that hash returned<br>
by params() in the relevant sub always contains 'splat'<br>
key referring to array of matches.<br>
<br>
Maybe this reference might be useful (when?), what if<br>
I *really* want to pass "splat=splosh"? According to<br>
my testing, the value is lost!<br>
<br>
<br>
Can this behavior be disabled?<br>
<br>
Or is it a bug? (IIUC, I can always do `[ splat ]` so why<br>
the pollution?)<br>
<br>
<br>
For illustration, request is:<br>
<br>
GET /there?splat=splosh&bar=baz<br>
<br>
and relevant route:<br>
<br>
get qr{(.*)} => sub {<br>
my $params = params();<br>
my ($path) = splat; # '/there'<br>
my $foo = $params->{foo}; # 'bar'<br>
my $splat = $params->{splat}; # [ '/path' ] instead<br>
# of 'splosh'!<br>
my $splat = param('splat'); # '/there'<br>
}<br>
<br>
<br>
Thanks,<br>
aL.<span><font color="#888888"><br>
<br>
-- <br>
Alois Mahdal<br>
______________________________<u></u>_________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/<u></u>mailman/listinfo/dancer-users</a><br>
</font></span></div></blockquote></div><br></div>
</div><div><div>_______________________________________________</div><div>dancer-users mailing list</div><div><a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a></div><div><a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>