in reply to Sorting by Array values, obtaining indices

Try something like this:

@vals = @hash{0 .. 4};