Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

xml vs flat files

by waxmop (Beadle)
on Feb 24, 2003 at 21:26 UTC ( #238240=note: print w/replies, xml ) Need Help??

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';

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2023-04-01 05:33 GMT
Find Nodes?
    Voting Booth?

    No recent polls found