Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: XML::Simple needs to go!

by Preceptor (Deacon)
on Dec 21, 2015 at 16:19 UTC ( [id://1150866]=note: print w/replies, xml ) Need Help??


in reply to Re: XML::Simple needs to go!
in thread XML::Simple needs to go!

This is where you've lost me. It may be I am misunderstanding XML::Simple - but I'm fairly sure that it's simply not possible to accomplish what XML::Simple is trying to do. XML intrinsically doesn't map to perl data structures.

I have used XML::Simple - admittedly for the sake of troubleshooting, rather than by choice - and can think of very few positive reasons to use it (except maybe 'I have used it before, so I'm more familiar with it'). Can you give me some positive examples?

Replies are listed 'Best First'.
Re^3: XML::Simple needs to go!
by GrandFather (Saint) on Dec 21, 2015 at 19:51 UTC

    From the documentation: "XML::Simple - An API for simple XML files" which is different than "A simple API" and is where much of the issue arises I suspect. XML::Simple is good (I understand) for configuration files where otherwise you might use .INI files or something similar.

    However XML is a bad choice for configuration files anyway. In fact it's a bad choice for most things. JSON and YAML do a much better job in many of the situations where XML has been bent to fit. XML::Simple is fine in its intended role, but that role doesn't match the advertising on the box nor the expectations derived from similar boxes.

    Premature optimization is the root of all job security

      Thing is - I honestly believe that even for simple XML, it's still making more complicated code than the alternatives. We've got XML for all sorts of stuff - like config and API calls - it works well enough, although I would agree that for most, JSON or YAML are better (depending on precise circumstance).

      The root of the problem I think is indeed - that people _don't_ read the doc, they just see "Simple" and install that and start hacking away

Re^3: XML::Simple needs to go!
by Mr. Muskrat (Canon) on Dec 21, 2015 at 20:14 UTC

    As GrandFather has already said, XML::Simple is good at dealing with simple XML and XML configuration files. Most of the XML that I have had to deal with was configuration files. Lots of software is guilty of using XML for this (just Google it).

      But here's my problem - I don't think it is "good" at it. It's merely just about capable of dealing with it.

      I too run into XML in all manner of places - config and API calls primarily. I've also been tripped over by places with annoyingly fussy change control, that inhibit additional module installation.

      Problem is - there are no XML parsers on the core list. In either case, it's an additional install (which granted, may come bundled with an OS perl, thanks to dependencies - of which there are more for XML::Simple I think).

      I have honestly yet to see a scenario where the XML::Simple answer was the 'better' one.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1150866]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found