in reply to How to sort by the key value of an Array of Hash structure?

Remember that $a and $b are the array items that are being sorted, in your case hash references.

So you need to access the size key if you want to sort by it: @newarray = sort { $b->{size} <=> $a->{size} @array;

If you want to see your data structures, I recommend Data::Dumper.