Currently I am working on a database for my album collection (mainly CDs and vinyl records). I am storing everything in a rather elaborate hash of hashes. I've got several routines set up right now that will allow me to add a new entry, modify an existing entry and then when I am done dump everything to a file (the file gets read in and populates the hash whenever the script starts.
What I am wondering is if there might not be a better way to do what I am doing, something perhaps more efficient? I've been toying with the idea of playing around with MySQL (since I've got that on my Linux box). Suggestions for things I might look at or try? I'd rather make big changes earlier on, before I spend a lot of time inputting information. Any comments would be appreciated.
Thanks in advance.
neniro
You might want to look at building something with Class::DBI.
Personally, that has solved all of my music database needs (and then some).
Liz
As for wanting to deal with this before inputting data ... that's a straw man. It is the matter of a few minutes to take your old reading routine and your new writing routine and hook them together. Data and algorithms should be dealt with separately.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
Note that no matter what database you decide to use, consider strongly using Perl DBI (Database Independent Interface) as the perl interface to the database. Assuming you decide to go with MySQL, you would
- install MySQL and get it working with the "mysql"
client, and then
- download and install the perl "DBI" module
- read the DBI perldocs by doing "perldoc DBI" at a
command prompt
- download and install DBD::mysql
- read the DBD::mysql perldocs by doing "perldoc DBD::mysql"
at a command prompt
That should get you started.
HTH.
You might consider looking into Maypole -- Simon Cozens framework for web-based, database-driven applications. There's a nice article Rapid Web Applications Development with Maypole and Part Two on perl.com that shows how quickly a simple application (in this case a e-commerce site and shopping cart) can be built.
-xdg
Code posted by xdg on PerlMonks is public domain. It has no warranties, express or implied. Posted code may not have been tested. Use at your own risk.
perlmonks.org content © perlmonks.org and adrianh, bradcathey, dragonchild, hmerrill, liz, neniro, nimdokk, xdg
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03