If there's one module that I think really needs to get thrown out of CPAN, it's this one. Why? Well, generally I'm forgiving - don't like a module; don't use it. Problem is - XML::Simple is false advertising - it commonly gets installed because it's "Simple", and that's simply not the case at all.

I see a steady stream of questions - both here and on Stack Overflow - about this module, because someone's been tripped up again by how this module tries to coerce a more complex data structure into a less complicated one.

That's really the root of the problem - just like parsing HTML with regex - the approach is fundamentally flawed.

You can use regex to grab a value out of HTML/XML. It's nasty and brittle, but sometimes a dirty hack is expedient.

And the same is true, I contend, of XML::Simple - it's the 'parsing with a regex' sort of solution. In that it can sort of work, in some scenarios but pretty fundamentally it's a bad solution to the problem at hand.

But were the module called anything else this wouldn't be a problem. There's a lot of stuff in the CPAN namespace that I've never used or installed - that's fine, that's kind of the point.

But many an unwary newbie has been caught out by it - there are a number of "Simple" modules that offer cut down interfaces for a limited subset of operations. LWP::Simple is a good example - it offers a cut down interface to the basic tasks one might need to accomplish with LWP.

This module is official discouraged in it's module doc page but it's still picked up as the "Simple" answer.

Is there precedent for renaming a module in CPAN? I know it's not really an option to just delete it, because there's probably some legacy code depending on it (as much as I think they should be rewriting it, that isn't really my call to make!). But it really does suffer from all the things that have given perl a bit of a bad name in the past - it's a sure road to some rather hacky/nasty code.


In reply to XML::Simple needs to go! by Preceptor

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.