Hi!

On Mit, Nov 20, 2002 at 12:48:34 -1000, Beau E. Cox wrote:

> May I use PerlSetVar/PerlAddVar statements in the httpd.conf
> file for my own use?

Yes. Thats what they are here for.

> What about namespaces, i.e. how
> do I avoid stepping on someone else's variable?

Prepend some custom string in front of the VarName:

 PerlSetVar MyApp_Var1 value1
 PerlSetVar MyApp_Var2 value2

or, a real-life example out of Apache::AuthDBI
http://search.cpan.org/author/ABH/Apache-DBI-0.89/AuthDBI.pm

 PerlSetVar Auth_DBI_data_source   dbi:driver:dsn
 PerlSetVar Auth_DBI_username      db_username
 PerlSetVar Auth_DBI_password      db_password

> Assume I can. How can I access those variables from my mod_perl
> scripts?

short:
$r->dir_config('MyApp_Var1')

long:
http://perl.apache.org/docs/1.0/guide/config.html#PerlSetVar_and_PerlAddVar

I would suggest that you spend some time RTFM either here:
http://perl.apache.org

and/or read some of those books:
http://perl.apache.org/docs/offsite/books.html


-- 
#!/usr/bin/perl
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Reply via email to