Where to put Settings-Variables?
- From: Bernd Schneider <bernd_schneid@xxxxxx>
- Date: Thu, 30 Mar 2006 16:34:13 +1000
Hello!
I am developing a small web-based application (customer-frontend).
It used to be quite small so that I keeped everything in one file (index.pl). In the head I defined all the variables etc. and that was it.
But now the application is getting a bit more complex with some scripts being only run from the command line and having nothing to do with the web-interface yet still sharing some common library.
So I decided to put some stuff into modules.
The problem that I now come up with is:
Where do I put the variables?
Before I just declared them as:
my $mysql_host = 'localhost';
[...]
Now I have several packages and they in turn use these variables as well.
I now use a self-written script which reads the variables from a textfile. And I put all this into a Module called Settings.pm.
So my call to a setting would be:
$Settings::value{'key'}
e.g.
$Settings::value{'mysql_host'}
But I am not too sure if this is the right way.
Do you have any hints to to deal with these settings properly?
Thanks in advance!
.
- Follow-Ups:
- Re: Where to put Settings-Variables?
- From: Michael Zawrotny
- Re: Where to put Settings-Variables?
- From: Bart Van der Donck
- Re: Where to put Settings-Variables?
- From: jussi . mononen-asdf
- Re: Where to put Settings-Variables?
- Prev by Date: Re: file renamer... request feedback
- Next by Date: FAQ 1.3 Which version of Perl should I use?
- Previous by thread: SSH
- Next by thread: Re: Where to put Settings-Variables?
- Index(es):