On Tue, 10 Sep 2013 16:05:47 +0200
Hugues Max <[email protected]> wrote:

> Please see my hook ( here numclient = 366 )
> 
> 
> hook 'before' => sub {
>       var numclient => session 'numclient';
>      debug "session numclient ". session 'numclient';;
>      debug "vars in hook ".vars->{'numclient'};
> };
> 
> debug "vars out hook" . vars->{'numclient'};

vars only exists within a request.  Using it outside of a request (i.e.
not in a route handler or suitable hook) is meaningless.

Try e.g.

  hook before => sub {
      var pathxls =>  config->{'PATHXLS'} . session 'numclient';
  };

  get '/outils' => sub {
      # you can use vars->{pathxls} in your route handler, e.g.
      my $pathxls = vars->{pathxls};
  };



-- 
David Precious ("bigpresh") <[email protected]>
http://www.preshweb.co.uk/     www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedin    www.preshweb.co.uk/facebook
www.preshweb.co.uk/cpan        www.preshweb.co.uk/github


_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to