On 8/5/2004 5:18 PM, Chris Mortimore wrote:
I want to sort an AoH. Not each hash by its keys, but the array by the
value of one of the keys in each hash.
I know how to sort a simple array.
I know how to sort a hash by the keys.
Could someone kindly point me to the documentation on sorting arrays of
hashes?
`perldoc -q sort`
Ex.
my @AoH = ...
my @sorted = sort { $a->{key} cmp $b->{key} } @AoH;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>