in reply to copying array from a hash reference
You will save yourself a lot of grief by putting use strict; use warnings; at the top of your script and then fixing the errors.
What output are you expecting?