in reply to Hash key counting
Are you sure that @discounts contains a 1? If not, you'd never be assigning a new key.
Show us a tiny, complete script that demonstrates this problem.