Dancer 2's DSL is just sugary syntax over lexical variables. You could create your own Dancer application and Route objects and store them in the application. It will saved lexically. But this isn't what Dancer is designed for, and it won't look as pretty as you might expect. On Sun, Dec 16, 2012 at 1:12 AM, gvim <gvimrc@gmail.com> wrote:
On 15/12/2012 22:28, David Precious wrote:
On Sat, 15 Dec 2012 21:29:09 +0000 gvim <gvimrc@gmail.com> wrote:
I like a lot about Dancer 1 but I don't like the PHP-ish style of
having all the helper kewords/functions in the global namespace.
That's Dancer's DSL, and is a fairly core part of what Dancer is. Some people dislike DSLs, but a lot of people do like and enjoy it, and it certainly makes for clear and expressive code, no?
______________________________**_________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/**mailman/listinfo/dancer-users<http://lists.preshweb.co.uk/mailman/listinfo/dancer-users>
Just realised I may be missing the obvious - if Dancer was object oriented you wouldn't have:
get '/routename' => sub { };
... but rather something like:
my $d = Dancer->new; $d->get('/routname', $subref);
gvim
______________________________**_________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/**mailman/listinfo/dancer-users<http://lists.preshweb.co.uk/mailman/listinfo/dancer-users>