Hi,

At my projects I always used params hash reference to retrieve request
parameters as follow:

get '/hello/:name' => sub {
    return "Hi there " . params->{name};
};

I started reading Dancer ManuaI again to discover new features whether
I missed and realized that using following ones are safer:

route_parameters->get('name');
query_parameters->get('name');

There is also param('name') method. As a result I see that there are 4 ways:

get '/hello/:name' => sub {
    return "Hi there " . params->{name};
    # or
    return "Hi there " . route_parameters->get('name');
    # or
    return "Hi there " . query_parameters->get('name');
    # or
    return "Hi there " . param('name');

};

Is there any technical difference between these ways that one of them
can work at a special case but others don't?

If there is no difference except being safer (I got this info from
manual), is the reason of this diversity to support  Perl motto
TMTOWTDI?

Which ones are you using at your projects?

Thanks

Kadir Beyazlı
GSM : +90 535 821 50 00
_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to