[dancer-users] Rewrite a vale in session

Maxwell Carey mcarey at ucar.edu
Mon Aug 11 17:12:01 BST 2014


I'm not sure you can do this in Dancer1 without an intermediate variable,
e.g.

my $session = session 'customer';
$session->{lang} = 'gibberish';
session 'customer' => $session;

In Dancer2, you can do

session('customer')->{lang} = 'newspeak';

and it appears to work. (note the use of the assignment operator instead of
the fat comma).


On Mon, Aug 11, 2014 at 4:14 AM, fabioniguel3 at gmail.com <
fabioniguel3 at gmail.com> wrote:

> guys, i have stored a session like this:
>
>     $customer->{id} = $result->[0]->{id};
>     $customer->{name} = decode("utf-8", $result->[0]->{name});
>     $customer->{email} = $result->[0]->{email};
>     $customer->{points} = $result->[0]->{points};
>     $customer->{lang} = $result->[0]->{lang};
>     session  customer => $customer;
>
> Later i will need to change the lang value.
>
> How do i change it?
>
> i've tryed
>  session ("customer")->{lang} => 'other_value';
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20140811/acc9d744/attachment.html>


More information about the dancer-users mailing list