17 Eyl 2015 18:31 tarihinde "Richard Reina" <gatorreina@gmail.com> yazdı:
>
> 2015-09-17 9:06 GMT-05:00 Andrew Solomon <andrew@geekuni.com>:
>>
>> That looks reasonably sane to me apart from:
>> my $input_hash {
>>
>> token => params->{token}
>>
>> }
>>
>> which should be
>> my $input_hash = {
>>
>> token => params->{token}
>>
>> };
>>
>>
> Hi Andrew,
>
> That piece of code is the part that is giving me trouble.
>
> I have switched to using a scalar as since there is only one element that I seek to capture (the usrl/token) and because using a hash wasn't working either.
>
> Here is where I am:
>
> get '/reset/:token' => sub {
>
> my $incoming_token;
>
> return template 'passreset' => {
>
> $incoming_token = params->{token}, # LINE 554
>
> };
You dont need define variable here. Also you should use "=>" instead of "=" as follow.
incoming_token => params->{token}
>
> # get stored tokens to match against $incoming_token
> my ($matched_user_id) = User->lookup_tokens($input_hash->{token});
>
> But the it fails and the input at the console says:
>
> [MyApp:25074] core @2015-09-17 10:21:52> Entering hook core.app.before_request in (eval 77) l. 1
> Odd number of elements in anonymous hash at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 554.
>
> I am just trying to capture the value of the url so I can test if it matches the stored token. Help would be greeeaaaaaaatly appreciated as this s very frustrating.
>
> Thanks
>
> _______________________________________________
> dancer-users mailing list
> dancer-users@dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>