Skip Menu |

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

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

People
Owner: BRICKER [...] cpan.org
Requestors: cloink_friggson [...] ntlworld.com
Cc:
AdminCc:

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



Subject: Config::Std feature request.
Date: Fri, 16 Oct 2009 8:59:01 +0100
To: bug-config-std [...] rt.cpan.org
From: Cloink <cloink_friggson [...] ntlworld.com>
Hi Damian, I'm not brilliant at perl, but getting better. Maybe what I'm going to ask is impossible due to the nature of how perl hashes are implemented, but. In looping round all the entries in a section (once the conf file has been read in), I would like the original sequencing in the conf file to be preserved. Is this possible? Maybe it already is, and I just don't know enough. I note in your book that you say when writing a conf file back out, the sequencing is preserved, and I am a little miffed that the same doesn't appear to be true with the in-memory representation! Thanks, Clark Pearson. mailto:Cloink_Friggson@ntlworld.com
Subject: Re: [rt.cpan.org #50555] Config::Std feature request.
Date: Sat, 17 Oct 2009 11:19:58 +1100
To: bug-Config-Std [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Hi Clark, Show quoted text
> In looping round all the entries in a section (once the conf file has > been read in), I would like the original sequencing in the conf file > to be preserved. Is this possible? Maybe it already is, and I just > don't know enough.
The module certainly doesn't do that at present. It would be possible to have it do so, but at the cost of making every access to the internal hash vastly slower. Perhaps there could be a drop-in replacement module (Config::Std::Ordered) that provided this functionality, at the cost of being 10 times slower. Or perhaps it would be enough to provide a helper function, so you could write: use Config::Std qw< ordered_keys >; for my $key ( ordered_keys(%config) ) I'll put it on the ToDo list, but don't hold your breath...I'm currently so overcommitted that I have no time to work on any of my CPAN modules in the foreseeable future. :-( All the best, Damian
Subject: Re: [rt.cpan.org #50555] Config::Std feature request.
Date: Fri, 23 Oct 2009 12:53:02 +0100
To: bug-Config-Std [...] rt.cpan.org
From: Cloink <cloink_friggson [...] ntlworld.com>
Thanks for replying Damian. Sorry for the delay... I've started this reply a few times, and then thought, just another look at the code. I've spent a lot of time getting to grips with Config/Std.pm and now think I understand it well enough that I could implement something myself - I've had to suss OO-perl along the way too! (I'm not an OO programmer, but I am au fait with OO principles.) So - all in all - it's been a good episode. But, surprise surprise, I've now gone and re-jigged the way I'm constructing my conf file for completely different reasons and no longer want an 'in sequence' method. I still reckon an 'in sequence' method would be a good addition though, so I think you should leave it on your to-do list...! Would you have any recommendations on Perl books? I already have yours, and I have the Perl in a Nutshell O'Reilly book, but I hate the latter as it makes too many assumptions - I don't come from a unix background, though I've become a lot more confident in unix shellscripting of late, with more exposure at my work. This has probably helped me get into the perl mindset better too. Basically, I'm looking for a Perl reference book that explains things in English, like yours, instead of in geek-speak that makes me cry. Btw, my very first exposure to Perl I had recommended Mr Wall's O'Reilly Camel book - please don't recommend anything by Larry Wall... Any suggestions much appreciated. Cheers, Clark. ---- "damian@conway.org via RT" <bug-Config-Std@rt.cpan.org> wrote: ============= <URL: https://rt.cpan.org/Ticket/Display.html?id=50555 > Hi Clark, Show quoted text
> In looping round all the entries in a section (once the conf file has > been read in), I would like the original sequencing in the conf file > to be preserved. Is this possible? Maybe it already is, and I just > don't know enough.
The module certainly doesn't do that at present. It would be possible to have it do so, but at the cost of making every access to the internal hash vastly slower. Perhaps there could be a drop-in replacement module (Config::Std::Ordered) that provided this functionality, at the cost of being 10 times slower. Or perhaps it would be enough to provide a helper function, so you could write: use Config::Std qw< ordered_keys >; for my $key ( ordered_keys(%config) ) I'll put it on the ToDo list, but don't hold your breath...I'm currently so overcommitted that I have no time to work on any of my CPAN modules in the foreseeable future. :-( All the best, Damian
Subject: Re: [rt.cpan.org #50555] Config::Std feature request.
Date: Sat, 24 Oct 2009 06:11:26 +1100
To: bug-Config-Std [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> I still reckon an 'in sequence' method would be a good addition though, so I think you should leave it on your to-do list...!
I have. Thanks for the feedback. Show quoted text
> Would you have any recommendations on Perl books?
I'm afraid that's off-topic for this channel. Contact me at damian@conway.org or, better still, post to www.perlmonks.org and get a wider sampling of the community consensus on Perl books. All the best, Damian