Help for this page
use Data::Dumper; ... @b[sort{$a[$b]{total}<=>$a[$a]{total}}1..$#a] = 1..$#a; print Dumper(\@b);
$VAR1 = [ undef, # this is ignored because index begins at 1 ... 4, 3 ];