develooper Front page | perl.beginners | Postings from February 2002

Sorting an array of hashes

Thread Next
From:
Tomasi, Chuck
Date:
February 6, 2002 11:17
Subject:
Sorting an array of hashes
Message ID:
28A4235A174FD5118ADB00D0B73E5EFEF015A7@exchange1.admin.plx.plexus.com
Does anyone have any clever ideas for sorting an array of hashes based on
a key such as an ID number?

Example:

@AoH = (
	{ ID => 10101, UserID => 1041, Status => 2 },
        { ID => 10541, UserID => 1211, Status => 1 },
        { ID => 10111, UserID => 1211, Status => 2 },
        { ID => 10721, UserID => 1198, Status => 1 }
);

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About