[Dancer-users] A cleaner config?

Alexis Sukrieh sukria at sukria.net
Tue Mar 20 21:41:21 CET 2012


Hi Ovid and thanks for your input.

Le 20 mars 2012 12:21, Ovid <curtis_ovid_poe at yahoo.com> a écrit :
[...]
> Basically, the config hash becomes a read-only collection of objects and if
> you misspell a hash key (method name), you get a sensible error message and
> a list of the available methods.
>
> Obviously this only works if the config can be represented as a hashref. If
> you have config keys which cannot be methods, such as "--foo" or something,
> you can still reach inside the object $config->{"--foo"}. Note that chaining
> hash keys works, too ($config->auth->password).
>
> Would this be a reasonable feature for Dancer's config? If an only if the
> top level config is a hashref, it's blessed as a "Dancer::Config::Object".
> It should be transparent for the end-user, yes?

Looks to be a very handy feature to have, indeed.

Maybe we should provide that if the user's config request it? Like set
strict_config => 1;


More information about the Dancer-users mailing list