<?xml version="1.0" encoding="windows-1252"?>
<node id="1001683" title="Re^3: sort hash of arrays of arrays" created="2012-10-31 11:16:01" updated="2012-10-31 11:16:01">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;How can I do the sort based on the 2nd item of the innermost array?&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;Okay. So you have a hash of arrays of arrays; something like this:&lt;code&gt;
{
  1 =&gt; [
    [1, 2, 3], 
    [6, 7, 8], 
    [16, 17, 18], 
    [26, 27, 28]
  ],
  2 =&gt; [
    [2, 3, 4], 
    [7, 8, 9], 
    [17, 18, 19], 
    [27, 28, 29]
  ],
  3 =&gt; [
    [3, 4, 5], 
    [8, 9, 10], 
    [18, 19, 20], 
    [28, 29, 30]
  ],
  4 =&gt; [
    [4, 5, 6], 
    [9, 10, 11], 
    [19, 20, 21], 
    [29, 30, 31]
  ],
}
&lt;/code&gt;

&lt;p&gt;The second item of &lt;i&gt;which&lt;/i&gt; innermost array?

&lt;p&gt;Each outer array contains multiple arrays. Which of those do you which to sort on? The first? The last? All of them?



&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;p align=right&gt; [http://thebottomline.cpaaustralia.com.au/|RIP Neil Armstrong]&lt;/p&gt;&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1001665</field>
<field name="parent_node">
1001676</field>
</data>
</node>
