|Keep It Simple, Stupid|
Re: need to sort array of hashby dsheroh (Prior)
|on Dec 22, 2018 at 11:19 UTC||Need Help??|
I have a solution, included below.
It is an ugly solution. It is a fragile solution.
This is because you have a horrible data structure and have not fully specified the problem. If you give it data where a "Task*" key has any sibling keys, you will get undefined results because there's no expectation that the correct inner hash will be the first one returned by values.
But, with those caveats:
 The "Task*" layer is superfluous. It really looks like your sub-hashes with the actual data should be stored directly in the outer array, without the intermediate single-key hashes. Any time you think you want a hash with keys named "Foo1", "Foo2", "Foo3"..., odds are you actually want an array, not a hash.
 What should be done if one of the intermediate-layer hashes has more than one "Task*" key, or any keys other than the single "Task*" key? (If that's never allowed to happen, then see .)