in reply to Re: Practical suggestion for accessing configuration data stored in XML format
in thread Practical suggestion for accessing configuration data stored in XML format

I'm not going to preach that my idea is the only solution, and everybody should use it. I'm sure most people would prefer XML::Simple (which is a good module, but using it can be a bit annoying) or XML::Twig (which is great, and many thanks for it!).

The replies that I'm getting for my post is exactly the feedback that I wanted to get - in order to see if there is a need for a module like mine.

However, I do want to note that the problem I wanted to solve was not loading XML file, but quickly accessing the loaded data. With XML::Simple you have to constantly think about the actual data representation in memory (speaking from experience). And the moment you start using 'forcearray' all the initial easiness disappears. From that point on you have to assume that each element is wrapped by an anon. array. (IMHO) Person using module for reading configuration files should not need to think too much about underling data structures or XML.

I just think that it should be both possible and easy to access parameters in the XML configuration file using just a single line of code. Afterall, it's perl we are talking about ;)

P.S.: I gave that ugly example intentionally to demonstrate that using method access, you can get get ether just the first element or all of them. This is exactly what XML::Simple lacks.

  • Comment on Re: Re: Practical suggestion for accessing configuration data stored in XML format