in reply to Type of arg 1 to shift must be array (not sort)

<tt class='inlinecode'>shift</tt> requires an array for argument, not a list. Perhaps you want (sort @array)[0]?

Update: s/sort requires/shift requires/