Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl-Sensitive Sunglasses
 
PerlMonks  

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.


Comment on xml vs flat files
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (11)
As of 2014-04-23 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (556 votes), past polls