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.
In reply to Re: How to sort by the key value of an Array of Hash structure?
by moritz
in thread How to sort by the key value of an Array of Hash structure?
by Jordy224
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |