Do you know where your variables are? | |
PerlMonks |
Re: question on Hashesby markkawika (Monk) |
on Sep 01, 2009 at 23:01 UTC ( [id://792753]=note: print w/replies, xml ) | Need Help?? |
A hash cannot have two keys. However, you can combine values together to create a single key:
Or you can have a multi-dimensional hash:
But neither of those addresses the issue of collisions; you already stated that many records have the same first name, but can you guarantee that firstname + middlename is unique? Are you sure? Typically in databases of the sort you're describing, the hash key is forced to be unique. Something like an "id number" or something. Then you can store data about the person without worrying about hash collisions. Really, the question is, what do you want to do with the data that you have? Why are you storing it, and what will you do with it after you store it?
In Section
Seekers of Perl Wisdom
|
|