I would suggest using a database rather than a text file. It will be much faster and more manageable as this grows.
If you are unable to switch this to a database, you still have a very workable alternative. Since you are using formats to print the data to the file, it should be relatively easy for you to convert it into a comma separated file. Then you can use Text::CSV to manipulate CSV fields. You can then read in the file in update mode, change the appropriate data and write it back out.
Better yet, if you cannot use a database, switch it to a CSV file and use DBD::CSV to execute SQL statements against a CSV file. Very handy. Then, if you switch it to a database later on, you should have minimal changes to the code.
Cheers,
Ovid
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.