in reply to Problem with HOA.
my @array = map { $hash{$_}->[0] } sort { $a <=> $b } keys %hash;
That's the first solution that comes to my mind. Try reading it backwards:
- Take the keys of the hash... (keys %hash)
- ...sort them numerically... (sort { $a <=> $b } ...)
- ...and get the first element of the array corresponding to each key in the hash... (map { $hash{$_}->[0] } ...)
In Section
Seekers of Perl Wisdom