Tie::FlatFile::Hash : visualize a flatfile database as a hash of arrays

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm planning to create a module named Tie::FlatFile::Hash. The module
will allow the programmer to create and access flatfile databases where
it is desired to make the database look like a hash (of arrays). The
format of the database will be user-defined. The module should work like

tie %hash, 'Tie::FlatFile::Hash',
    O_RDWR | O_CREAT, 0644, {
    packformat => 'A30A13N',
    key => 0,
} or die("...");

The "packformat" option specifies that each record will contain three
fields, a thirty-character field, a thirteen-character field, and a
number. The "key" option tells the module that the first field (item 0)
will contain the virtual hash keys. So a record might contain a name (30
chars), phone number (13 chars), and a count of times that number has

Assigning to the hash would create a record in the database. The
following code,

$hash{"John Malcolm"} = ['1718-555-0103', 26];

would create this in the database:

John Malcolm                  1718-555-0103^@^@^@^Z

Tie::FlatFile::Hash would complement my Tie::FlatFile::Array. I haven't
yet decided if the former will use the latter behind the scenes. Is this
a good module idea? It the namespace proper?

Site Timeline