[Perl] Re: DBM file problems

nisanov nisanov at netvision.net.il
Mon Aug 13 16:54:25 PDT 2001


Hi,

Saving multidimensional hash or array in DBM file is not so easy.
Multidimensional means that in first dimension array or hash
you save references to second dimension array, but the reference
value is relevant only for current name space, i.e. for current
process, these references that you will save in DBM has no mean
to other processes.
Using DBM suitable for simple array or hash, but use it
for more complicated data structures is really ...,
you know what, with that idea you just waste your time ( I think so ). 

Pini



nothingmuch wrote:
> 
> I'm experiencing problems with a DBM hash.
> it's a three dimentional hash of a hash of a list.
> I have a cataloging subroutine, and a searching one. When both are
> called all is fine, it works perfect.
> the cataloger indexes the files i want it to, and saves to the 3
> dimentional hash, in the DBM file, and the searcher reads.
> However, when only the search subroutine is called, it returns no found
> value.
> I made the search array print all of the catalog files keys and values,
> and it turns out all of the second dimentions are empty... inexistant.
> I thought maybe the hashes tied to the dbms were appearantly sharing,
> so i made sure all the names were different, but it kept on working
> when both the catalogger and the searcher worked at on the same program.
> i'm really clueless.
> i'm guessing it either has something to do with the saving (which is
> peculier, because another 1 dimentional hash worked ok) or with the
> fact that the hash i'm trying to save is 3 dimentional.
> I could store it as a one dimentional hash, but that would be hell, so
> i'd like to try here before i go an and code that.
> -
> to unsubscribe from israel-pm-list, do:
> echo "unsubscribe israel-pm-list" | mail majordomo at hfb.pm.org



More information about the Perl mailing list