josh097 has asked for the wisdom of the Perl Monks concerning the following question:
What would be the best/simplest way to sort the array according to the value stored in the hash reference?my @id = ('001', '010', '014', '060', '071-1'); my $lid = {}; $lid->{'001'} = "United States"; $lid->{'010'} = "Mexico"; $lid->{'014'} = "Canada"; $lid->{'060'} = "Germany"; $lid->{'071-1'} = "Italy";
014 060 071-1 010 001
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I sort an array by hash value?
by moritz (Cardinal) on Aug 17, 2009 at 20:39 UTC | |
by josh097 (Initiate) on Aug 17, 2009 at 20:53 UTC | |
by ikegami (Patriarch) on Aug 17, 2009 at 21:02 UTC | |
by josh097 (Initiate) on Aug 17, 2009 at 22:02 UTC | |
by AnomalousMonk (Archbishop) on Aug 17, 2009 at 22:25 UTC | |
by ikegami (Patriarch) on Aug 18, 2009 at 06:52 UTC | |
by vitoco (Hermit) on Aug 18, 2009 at 03:31 UTC | |
|
Re: How do I sort an array by hash value?
by Tanktalus (Canon) on Aug 18, 2009 at 04:23 UTC |