in reply to Using Varibale for HAsh name

Mark Jason Dominus says it better than I can:

Why it's stupid to `use a variable as a variable name' (part 2 , part 3).

Maybe if you debug your code by printing out the things at the various stages, you might find your error. Also consider using Data::Dumper. But I would avoid using a variable as a variable name in the first place.