Skip Menu |

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

Report information
The Basics
Id: 23549
Status: open
Priority: 0/
Queue: Config-Std

People
Owner: Nobody in particular
Requestors: duncan.garland [...] ntlworld.com
Cc:
AdminCc:

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



Subject: Bug in Config::Std
Date: Wed, 22 Nov 2006 15:42:42 -0000
To: <bug-config-std [...] rt.cpan.org>
From: "Duncan Garland" <duncan.garland [...] ntlworld.com>
Hi, Config::Std doesn't put sections into nested hashes. In desperation I copied the exact example from the CPAN documentation: The configuration file: # A simple key (just an identifier)... simple : simple value # A more complex key (with whitespace)... more complex key : more complex value # A new section... [MULTI-WHATEVERS] # A value spread over several lines... multi-line : this is line 1 : this is line 2 : this is line 3 # Several values for the same key... multi-value: this is value 1 multi-value: this is value 2 multi-value: this is value 3 When incorporated into the test script: use Config::Std; use Data::Dumper; read_config( "t2.ini", %c ); print Dumper( %c ) . "\n"; Produces the output: $VAR1 = ''; $VAR2 = { 'more complex key' => 'more complex value', 'simple' => 'simple value' }; $VAR3 = 'MULTI-WHATEVERS'; $VAR4 = { 'multi-value' => [ 'this is value 1', 'this is value 2', 'this is value 3' ], 'multi-line' => 'this is line 1 this is line 2 this is line 3' }; That's not what it says in the documentation! Furthermore $c{MULTI-WHATEVERS}{multi-value} is undefined. I enjoyed reading your book on best practices, but I've spent several hours trying to use this module! Regards Duncan Garland
Subject: Nested Hash in Config::Std
Hello. I have taken on maintenance for Config::Std for Damian, as a Boston.pm project. Sorry for the delay since your report to Damian. If you modify your Dumper call to print Dumper( \%c ) you'll see the nested structure as advertised. It still will not *quite* match the doc, as the hash is actually blessed into Config::Std::Hash, rather than unblessed. And order of hash items is not guaranteed. And the newlines won't re-quote themselves. Ok? Bill BRICKER@cpan.org
Subject: RE: [rt.cpan.org #23549] Nested Hash in Config::Std
Date: Wed, 14 Apr 2010 21:29:20 +0100
To: <bug-Config-Std [...] rt.cpan.org>
From: "Duncan Garland" <duncan.garland [...] ntlworld.com>
Hi Bill, Thanks for looking at this. So %c is a hash reference ie $c or \%c? All the best. Duncan Show quoted text
-----Original Message----- From: William D (Bill) Ricker via RT [mailto:bug-Config-Std@rt.cpan.org] Sent: 08 April 2010 03:20 To: duncan.garland@ntlworld.com Subject: [rt.cpan.org #23549] Nested Hash in Config::Std <URL: https://rt.cpan.org/Ticket/Display.html?id=23549 > Hello. I have taken on maintenance for Config::Std for Damian, as a Boston.pm project. Sorry for the delay since your report to Damian. If you modify your Dumper call to print Dumper( \%c ) you'll see the nested structure as advertised. It still will not *quite* match the doc, as the hash is actually blessed into Config::Std::Hash, rather than unblessed. And order of hash items is not guaranteed. And the newlines won't re-quote themselves. Ok? Bill BRICKER@cpan.org