Depending on your exact problem, you may not need rank at
all. In C you often want to sort data by sorting an array of pointers and then referring to thinks indirectly through the sorted array. Perl arrays are already arrays of pointers, so it makes more sense in Perl just to sort the original array directly. (Untested code ahead.)
@sorted = sort {$b->[1] <=> $a->[1]} @total;
In general direct logic for accessing things by position is un-Perlish and it is worth trying to see if you can (not that you always can) avoid it...