<?xml version="1.0" encoding="windows-1252"?>
<node id="654435" title="Re: sort hash by value" created="2007-12-02 13:11:40" updated="2007-12-02 08:11:40">
<type id="11">
note</type>
<author id="133383">
grep</author>
<data>
<field name="doctext">
I'm not quite sure what your doing with all that code, there seem to be quite a few mistakes. Which makes it hard for me to follow.
&lt;p&gt;
But as to your main point of the sort not working: You're sending in the values but treating them like keys and trying to do a lookup. &lt;br&gt;
&lt;code&gt;@reportnL = sort { $total_o{$a} &lt;=&gt; $total_o{$b} } values (%total_o{$hero});&lt;/code&gt;
&lt;p&gt;
Change it to&lt;br&gt; 
&lt;code&gt;@reportnL = sort { $total_o{$a} &lt;=&gt; $total_o{$b} } keys %total_o ;&lt;/code&gt;

&lt;p&gt;
UPDATE: Just noticed his was my 500th post.
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-133383"&gt;
[id://133383|grep]&lt;br \&gt;
&lt;tt&gt;One dead unjugged rabbit fish later...&lt;/tt&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
654433</field>
<field name="parent_node">
654433</field>
</data>
</node>
