[Dancer-users] documentation for forward method

GJ gj at freeshell.org
Sat May 26 22:44:41 CEST 2012


Hi all,

I am having trouble with the documentation for "forward" as found at:

If you go to http://search.cpan.org/dist/Dancer/lib/Dancer.pm#forward

In the first place, I am finding that the statement "forward doesn't
parse GET arguments" seems to be untrue.

presuming an HTTP request like:

    'http://localhost/foo?quux=blah'

and some routes like:

----
get '/foo' => sub {
    return forward "/bar", { err => "from foo" };
};

get '/bar' => sub {
    my $f = param "quux";
    return $f;
};
----

Dancer *will* return "blah", which on my interpretation of the documentation
should not be possible.

Secondly and more importantly from my perspective, the documentation does not
explain explicitly how to get at my optional parameters once in /bar (the '{
err => "from foo" }' bit.)

It's not an element of  @_.  Eventually, I figured out that I can use
'request->params->{err}', but this is not explicitly stated, and possibly not the
intended way to do it.

I'm on 1.3095.
 
Thanks
GJ


More information about the Dancer-users mailing list