Subject: | Interpolation not working ?? |
Date: | Fri, 28 Jul 2006 14:49:58 +0200 |
To: | "bug-Config-General" <bug-Config-General [...] rt.cpan.org> |
From: | "Alexandre Le Meilleur" <alexandre.lemeilleur [...] laposte.net> |
- Distribs : Config-General-2.30/Config-General-2.31
- Perl : v5.8.7 built for i386-linux
- OS : Linux 2.6.12-12mdk #1 Fri Sep 9 18:15:22 CEST 2005 i686
Intel(R) Pentium(R) M processor 1.70GHz unknown GNU/Linux or
Linux 2.6.9-11.ELsmp #1 SMP Fri Jun 10 14:34:37 CEST 2005 i686
i686 i386 GNU/Linux
When trying the Config::General::Interpolated example :
basedir = /opt/ora
user = t_space
sys = unix
<table intern>
instance = INTERN
owner = $user # "t_space"
logdir = $basedir/log # "/opt/ora/log"
sys = macos
<procs>
misc1 = ${sys}_${instance} # macos_INTERN
misc2 = $user # "t_space"
</procs>
</table
I've the following result with Data::Dumper([%conf]) :
$VAR1 = [
{
'sys' => 'unix',
'user' => 't_space',
'table' => {
'intern' => {
'owner' => 't_space',
'procs' => {
'misc2' => 't_space',
'misc1' => 'unix_INTERN'
},
'sys' => 'macos',
'logdir' => '/opt/ora/log',
'instance' => 'INTERN'
}
},
'basedir' => '/opt/ora'
}
];
misc1 should be (as mentionned in the doc) 'macos_INTERN'
(same output with $conf{table}{intern}{procs}{misc1})
What's wrong ???
My script :
#!/usr/bin/perl -w
use strict;
use Config::General;
use Data::Dumper;
print "VER:$Config::General::VERSION\n";
my $conf_base = Config::General->new(
-ConfigFile => 'test.conf',
-InterPolateVars => 1,
);
my %conf = $conf_base->getall;
print "misc1=$conf{table}{intern}{procs}{misc1}\n";
print Data::Dumper::Dumper([%conf]);
# end
Thanks
Cet été, pensez aux cartes postales de laposte.net !