Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

(jeffa) 3Re: Writing Out XML using XML::Simple

by jeffa (Bishop)
on Apr 07, 2003 at 14:59 UTC ( #248627=note: print w/replies, xml ) Need Help??

in reply to Re: (jeffa) Re: Writing Out XML using XML::Simple
in thread Writing Out XML using XML::Simple

You are most welcome. :)

Now, is there any real compelling reason to store this info in an XML file? I really don't see one. In the past, i have used XML as a storage medium, but that was for my ease, no one else was using my code.

If your users need to be able to change the data, then i think you are in for a minor headache if you choose XML. I highly recommend you use an relational database instead. Why not start with DBD::SQLite? It takes care of concurrency issues for, you have to write the code to do that yourself if you use a text file. Also, by using SQLite (or mysql, or Postgres, etc.), you can always convert your data to XML with tools like XML::Generator::DBI.

Of course, if you don't already know SQL, you will have to spend some time learning it ... but it is time well spent, SQL can take you a looong way. ;) Good luck!


(the triplet paradiddle with high-hat)
  • Comment on (jeffa) 3Re: Writing Out XML using XML::Simple

Replies are listed 'Best First'.
Re: (jeffa) 3Re: Writing Out XML using XML::Simple
by CodeJunkie (Monk) on Apr 08, 2003 at 10:44 UTC

    Ok thanks for the advice again. I'm really just using XML files because I thought it would be cool and i'm fed up with using CSV files. I also want to learn something new and I thought this was a good reason to try. I do know all about SQL, i.e. linking Perl to MySQL, but I really don't want to have to rely on a separate RDBMS.

    This SQLite thing looks pretty cool I will have a look at it. I'm not sure if I mentioned it before, but this is all part of my auction software. At the moment i'm storing everything in CSV files, it works fine, but i've been thinking about upgrading to a RDBMS like MySQL, but just haven't got around to it yet, perhaps i'll give SQLite a go instead.


Re: (jeffa) 3Re: Writing Out XML using XML::Simple
by CodeJunkie (Monk) on Apr 08, 2003 at 11:22 UTC

    Ok i've looked at SQLite and even after looking at the man page, i'm not sure how to install it... i've downloaded the package and it'd full of foo.c and foo.h files. I'm not sure what they are all about I'm also working on Activestate Win32 Perl so makes things more complicated. Do I just need to put the file in my lib/DBD folder?

    Ive tried using PPM (Perl Package Manager that comes with Activestate perl) but it can't find sqlite.

    Any ideas....?


    UPDATE - Sorry just noticed the main site address so i'll check that out first!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2020-07-02 11:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found