jeorgen writes:
A starting point would be to make a perl equivalent or
mini-equivalent of ZODB, the object persistence engine, which is
really just one big file and an index file.
The CPAN has several
distributions that handle persistent objects. I'm not familiar
with ZODB, so I can't say which would be most appropriate.
On the home-grown side of things, I have a DB_File wrapper that uses
DB_BTREE to provide multiple keys for a DB_RECNO list of records.
It's old, pre-Storable code, though, so I haven't been eager to show
it off. It's also incomplete: It doesn't support dropping keys or
tables, it doesn't handle adding keys to a table with existing
records, and it doesn't have undelete or pack.
Speaking of pack, I also have part of a paged b-tree database driver
that makes extensive use of pack() and unpack(). It was inspired by
the note at the end of the pack() description in the first edition
Programming Perl:
Note that, although all of our examples use literal
strings as templates, there is no reason you couldn't pull in your
templates from a disk file. You could, in fact, build an entire
relational database system around this function.
They're right, but it's not as easy as that casual remark would make
it seem. As key pages fill up, they must be split into smaller ones.
That was just too much for me, and that's where the project sits
today.
These remind me of yet another project idea: A web catalog of all the
little bits of code I've accumulated over time. I have a lot of
half-baked ideas (see above), test cases, benchmark programs, and code
doodles. Currently they're rotting in a directory without an index or
any way for the rest of the world to see.
If there's any one idea that could save the world, that last one would
be it. I think there are a lot of good ideas rotting on coders'
drives. A system to publish them would connect that stuff with the
people who have the inspiration and time to develop it.
-- Rocco Caputo - troc@pobox.com - poe.perl.org
|