I may have missed it so forgive me, but I recommend you check out DBD::CSV. I use it for simple sites that require a csv database for several reasons.
First, it's scalable to a real DB incredibly easily because your code, except for one line in the connection routine is compatible with any DBD::*. So if you upgrade to mysql for example, you just move the data to the db, change how you connect and your code works.
Also, all your DB calls are in SQL, which is fairly standard especially for simple stuff and allows you not to worry about the order of the file or the fields, just make your query.
Finally, the DB can still be edited, uploaded or created by hand and work with your cgi scripts.
Again, I took a fairly quick glance at your code, so forgive me if I missed something, I just thought this might interest you.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.