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.
@reportnL = sort { $total_o{$a} <=> $total_o{$b} } values (%total_o{$hero});
Change it to
@reportnL = sort { $total_o{$a} <=> $total_o{$b} } keys %total_o ;
UPDATE: Just noticed his was my 500th post.
In reply to Re: sort hash by value
by grep
in thread sort hash by value
by convenientstore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |