Click here to get back home

Bug with hash time & multilines in Config::IniFiles v2.38 ?

 HomeNewsGroups | Search

comp.lang.perl.modules - Discussion about PERL modules 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Bug with hash time & multilines in Config::IniFiles v2.38 ? Yves Martin 01-26-2005
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
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

show/hide quoted text
if ($expectedMulti ne $resultNew) {
print "NEW: Result ' ", $resultNew, "' differs from expected '",
$expectedMulti, "'n";
}


my %configTie;
show/hide quoted text

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


Posted by Thomas Kratz on January 26, 2005, 12:23 pm
Please log in for more thread options
Yves Martin wrote:
show/hide quoted text

[code snipped]

You are right. Looking at IniFiles.pm you will find the following entry in
the revision history:

Revision 2.28 2002/07/04 03:56:05 grail
Changes for resolving bug 447532 - _section::FETCH should return
array ref for multiline values.

So you'll get a reference to an array holding the values since 2.28. It
seems they forgot to change the pod as well as the code :-(

You could file a bug report at:

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Config-IniFiles

Thomas


--
show/hide quoted text
Similar ThreadsPosted
[ANNOUNCE] Config::Model - Framework for semantic validation of config data March 20, 2006, 10:07 am
Modules for hash functions? (ie, common algorithms for computing hash keys, not manipulating perl hashes) August 26, 2006, 7:08 pm
Tie::FlatFile::Hash : visualize a flatfile database as a hash of arrays March 7, 2009, 7:35 pm
Overriding $Config? November 4, 2005, 4:50 pm
ANNOUNCE: Config::Scoped August 3, 2004, 12:35 pm
New release of Config-Model July 24, 2006, 8:20 am
New release of Config::Model v 0.612 August 4, 2007, 11:43 am
New version of Config::Model (v0.615) November 16, 2007, 7:43 am
Config::Any fails tests on install February 24, 2007, 2:49 pm
Installing Config::General Failed October 22, 2007, 12:22 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy