in reply to Problem with a hash of hashes

I think, bean already got it right.

I have another question. Why do you create an anonymous hash from your hashreference with \%{$locations{$article}} and make areference of it instead of passing the actual reference with $locations{$article}? You don't change the hash in your sub AFAICS, so there is no need to copy the whole hash.