Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I've had a search for this and if I've read the answer anywhere I haven't recognised it as such.
I want to sort a hash by its value...but its value is an array. I want to use the first element in that array for sorting.
i.e. to sort a hash by $hash{$key}[0]
It's possible that this is a stupid thing to do and that's why I can't find anything on it.
Anyway, thanks for reading.
MorayJ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting an hash of an array by a value in the array
by BrowserUk (Patriarch) on Jan 12, 2012 at 15:17 UTC | |
by Anonymous Monk on Jan 12, 2012 at 16:10 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |