in reply to Re: DBM keys/values
in thread DBM keys/values

This is my first database and in reality one of the first times of having to play with hashes. I didn't realise you couldn't store more than one value per key in a more basic way, it seems to me there would be a lot of use for it if it were built in so you wouldn't need to join/split.

If your example is implemented would there be a way to choose which value to pull back or would you be stuck pulling both values for @unverified_emails?

Thanks for your help!



"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Replies are listed 'Best First'.
Re[3]: DBM keys/values
by robartes (Priest) on Feb 13, 2003 at 09:21 UTC
    Well, the restriction here is that you're storing stuff in an underlying DBM database, so you're stuck with one value per key. That's why you need to do join/split or whatever tricks.

    Otherwise, one would use a hash of hashes to store this information (as it's easier to search for stuff in a hash, so it makes sense to store the email addresses themselves in hashes as well). You could store something like this in DBM, but they you would be looking at bronto's suggestion of using serialisation techniques to flatten the data structure before storing it.

    CU
    Robartes-