that it seems a bit odd that your two variables don't have the same data structure.
is an array ref (a reference to an array of hashes of hashes), but there is no obvious reason in the data that you show to have an array as the top data structure. Is this data structure generated by your program at some earlier point? The proper fix would probably be to correct the part of the program that generates
, but you don't show that part.