http://qs321.pair.com?node_id=238240


in reply to Re: Re: best way to change xml record using XML::Simple?
in thread best way to change xml record using XML::Simple?

There's an anti-buzzword backlash against XML floating around, which is a natural reaction to something that's been hyped so much by marketers.

But after all the smoke clears, it's pretty hard to beat the simplicity of using XML::Simple's XMLin() and XMLout() functions.

CSV files combined with while (<IN>) {...} logic has old-school appeal, but in the end, it's irritating and tedious. There's so many exceptions to be handled, like data that splits over lines, or data that contains the delimiter as part of the data, etc, and it's not as flexible as XML when you have to add new variables.

Replies are listed 'Best First'.
Re: xml vs flat files
by seattlejohn (Deacon) on Feb 24, 2003 at 23:18 UTC
    Don't get me wrong: There are lots and lots of things that are appealing about XML; I've used it numerous times to develop production apps, including tools that have to munge XML documents hundreds of thousands of lines long. And I love XML::Simple, because it makes using XML almost as easy as using native Perl data structures via something like Data::Dumper.

    At the same time, though, I think it can be worth pointing out that, like any technology, XML is not necessarily the ideal solution for every problem. XML doesn't permit random access to records (though neither does CSV), it tends to be verbose, and you have to be careful with your document structure. XML::Simple hides most of that tedium, but then the various CSV modules on CPAN also take care of a lot of that for CSV as well.

            $perlmonks{seattlejohn} = 'John Clyman';