On Mar 11, 2009, at 3:00 AM, Louis-David Mitterrand wrote:

> On Thu, Mar 05, 2009 at 02:14:51PM -0500, Perrin Harkins wrote:
>> On Tue, Mar 3, 2009 at 10:02 AM, Louis-David Mitterrand
>> <vindex+lists-mason-us...@apartia.org> wrote:
>>> On Tue, Mar 03, 2009 at 06:37:37AM -0800, Jonathan Swartz wrote:
>>>> So, they are constants? I would just make them constants in a site-
>>>> specific module then.
>>>
>>> This is a possibility, however I don't yet use modules on that site.
>>
>> This would be a great time to start.  This is the standard way to do
>> deal with global constants.
>>
>>> To do what you suggest I should define a "PerlModule  
>>> MyApp::MyConstants"
>>> in the site virtual host?
>>
>> Yes.  You could just use it in the components when you need it, but
>> loading during startup makes it use less memory.
>>
>>> And then add constants to that module?
>>
>> Yes.
>>
>>> In the mason code these constants have to be resolved with
>>> $MyApp::MyConstants::my_var, right?
>>
>> You can do that or you can import them.  Check out the Exporter  
>> module
>> in your Perl books.
>
> Typically, where would you place such a module in your filesystem?  
> Let's
> say the apache document root is /var/www/myapp, would you create a
> ./lib/perl/MyApp/Constants.pm off this directory?

I prefer to have everything necessary for a web site - components,  
libraries, scripts, configuration files - under a single directory  
(the "environment root"). That makes it easy to put the entire site  
under version control, migrate it, etc.

Take a look at the way Catalyst sets up a project, or the source of  
the Mason web site (http://www.masonhq.com/?SourceForThisSite), for  
examples.

Jon


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to