Since you've shown how to use a hash, and you know how to iterate over it (which you're doing in the loop you seem to be asking about), I'm a bit confused. What is it you are asking? The technique of the obvious answer you've mastered (as you're showing it), so it must be something that you want.
Perhaps I don't know what re-referencing it in a scalable dynamic way is?