in reply to sorting an array of hashes by values but ...

That seems mostly like the way to do it. Here are some minor improvements:

sub SortArrayOfHashes { my $av= shift; my @sum= map { my $sum = 0; $sum += $_ foreach values %$_; $sum; } @$av; my @idx= sort { $sum[$a] <=> $sum[$b] } 0..$#sum; return @{$av}[@idx]; }

You could also do a Schwartzian Transform, but that would make it slower (though a bit spiffier).

Note that my version avoids copying the values so it might be possible to modify elements of the original array by modifying elements of the sorted array.

        - tye (but my friends call me "Tye")