Close. I think you want $#entries, $array[i] and $array[j].
In reply to Re: Re: Re: Tedious array sort revisited by zakb in thread Tedious array sort revisited by gatornek