I thought about putting constants in $c->config, but decided not to
mostly because it would allow a malicious (or ignorant) user to
completely screw up my app. A constant should be, uh... constant!
I have been resisting learning YAML, mostly because I am learning so
many new things right now that I don't want to add one more thing to the
list... but I know I will have to dig in eventually.
jarom smith
tech go-to guy
Alejandro Imass wrote:
Although I think there is no best practice as such, I mean there are
many ways to do this in Perl in general, but Catalyst offers the nice
feature of the main config file in YAML, so I keep all my constants
and configuration values there.
YAML is so powerful that IMHO it's the best place not ony to store
your constants but to structure them intelligently. Of course, all the
constants you put in your YAML file will be vailable through
$c->config->{foo}
Best,
Alejandro Imass
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/