in reply to question on Hashes

If I were you, I would consider my data structure to be something like this where I will use the last name then the combination of the first and middle names as my 'keys':
$rec{$last_name} -> { "$first_name . $middle_name" } = [ age, sex, location ];
Ignore the syntax as I have not tested it. Also, I'm not sure if this can be considered as hash of hash of array?

Of course, this does not guarantees that collision of records will not happen.