for my $key (sort { $ref->{$b}->[CONSTANT] <=> $ref->{$a}->[CONSTANT] } keys %$ref) #### for my $key (sort { $ref->{$b} <=> $ref->{$a} } keys %$ref)