Have you even tried this code? Have you read up on how hashes work? This is sounding very much like you have a vague idea of what you want to do and are trying to get the people on perlmonks to figure out your implementation for you. That's why I --'ed you, by the way. Do your own legwork, then come here when you cannot figure out on your own what's going on. That means
you've gone through the Camel book and tried different iterations on your own.