develooper Front page | perl.beginners | Postings from May 2012

Re: Recommended config/ini file module?

Thread Previous | Thread Next
From:
Manfred Lotz
Date:
May 4, 2012 04:08
Subject:
Re: Recommended config/ini file module?
Message ID:
20120504125849.510b2655@arcor.com
On Tue, 01 May 2012 08:38:01 -0700
Michael Rasmussen <michael@jamhome.us> wrote:

> On 2012-05-01 06:43, Manfred Lotz wrote:
> > On Tue, 1 May 2012 05:57:28 -0700
> > Michael Rasmussen <michael@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";
> 
> 

Ok, so I'll stick to Config::General which does nicely what I want.


-- 
Thanks,
Manfred
 




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About