Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ironcamel (9693)

  (email not shown publicly)
+ -

  Comment: Dancer code could have been more concise (Score 1) on 2010.04.25 2:36

by ironcamel on 2010.04.25 2:36 (#71921)
Attached to: Mojo vs Dancer Week 2 - Templates and Images

I would have put the template configuration in the config.yml configuration file. Or you could just use the default <% and %> start end tags in your templates. It wouldn't be the end of the world. I know that it is a matter of style and personal preference, but with a little white space formatting the dancer version could have been written more concisely like so:

use Dancer;
use Template;
use CPANDB { maxage => 3600 * 24 * 7 };

# Route block
get '/' => sub { template 'index' };


Read More 11 comments
Comments: 11