<div dir="ltr">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.<br><br>But this isn't what Dancer is designed for, and it won't look as pretty as you might expect.<br>
<br><div class="gmail_quote">On Sun, Dec 16, 2012 at 1:12 AM, gvim <span dir="ltr"><<a href="mailto:gvimrc@gmail.com" target="_blank">gvimrc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 15/12/2012 22:28, David Precious wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, 15 Dec 2012 21:29:09 +0000<br>
gvim <<a href="mailto:gvimrc@gmail.com" target="_blank">gvimrc@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I like a lot about Dancer 1 but I don't like the PHP-ish style of<br>
having all the helper kewords/functions in the global namespace.<br>
</blockquote>
<br>
That's Dancer's DSL, and is a fairly core part of what Dancer is. Some<br>
people dislike DSLs, but a lot of people do like and enjoy it, and it<br>
certainly makes for clear and expressive code, no?<br>
<br>
______________________________<u></u>_________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/<u></u>mailman/listinfo/dancer-users</a><br>
<br>
</blockquote>
<br></div></div>
Just realised I may be missing the obvious - if Dancer was object oriented you wouldn't have:<br>
<br>
get '/routename' => sub { };<br>
<br>
... but rather something like:<br>
<br>
my $d = Dancer->new;<br>
$d->get('/routname', $subref);<br>
<br>
gvim<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm" target="_blank">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">http://lists.preshweb.co.uk/<u></u>mailman/listinfo/dancer-users</a><br>
</div></div></blockquote></div><br></div>