in reply to Re: Re: Modifying lines of text
in thread Modifying lines of text

All excellent suggestions, especially DBD::SQLite.

I'd like to make the opposite point - that people don't use RDBMS-like technology nearly enough. There are whole classes of problems that have been solved and their solution is the RDBMS. I may be missing something, but I don't want to implement file-locking just to do line-level locking. That's like saying "No-one can read existing products from the PRODUCT_DEFINITION table because I'm adding new products to it." That's not a reasonable statement. But, that's what file-level locking requires.

RDBMS's may have a larger footprint than a simple file, but that footprint brings with it a lot of benefits. If (and this is a big if) the OP's needs will never go beyond what was requested, then MySQL or DBD::SQLite would be overkill. But, there's something really seductive about having normalization and fast searches at your fingertips. The very fact of that availability drives the mind to enter new spheres and see problems in new lights - very similar to learning about functional programming in Perl. All of a sudden, a lot of problemspaces have solutions that map better, allowing for new features and better capabilities.

That may sound really pie-in-the-sky, but I see it happen on a daily basis everywhere I go. "Oh, you mean I could do XYZ that way?? Wow!" is a statement I hear a lot, solely because I showed them a feature in Excel or provided a 10-line script in Perl.

I may be unique, but for me, realization the data-organization capabilities of an RDBMS was probably the most influential "Aha!" moment of my programming life. It's such a rich solutionspace that 5 years later, I'm still barely ankle-deep into the possibilities.

It may be overkill for this particular problem, but that may be an acceptable tradeoff for the capabilities it provides to solve problems the OP never even classified as problems, because they were intractable.

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.