Environment variable maybe ?

# in apache:
SetEnv MYORG_MYV "Some value"

# From perl
$ENV{'MYORG_MYV'}


Jerome.


On Thu, Mar 5, 2009 at 11:39 AM, Jonathan Swartz <swa...@pobox.com> wrote:
>
> On Mar 5, 2009, at 12:49 AM, Louis-David Mitterrand wrote:
>
>> On Tue, Mar 03, 2009 at 03:54:26PM +0100, Louis-David Mitterrand
>> wrote:
>>> On Tue, Mar 03, 2009 at 02:35:42PM +0000, Jérôme Etévé wrote:
>>>> Hi, you can use PerlSetVar directive in your apache config and then
>>>> access variable values with dir_config.
>>>>
>>>> Ex:
>>>>
>>>> in apache:
>>>> PerlSetVar MyAlmightyConstant "heihfi23857278957289"
>>>>
>>>> In your mason code:
>>>> $r->dir_config('MyAlmightyConstant');
>>>>
>>>> This is a mod_perl feature.
>>>
>>> Interesting feature.
>>>
>>> So I could set stuff in the autohandler's <%once> section:
>>>
>>> <%once>
>>> $r->dir_config(adsense_code1=>"bar");
>>> $r->dir_config(other_constant=>"foo");
>>> </%once>
>>
>> Argh! there is no $r in <%once> ...
>>
>> So I have to set them in the apache virtual host, right?
>>
>
> PerlSetVar/dir_config is per-request. So if what you want are
> constants that will keep their value over all requests, I'm not sure
> this is the best thing to use.
>
> Jon
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>



-- 
Jerome Eteve.

Chat with me live at http://www.eteve.net

jer...@eteve.net

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to