Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: use SDBM_File like a database

by bl0rf (Pilgrim)
on Dec 02, 2003 at 23:55 UTC ( #311787=note: print w/replies, xml ) Need Help??

in reply to use SDBM_File like a database

Plankton, although I don't have experience with SDBM_file
after inspecting your code ( and POD ) I'll make a
The SDBM_file works by having a key and a value stored
in a hash - and on file. In insert() you are basically
overwriting the keys REQ,INQFILE etc. with keys that
have the same names but diff values.
I suggest that you do this: $h{uniqval} = $req.
That way your whole reference is the value and
you will have some key which represents it.
The main thing is that your reference should only be the value

Now, the unique hash key concept is completely overkill
and in this case you just need a tied array. I don't
know of any modules that do this ( maybe storable/dumper)
but perhaps $hash{mainkey} = \@array-of-references will work...
I hope I helped!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://311787]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2022-06-27 04:47 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (86 votes). Check out past polls.