in reply to index of the minimum element of the array

You don't say how "it doesn't work" but List::Utils min() returns the minimum value not its index. You could use List::MoreUtils first_index() function to then find the index, or adapt one of the solutions in How can I find the index of the biggest element in an array?
  • Comment on Re: index of the minimum element of the array