Click here to get back home

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

 HomeNewsGroups | Search

comp.lang.perl.modules - Discussion about PERL modules 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Tie::FlatFile::Hash : visualize a flatfile database as a hash of arrays Mumia W. 03-07-2009
Posted by Mumia W. on March 7, 2009, 7:35 pm
Please log in for more thread options

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
this:

tie %hash, 'Tie::FlatFile::Hash',
        O_RDWR | O_CREAT, 0644, {
show/hide quoted text
} 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
called.

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?

Similar ThreadsPosted
Module namespace: Tie::Flatfile::Array February 25, 2007, 11:55 pm
Modules for hash functions? (ie, common algorithms for computing hash keys, not manipulating perl hashes) August 26, 2006, 7:08 pm
Hash July 14, 2006, 5:27 pm
Is a hash the best method to do this? December 24, 2007, 1:23 pm
What can you use to tie a hash of hashes to either dbm or ascii? December 2, 2007, 12:26 pm
Options for passing Hash to a subroutine. March 30, 2005, 7:39 pm
Namespace for a searching a hash by key name module? April 16, 2009, 1:22 pm
Announce: Set::Array, Set::Hash, Set::String - new maintainer January 8, 2005, 10:04 am
Bug with hash time & multilines in Config::IniFiles v2.38 ? January 26, 2005, 9:53 am
Sorting Hash of Hashes with HEAP module March 17, 2005, 2:56 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy