Skip Menu |

This queue is for tickets about the Config-General CPAN distribution.

Report information
The Basics
Id: 35766
Status: resolved
Priority: 0/
Queue: Config-General

People
Owner: tlinden [...] cpan.org
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.38
Fixed in: (no value)



Subject: InterpolateVars interpolates into single quoted strings
The documentation in Config::General::Interpolated states: Variables inside double quotes will be interpolated, but variables inside single quotes will not interpolated. This is the same behavior as you know of perl itself. However, I haven't been able to get that to work. Here's some example code and its output: % cat bug.pl use Config::General qw( ParseConfig ); use Data::Dumper; my $config = q/ foo = 1 goo = '$foo' /; print Dumper { ParseConfig( -String => $config, -InterPolateVars => 1,) }; % perl bug.pl $VAR1 = { 'goo' => '\'1\'', 'foo' => '1' }; % I expected goo to be equal to the string $foo and for the single quotes to be removed. Thanks, Diab
A little counter-intuitively, it seems that escaping the $ with BackslashEscape => 0 avoids interpolation, but the escape character is retained as part of the value, e.g. the following configuration entry foo = 1 goo = \$foo results in an entry of { 'goo' => '\\$foo', 'foo' => '1' }; while escaping it with BackslashEscape => 1 results in it *not* being escaped: { 'goo' => '1', 'foo' => '1' };
fixed in 2.39.