Personally i think Roger's idea on the hash (with empty value) not quite efficient (but his code looks good, though :) ). I prefer the previous approach (reptile)
Originally posted as a Categorized Answer.
Comment on Re: Can a hash name have the same value twice.