in reply to sort an array by an specific element

You can sort it numerically or alphabetically, ascending or descending, but you can't sort an array by an element. Perhaps you mean an array of arrays, in which case, see atcroft's response.

While you are at it, do as Fletch suggested. Read up on perl data structures. They are, after all, the very basis of most all further perl learning.

  • Comment on Re: sort an array by an specific element