Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found