Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Re: best way to change xml record using XML::Simple?by seattlejohn (Deacon) |
on Feb 24, 2003 at 20:33 UTC ( [id://238225]=note: print w/replies, xml ) | Need Help?? |
While I agree with some of your thoughts, I personally try to avoid CSV files because the definition of "CSV" is so elastic in practice. How do you quote or escape field containing commas and quotes? How do you handle trailing empty fields? I've seen a lot of variation in stuff that is ostensibly "CSV", and that always makes me nervous from a long-term maintainability and interoperability standpoint.
That said, I do agree delimited files can make a lot of sense for lightweight data storage. For information that normally wouldn't contain internal whitespace other than "regular" (ASCII 32) spaces -- and this application might qualify -- I often choose tab-delimited. One potential benefit I do see to using XML in this application is that you can easily store data that isn't quite so regular. For example, if you wanted to support multiple contact phone numbers, it would be fairly easy to expand the data structure like this:
Dealing with irregularities like that would be a bit more work in a rigid db-like or non-hierarchical file format. $perlmonks{seattlejohn} = 'John Clyman';
In Section
Seekers of Perl Wisdom
|
|