Why not? you should just give it a try.

database('foo') works under sub doit

Thanks

On Sun, Nov 2, 2014 at 11:04 PM, Jean-Marc Choulet <[email protected]> wrote:
> Hello,
>
> Is it possible to create a no request method in Dancer2 module ?
>
> get qr{/(\d+)/members} => sub {
>     my ($department) = splat;
>     ...
>     my $sth = database('foo')->prepare($queryString);
>     ...
>    # call my method doit();
>     my $data = doit()...
> }
>
> sub doit {
>     # I want to retrieve some data from my database 'foo'
>
>     return $data
> }
>
> Thanks,
>
> Jean-Marc
>
> _______________________________________________
> dancer-users mailing list
> [email protected]
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users



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

Reply via email to