Is $keyscore inside of the by_score subroutine the same as the one from your loop? At guess, I'd say it's not. Try putting the subroutine inline:
foreach $keyscore (sort { $totalscoreinv{$keyscore}{$b}<=>$totalscorei +nv{$keyscore}{$a} } keys %totalscoreinv) { ... }
In reply to Re: Sorting by the value of the inner hash
by duff
in thread Sorting by the value of the inner hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |