Don't ask to ask, just ask | |
PerlMonks |
Re: sorting arrays in respect to a different hash's valuesby linuxer (Curate) |
on May 23, 2009 at 14:19 UTC ( [id://765827]=note: print w/replies, xml ) | Need Help?? |
Maybe this little example helps.
Update: modified test data in code If your hash values are plain strings, than you just need to do something like:
See sort for more information about sort and the ways, how you can influence the sort. Also see Schwartzian Transform Update2: replaced <=> with cmp in second example; Thanks to AnomalousMonk and roboticus for pointing me on that.
In Section
Seekers of Perl Wisdom
|
|