|
Posted by Yves Martin on January 26, 2005, 9:53 am
Please log in for more thread options
Hello,
I have written a code using a Config::IniFiles object tied to a hash and it
was working well on my dev machine with revision 2.27 of the module.
When deploying my code on a machine with revision 2.38 - the multiline value
are not returned correctly according to the way I understand the
documentation. So I wrote the following test case:
#!/usr/bin/perl -w
use strict;
use Config::IniFiles;
my $configFile = "conf.ini";
show/hide quoted text
open(CONF, ">" . $configFile);
print CONF <<EOF;
[Test]
multiline=<<EOT
multi/value1
multi/value2
EOT
singleline=4590
EOF
close(CONF);
my $expectedMulti = "multi/value1nmulti/value2";
show/hide quoted text
my $configNew = new Config::IniFiles(-file => $configFile);
show/hide quoted text
my $resultNew = $configNew->val('Test','multiline');
if ($expectedMulti ne $resultNew) {
print "NEW: Result ' ", $resultNew, "' differs from expected '",
$expectedMulti, "'n";
}
my %configTie;
show/hide quoted text
tie %configTie, 'Config::IniFiles', (-file => $configFile);
my $resultTie = $configTie;
if ($expectedMulti ne $resultTie) {
print "TIE: Result '", $resultTie, "' differs from expected '",
$expectedMulti, "'n";
}
Is it really a bug ? Or I misunderstood the documentation ?
Regards
--
Yves Martin
|