in reply to XML for databases?!?! Is it just me or is the rest of the world nutz?
- Tied hashes between two systems (e.g. my hosted website and my local mirror) can be incompatible, depending on the db engines employed.
- Tied hashes normally encompass only one level. Hashes containing arrays and other hashes can be cumbersome to implement.
What I was hoping to achieve was a portable, readable file capable of containing a complex Perl data structure, that I could slurp into memory, manipulate, and write back out.
XML::Simple is the putative answer to these goals. It was pretty simple, but not brain-dead simple. Some of the arrays embedded in my hash have only one element. Apparently XML, by itself, is unable to distinguish between a single-element array and a scalar, so there is no a priori one-to-one correspondence between plain XML and a Perl data structure. XML::Simple gives you a way to force certain elements to be arrays when the XML file is read, but this amount of finagling was contrary to my objectives.
Would I use XML again? Probably not as a general-purpose embodiment of a Perl data structure. For that, I would look around for another format, another module -- or write my own. But my mind is still open for other applications. With this much smoke and heat, there's gotta be a fire somewhere!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: XML for databases?!?! Is it just me or is the rest of the world nutz?
by mt2k (Hermit) on May 25, 2002 at 22:12 UTC |