in reply to Coerce array into hash problem

The value in the incredibly poorly named $AoH{ data } (if anything by the actual type and contents it's an HoA, but I digress) is an array reference not a hash reference, yet you're trying to treat it as a hash ref. You need to take three steps back and rethink your data structure and how you're going to lay things out (Data::Dumper and/or YAML::Syck can be illuminating figuring out what you've really got).

The cake is a lie.
The cake is a lie.
The cake is a lie.