The hash: keys 50:20:6:4, topic 1, and 5 index with its totals and so on$bighash{$key1}{$key2}{$key3}{$key4}[$topic-1][$index-1] = $total;
For each set of keys in specific $topic I have a set of index: index1, index2, index3...indexN and its total I want to sort the $index by the value of its $total, without affecting the order of the $keys and $topic and return...$VAR1 = {'50' -> { ..........'20' -> { .............'6' -> { ...............'4' -> | ...................| ....................'30', ....................'40', ....................'20', ....................'20', ....................'10' ....................|, ....................| ....................'28', ....................'10', ....................'76', ....................'20', ....................'10' ....................|, ........{'60' => { ..........'30' => { ............'6' => { ...............'4' => | | ....................'30',
I wrote the word "index.." besides each total as an example, because I need to keep track of which index was, as another key. So maybe my initial hash structure was not ok.$VAR1 = {'50' => { ...........'20' => { ............'6' => { .............'4' => | .....................| ....................'40',=>index2 ....................'30',=>index1 ....................'20',=>index3 ....................'20',=>index4 ....................'10'=>index5 .....................|,
How do I sort those values without affecting the whole hash structure?, and is it my hash structure? OK?
Thanksedited by ybiC: balanced <code> tags around output examples
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |