my @keys_sorted_by_converted_value = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [ $_, fmt($hash{$_}) ] } keys %hash;