Name: Teodor Zlatanov
e-mail: [EMAIL PROTECTED]
Requested user ID: TEODOR

Description:

I've written a two-way hash module (proposed name: Tie::TwoWayHash)
which will keep a two-way association list in internal hashes.  For
instance, say you have a list of machines, and each machine can belong
to one or more classes.  How do you find out which machines belong to a
given class?  This is basically a two-way mapping between two disjoint
sets.

Usually this is automated through two hashes, and the user keeps track
of them manually.  With Tie::TwoWayHash, the user only needs to add or
delete elements in the first set (giving the list of associated elements
in the second set will automatically vivify them; deleting all the
mappings to an element in the second set will delete it as well).

Add/delete of elements in the second set acts the same way,
automatically vivifying or deleting elements in the first set.

The advantage of doing this through a module:
- less work for the user
- optimized fetch, at the expense of slightly slower store/delete

I am not aware of previous module work in this direction.  Please
contact me with questions or comments.

Thanks
Ted

Reply via email to