On 2012-05-01 06:43, Manfred Lotz wrote:
On Tue, 1 May 2012 05:57:28 -0700
Michael Rasmussen <mich...@jamhome.us> wrote:
On Tue, May 01, 2012 at 11:58:46AM +0200, Manfred Lotz wrote:
> Hi there,
> What is a recommended Module for processing config resp. inifile
> formats?
>
> One important feature I need is to use previously defined entries.
Config::Std uses the .INI format and will preserve your comments in
addition to your previously defined entries. I've found it to be a
very easy to use module.
I started trying out Config::Std which indeed is easy to use but
didn't
get previously defined vars to work.
I tried this but to no avail.
[Dirs]
basedir : /data/
aroot : ${basedir}/root
broot : $basedir/root
The config file is static and does not interpret itself.
To do what I think you're after would require:
The ini file:
[Dirs]
basedir : /data/
The Perl program bit to use it:
read_config 'name_of_config.ini' => my %config;
$aroot = $config{Dirs}{basedir} . "root";
--
Michael Rasmussen
http://www.jamhome.us/
Be Appropriate && Follow Your Curiosity
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/