in reply to changing the position of an element in an array

Trying yourself is allways good :)
hint: Use grep to find your element, splice to delete it, then push it on the array.
Ps. Also use the Super Search, all of your 3 sub-questions have been answered here many times, and there are many ways to do it.

"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
  • Comment on Re: changing the position of an element in an array