in reply to Problem with dbm hash?!!

Who says? It probably depends on the problem space, but I'm not personally aware of any problems with using DBM Hashes. If you want to store really huge perl structures consider DBM::Deep -- it's neat, but not really related to DBM as far as I know.

Also, I just realized I was thinking DB_File hashes, which I use from time to time. Did you mean something else?

UPDATE: nearly the same thing. In fact, for all we know, dbmopen may just use DB_File... see: AnyDBM_File. Regardless, I think those are just fine for smaller apps. For apps with a lot of concurrency or application interactions, maybe a real database is better. It depends. Few solutions are right for all problems. That's part of the reason there's more than one way to do it.

-Paul

Replies are listed 'Best First'.
Re^2: Problem with dbm hash?!!
by nagalenoj (Friar) on May 06, 2009 at 13:33 UTC

    Thanks for you reply. Actually, I have not used DB_File.

    I use dbmopen(), dbmclose() like follows,

    #!/usr/bin/perl use strict; use warnings; my %hash; # To open a dbmfile and associate with hash dbmopen(%hash, "nagalenoj", '0666') || die "Can't open database file!" +; $hash{'one'}="1"; $hash{'two'}="2"; $hash{'three'}="3"; #Retrieving values print $hash{'three'}; dbmclose %hash;