Subject: | Config::General::Interpolated variables overwritten |
Date: | Sat, 20 Sep 2008 16:03:25 -0400 |
To: | bug-Config-General [...] rt.cpan.org |
From: | "Miah Ness" <miah.ness [...] gmail.com> |
I am using Config::General version 2.4 with the InterPolateVars
feature. I notice that sometimes interpolation gives unexpected
results. I could be misunderstanding the interpolation features so
please correct me if I am wrong. I have the follow code example:
#!/usr/bin/env perl
use strict;
use Config::General;
my $cg = new Config::General(
-InterPolateVars => 1,
-String => '
a=value1
<mask>
a=value2
</mask>
b=${a}',
);
my %ch = $cg->getall();
print "Expected 'value1' got '$ch{b}'\n";
The output from the above code is:
Expected 'value1' got 'value2'
I would have expected that variables defined within an inner block are
out of scope in the outer block. Am I misunderstanding interpolation?
Thanks