Stickybit has asked for the wisdom of the Perl Monks concerning the following question:
Hi everyone
Got a tricky one .. that I'm havin trouble with wrappin' my head around. :-)
I got a hash:
$Records{'CustomerID'}{'Meta'}{'Name'} $Records{'CustomerID'}{'Packages'}{'PackageID'} ... and some more irrelevant stuff. :-)
I would like to sort the hash alphabetically on {'CustomerID'}{'Meta'}{'Name'} and thus returning the correct 'CustomerID's. I did start out here:
foreach $Customer (sort { $Records->{$a}{'Meta'}{'Name'} cmp $Records->{$b}{'Meta'}{'Name'} } keys %Records) {.. but .. ahem .. gaah .. does not compute. A hint on how to reach the correct syntax for my sorting, would be much apretiated. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting hash on deep value
by hippo (Archbishop) on Nov 04, 2019 at 11:40 UTC | |
|
Re: Sorting hash on deep value
by tobyink (Canon) on Nov 04, 2019 at 11:26 UTC | |
by Anonymous Monk on Nov 10, 2019 at 16:27 UTC | |
|
Re: Sorting hash on deep value
by LanX (Saint) on Nov 04, 2019 at 11:20 UTC | |
|
Re: Sorting hash on deep value
by BillKSmith (Monsignor) on Nov 04, 2019 at 16:58 UTC | |
|
Re: Sorting hash on deep value
by Fletch (Bishop) on Nov 04, 2019 at 14:24 UTC | |
|
Re: Sorting hash on deep value
by Anonymous Monk on Nov 07, 2019 at 01:27 UTC | |
by haukex (Archbishop) on Nov 07, 2019 at 07:45 UTC |