mhearse has asked for the wisdom of the Perl Monks concerning the following question:
I need to sort this by the values store in count. Is there a way to sort hash references? Or another way to build this data structure, so that sorting can be performed? The hash refernece has many values, which could be considered user attributes. To iterated over them properly, it must be sorted by the key count. Would it be better to have:$users{$value}->{count}
Thanks.$users[3]->{count}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting data structure
by davido (Cardinal) on Oct 14, 2005 at 03:02 UTC | |
by leriksen (Curate) on Oct 14, 2005 at 04:09 UTC | |
|
Re: Sorting data structure
by ioannis (Abbot) on Oct 14, 2005 at 05:11 UTC | |
by davido (Cardinal) on Oct 14, 2005 at 05:52 UTC | |
| |
|
Re: Sorting data structure
by tphyahoo (Vicar) on Oct 14, 2005 at 09:51 UTC | |
|
Re: Sorting data structure
by mhearse (Chaplain) on Oct 14, 2005 at 14:57 UTC | |
by davido (Cardinal) on Oct 14, 2005 at 15:33 UTC | |
by mhearse (Chaplain) on Oct 14, 2005 at 15:52 UTC | |
by 5mi11er (Deacon) on Oct 14, 2005 at 18:55 UTC |