Yes of course, makes sense. Besides constants should "use constant" also. Nevertheless, it is quite common to confuse/abuse constants with 'configuration constants' which should go perfectly in your main yaml config file. My bad for not clarifying this.
On Fri, Jun 5, 2009 at 11:44 AM, Lance A. Brown <[email protected]> wrote: > 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} > > I wouldn't put these constants in the applications main configuration > file unless the constants are for the application. Jarom's example > indicates the constants have to do with data coming from a model so I'd > put them in a package in the model's namespace. That way MVC separation > is maintained *and* you have access to the constants outside the > catalyst app if needed. > > --[Lance] > > > -- > GPG Fingerprint: 409B A409 A38D 92BF 15D9 6EEE 9A82 F2AC 69AC 07B9 > CACert.org Assurer > > _______________________________________________ > List: [email protected] > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/[email protected]/ > Dev site: http://dev.catalyst.perl.org/ > _______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
