A problem with the "cookie" keyword
The "cookie" keyword right now returns a Dancer2::Core::Cookie object. I think it would be better if it returned the value (or values in list context) of the cookie directly, or undef if no such cookie is available. That is what the documentation in https://github.com/PerlDancer/Dancer2/blob/dave/doc-overhaul/lib/Dancer2/Man... describes. I also think it would be best if you ppl fixed this as soon as possible, because it will break compatibility and users will have to edit their code, so the sooner the better (and the fewer people will have to edit their code). Thanks.
On 03/04/2013 12:39 PM, Punter wrote:
The "cookie" keyword right now returns a Dancer2::Core::Cookie object.
I think it would be better if it returned the value (or values in list context) of the cookie directly, or undef if no such cookie is available.
That is what the documentation in https://github.com/PerlDancer/Dancer2/blob/dave/doc-overhaul/lib/Dancer2/Man... describes.
I also think it would be best if you ppl fixed this as soon as possible, because it will break compatibility and users will have to edit their code, so the sooner the better (and the fewer people will have to edit their code).
Why do you think so? I might be better to adjust the documentation accordingly. Regards Racke -- LinuXia Systems => http://www.linuxia.de/ Expert Interchange Consulting and System Administration ICDEVGROUP => http://www.icdevgroup.org/ Interchange Development Team
Well, I like the vastly simpler interface that: my $value = cookie 'name'; ...gives you, instead of having to write each time: my $cookie = cookie 'name'; my $value = $cookie && $cookie->value; Also I think that it would increase Dancer2 adoption, when people see the first way mentioned on the Dancer website. On 03/04/2013 01:58 PM, Stefan Hornburg (Racke) wrote:
On 03/04/2013 12:39 PM, Punter wrote:
The "cookie" keyword right now returns a Dancer2::Core::Cookie object.
I think it would be better if it returned the value (or values in list context) of the cookie directly, or undef if no such cookie is available.
That is what the documentation in https://github.com/PerlDancer/Dancer2/blob/dave/doc-overhaul/lib/Dancer2/Man... describes.
I also think it would be best if you ppl fixed this as soon as possible, because it will break compatibility and users will have to edit their code, so the sooner the better (and the fewer people will have to edit their code).
Why do you think so? I might be better to adjust the documentation accordingly.
Regards Racke
participants (2)
-
Punter -
Stefan Hornburg (Racke)