From: Wizard <wi...@ne...> - 2003-02-19 14:17:57
|
Sorry I took so long to get back. I was pretty tired after 6+ hours of shoveling, so I didn't get back to this. > > I see. I would like to see a get_array method. I admit that this > > separation of concerns is a bit of a thing with me. I just don't like to > > see processing of variables in otherwise unrelated code. It just makes > > life difficult when you want to change something, remembering all the > > places where you split the scalar. > > Me too. Splitting a string into a list of values has nothing to do > with the fact that the string came from a file. I must admit I'm more concerned that this is something likely to break, and when it does, you have to go searching from module to module to module to see what's going on. That I don't like. If it's staring you right in the face at first glance, you'll know where you broke it. I'll add caller context to get() (wantarray), but I REALLY don't like using it for this application. I think it confuses problem resolution for an aspect that I see as potentially problematic in the first place. I'll put it in, but I definitely don't think it's a good idea. I can't tell you how many times I've had to chase errors through hierarchies of modules, only to find it was something simple. > IMO we should be looking to end up somewhere like: > > CGI::NMS::Config > > Defines the get(), is_true() and get_list() methods. Provides > default implementations for is_true() and get_list(), implemented > in terms of get(). > > CGI::NMS::Config::File > > Inherits from CGI::NMS::Config > > Implements new() to read in and parse the file, and get() to > fetch a value. We discussed something like this earlier, and I'll try to get to it at some point, but not this first alpha (This sounds different from what we originally discussed). I really do need to finish something. I'll add the context calling, for now. Perhaps before we release this or in the next version I can go through all of the issues that we've talked about and do clean-up. Grant M. |