in reply to Need explanation of frequency counting and ranking in a hash (was: can anyone explain)

What's there to explain? I can tell you what it does, but will that be helpful?
$num = $freq{$array[0]}{"freq"}++; $freq{$array[0]}{"value"}[$num] = $_;
It seems that %freq contains a hashref belonging to whatever key is stored in the first element of @array. That hashref has a key "freq", whose old value is stored in $num and is then incremented. The hashref also has a key "value", whose value is an arrayref. On postion $num, $_ is stored. This probably could have been written much simpler as:
push @{$freq {$array [0]} {value}} => $_;
my @sorted_array = sort {$freq{$b}{"freq"} <=> $freq{$a}{"freq"}} keys + %freq;
Here the keys of the hash are sorted, and they are ordered on how many elements there are in the array @{$freq {$array [0]} {value}}

Abigail