[dancer-users] A problem with the "cookie" keyword

Punter punter at punter.gr
Mon Mar 4 12:10:58 GMT 2013


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/Manual/Keywords.pod 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
>
>


More information about the dancer-users mailing list