[dancer-users] What path_info() does?

Octavian Rasnita orasnita at gmail.com
Mon Mar 18 17:24:26 GMT 2013


Hi,

Can you please tell me what should do the following line of code?

request->path_info('/login');

I thought that it should set the current path to /login and execute the 
subroutine associated with it, but it doesn't seem to do that or I am not 
doing something right.

I tried:

#!/usr/bin/perl
use Dancer2;

hook before => sub {
    request->path_info('/login');
};

get '/' => sub {
return '/';
};

get '/login' => sub {
return '/login';
};

dance;

When accessing http://localhost/
it displays just / and not /login as I thought that it should do.

--Octavian



More information about the dancer-users mailing list