Doc bug: params() return value
This page claims params() returns a hashref, always: https://metacpan.org/pod/Dancer::Request#params Not true. It only does so in scalar context. Thus: myfunction(params); will pass myfunction a hash which gets flattened to an array, not a hashref. The fix is myfunction(scalar params); Also, this link from that section: https://metacpan.org/pod/Dancer::Request#params-source is missing the "-source" bit at the end. (The latter link does document this behavior of params(), but that didn't stop me from banging my head against a wall for an hour or two while I still believed what the first page said.)
On 05/02/2014 01:03 PM, Warren Young wrote:
This page claims params() returns a hashref, always:
There is no #params anchor on that page, so I'm not sure what you're looking at.
Not true. It only does so in scalar context. Thus:
myfunction(params);
will pass myfunction a hash which gets flattened to an array, not a hashref. The fix is myfunction(scalar params);
This is documented under https://metacpan.org/pod/Dancer::Request#params-source, as you noted. Since that is the only section related to params on the entire page, I don't see the issue.
Also, this link from that section:
https://metacpan.org/pod/Dancer::Request#params-source
is missing the "-source" bit at the end.
I see "-source" right there in the link: https://metacpan.org/pod/Dancer::Request#params-source. Am I missing something? I must be looking at a completely different page than you are. Or maybe I've just had too much to drink ;)
On 5/2/2014 14:54, Yanick Champoux wrote:
I don't see it either, and I'm (still) sober. Could you be looking at an old version of the doc, Warren?
No, I just neglected to give you the *third* URL -- which should have been first in my original email -- which shows the problem: https://metacpan.org/pod/Dancer#params
On Mon, May 05, 2014 at 09:03:26AM -0600, Warren Young wrote:
On 5/2/2014 14:54, Yanick Champoux wrote:
I don't see it either, and I'm (still) sober. Could you be looking at an old version of the doc, Warren?
No, I just neglected to give you the *third* URL -- which should have been first in my original email -- which shows the problem:
ah AH! I see it, now. Will create ticket and patch tonight-ish. Thanks! Joy, `/anick --
participants (3)
-
Maxwell Carey -
Warren Young -
Yanick Champoux