If you are unable or unwilling to use a database for this application, here's my suggestion: Create a subroutine that takes the hash key as a parameter and returns a hash or hashref of the key's value. Then
Memoize the sub, if the values are not changed during processing.
---
It's all fine and dandy until someone has to look at the code.